GetJavCover

在javBus番片详情页面上生成下载按钮,点击按钮自动下载封面大图

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         GetJavCover
// @namespace    https://www/github.com/coverli/
// @version      1.0.0
// @description  在javBus番片详情页面上生成下载按钮,点击按钮自动下载封面大图
// @author       CoverLi
// @match        目标网站
// @license      MIT
// @run-at       document-idle

// @include     *://*javbus.com/*
// @include     *://www.*bus*/*
// @include     *://www.*javsee*/*
// @include     *://www.*seejav*/*

// @grant       unsafeWindow
// @grant       GM_addStyle(css)
// ==/UserScript==

(function () {
    'use strict';
    var br = document.createElement("br");
    var btn = document.createElement("button");
    btn.class = "downloadBtn";
    btn.innerHTML = "下載";
    btn.style.width = "50px";
    btn.style.height = "50px";
    btn.style.background = "#6e8eb5";
    btn.style.borderRadius = "50%";
    btn.style.cursor = "pointer";
    btn.style.border = "none";
    btn.style.fontSize = "16px";
    btn.style.color = "ffffff";

    btn.onclick = function () {
        var url = document.getElementsByClassName('bigImage').item(0).href;
        var name = document.title.replace(' - JavBus', '');
        fetch(url).then(async res => await res.blob()).then((blob) => {
            const a = document.createElement('a');
            a.style.display = 'none';
            a.href = URL.createObjectURL(blob);
            a.download = name + '.jpg';
            document.body.appendChild(a);
            a.click();
            document.body.removeChild(a);
        })
    }
    var code = document.getElementsByClassName('header_hobby')[0];
    var empty = document.getElementsByClassName('header_hobby')[0];
    code.parentElement.insertBefore(btn, code);
    empty.parentElement.insertBefore(br, empty);
})();