自動簡轉繁

try to take over the world!

目前為 2020-03-02 提交的版本,檢視 最新版本

// ==UserScript==
// @name         自動簡轉繁
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  try to take over the world!
// @author       You
// @include      *
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_registerMenuCommand
// ==/UserScript==

function job() {
    function init() {
        document.getElementById("StranLink").style="display:none;";
        StranBody();
    }
    var remoteScript = document.createElement('script');
    remoteScript.src = 'https://admin-ll55.github.io/sc2tc/locale.simplified.min.js?ts='+(+new Date());
    remoteScript.onload = init;
    document.body.appendChild(remoteScript);
}
function add2matchlist () {
    if (domain_list.indexOf(domain) == -1) {
        domain_list.push(domain);
        GM_setValue("domain_list", JSON.stringify(domain_list));
        job();
        console.log(JSON.parse(GM_getValue("domain_list")))
    }
}
function removefrommatchlist () {
    var index = domain_list.indexOf(domain);
    if (index != -1) {
        domain_list.splice(index, 1);
        GM_setValue("domain_list", JSON.stringify(domain_list));
        console.log(JSON.parse(GM_getValue("domain_list")))
    }
}
var domain = window.location.href.match(/\/\/(.*?)\//)[1];
var domain_list = GM_getValue("domain_list");
if (domain_list) {
    domain_list = JSON.parse(domain_list);
}
else {
    domain_list = [];
}
console.log(domain_list);
GM_registerMenuCommand ("Add "+domain+" to match list", add2matchlist, "A");
GM_registerMenuCommand ("Remove "+domain+" from match list", removefrommatchlist, "R");

if (domain_list.indexOf(domain) != -1) {
    job();
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址