☰

JavDB2MissAV

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

您需要先安裝使用者腳本管理器擴展,如 Tampermonkey、Greasemonkey 或 Violentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 Tampermonkey或 Violentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 Tampermonkey或 Userscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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 -----");
})();