GetJavCover

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

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

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

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