☰

JavDB2MissAV

JavDB快速跳转到MissAV在线播放页

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         JavDB2MissAV
// @namespace    https://gitee.com/mirrors406
// @version      2025.11.08
// @description  JavDB快速跳转到MissAV在线播放页
// @author       Mirrors406
// @match        https://javdb.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
  "use strict";

  const isDetailPage = location.href.includes("/v/");

  const getMissAvSearch = (name) => `https://missav.ai/search/${name}`;
  const getMissAvDetail = (name) => `https://missav.ai/${name}`;

  /**处理详情页 */
  const handleDetailPage = () => {
    if (!isDetailPage) return;

    const nameDom = document
      .querySelector(".movie-panel-info")
      .querySelector(".first-block");

    const copyBtn = nameDom.querySelector(".copy-to-clipboard");
    const name = copyBtn.getAttribute("data-clipboard-text");

    const a = document.createElement("a");
    a.target = "_blank";
    a.className = "button is-white";
    a.style.color = "rgb(238, 97, 132)";
    a.textContent = "MissAV";

    a.href = getMissAvDetail(name);
    a.addEventListener("contextmenu", (e) => {
      e.preventDefault();
      window.open(getMissAvSearch(name));
    });

    nameDom.appendChild(a);
  };

  /**处理列表页 */
  const handleListPage = () => {
    if (isDetailPage) return;

    const handler = (item) => {
      const box = item.querySelector(":scope>.box");
      box.target = "_blank";

      const name = item
        .querySelector(".video-title")
        .querySelector("strong").innerText;

      const tagsDom = item.querySelector(".tags");

      const a = document.createElement("a");
      a.target = "_blank";
      a.className = "tag";
      a.style.marginLeft = "8px";
      a.style.color = "#fff";
      a.style.background = "rgb(238, 97, 132)";
      a.textContent = "MissAV";

      a.href = getMissAvDetail(name);
      a.addEventListener("contextmenu", (e) => {
        e.preventDefault();
        window.open(getMissAvSearch(name));
      });

      tagsDom.appendChild(a);
    };

    const list = document
      .querySelector(".movie-list")
      .querySelectorAll(":scope>.item");

    list.forEach((item) => {
      try {
        handler(item);
      } catch (error) {
        console.error(error);
      }
    });
  };

  handleDetailPage();
  handleListPage();
  console.log("---- JavDB To MissAV -----");
})();