☰

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 για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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