Greasy Fork

Greasy Fork is available in English.

/

当前为 2025-04-08 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         視
// @namespace    /
// @version      5.0
// @description  /
// @author       (c)2025 facaikotei
// @match        *://*/*
// @grant        GM_addElement
// @grant        GM_addStyle
// @grant        GM_setValue
// @grant        GM_getValue
// @require      https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/jwerty/0.3.2/jwerty.min.js
// @require      https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/sentinel-js/0.0.5/sentinel.min.js
// @license      MIT
// @homepageURL  http://greasyfork.icu/scripts/529908
// ==/UserScript==

(function () {
    'use strict';

    sentinel.on("#MyUpDown", function () {
        GM_addElement(document.querySelector(".MyBT"), "div", { id: "MyImage", class: "jianBian", textContent: "图片" });
        GM_addElement(document.querySelector("#MyImage"), "div", { style: "opacity: 0;", textContent: "图片" });
        GM_addStyle(".MyBT>div>div { width: 150px; }");
        document.querySelector("#MyImage").addEventListener("click", function () {
            jwerty.fire(GM_getValue("shortCutString", "alt+W"));
        });
        sentinel.off("#MyUpDown");
    });
    sentinel.on(".tyc-image-container", function () {
        GM_setValue("shortCutString", document.querySelector(".shortCutString").value);
        document.querySelector(".shortCutString").addEventListener("change", function () {
            GM_setValue("shortCutString", document.querySelector(".shortCutString").value);
        });
    });
})();