您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Simple syntax simplification function
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/487608/1333587/GrammarSimplified.js
// ==UserScript== // @name GrammarSimplified // @version 2024/02/26 // @author HentaiSaru // @description Simple syntax simplification function // @namespace https://greasyfork.org/users/989635 // @match *://*/* // ==/UserScript== class API{constructor(){this.ListenerRecord=new Map;this.Parser=new DOMParser;this.GM={__verify:a=>void 0!==a?a:null,set:function(a,b){GM_setValue(a,b)},get:function(a,b){return this.__verify(GM_getValue(a,b))},setjs:function(a,b){GM_setValue(a,JSON.stringify(b,null,4))},getjs:function(a,b){return JSON.parse(this.__verify(GM_getValue(a,b)))}};this.Template={log:a=>console.log(a),warn:a=>console.warn(a),error:a=>console.error(a),count:a=>console.count(a)}}$$(a,b=!1,c=document){const e=a.slice(1);switch([".","#"," ","="].some(d=>e.includes(d))?" ":a[0]){case "#":return c.getElementById(e);case " ":return b?c.querySelectorAll(a):c.querySelector(a);case ".":a=c.getElementsByClassName(e);break;default:a=c.getElementsByTagName(a)}return b?Array.from(a):a[0]}DomParse(a){return this.Parser.parseFromString(a,"text/html")}IllegalCharacters(a){return a.replace(/[\/\?<>\\:\*\|":]/g,"")}ExtensionName(a){try{return a.match(/\.([^.]+)$/)[1].toLowerCase()||"png"}catch{return"png"}}WorkerCreation(a){a=new Blob([a],{type:"application/javascript"});return new Worker(URL.createObjectURL(a))}sleep(a){return new Promise(b=>setTimeout(b,1E3*a))}async AddStyle(a,b="New-Style"){let c=document.getElementById(b);c||(c=document.createElement("style"),c.id=b,document.head.appendChild(c));c.appendChild(document.createTextNode(a))}async AddScript(a,b="New-Script"){let c=document.getElementById(b);c||(c=document.createElement("script"),c.id=b,document.head.appendChild(c));c.appendChild(document.createTextNode(a))}async AddListener(a,b,c,e={}){this.ListenerRecord.has(a)&&this.ListenerRecord.get(a).has(b)||(a.addEventListener(b,c,e),this.ListenerRecord.has(a)||this.ListenerRecord.set(a,new Map),this.ListenerRecord.get(a).set(b,c))}async RemovListener(a,b){if(this.ListenerRecord.has(a)&&this.ListenerRecord.get(a).has(b)){const c=this.ListenerRecord.get(a).get(b);a.removeEventListener(b,c);this.ListenerRecord.get(a).delete(b)}}async Listen(a,b,c,e={},d=null){try{a.addEventListener(b,c,e),d&&d(!0)}catch{d&&d(!1)}}async WaitElem(a,b,c,e){let d,f,g;const h=new MutationObserver(()=>{f=b?document.querySelectorAll(a):document.querySelector(a);if(g=b?0<f.length&&Array.from(f).every(k=>null!==k&&"undefined"!==typeof k):f)h.disconnect(),clearTimeout(d),e(f)});h.observe(document.body,{childList:!0,subtree:!0});d=setTimeout(()=>{h.disconnect()},1E3*c)}async WaitMap(a,b,c){let e,d;const f=new MutationObserver(()=>{d=a.map(g=>document.querySelector(g));d.every(g=>null!==g&&"string")&&(f.disconnect(),clearTimeout(e),c(d))});f.observe(document.body,{childList:!0,subtree:!0});e=setTimeout(()=>{f.disconnect()},1E3*b)}async log(a=null,b="print",c="log"){c="string"===typeof c&&this.Template[c]?c:c="log";if(null==a)this.Template[c](b);else console.groupCollapsed(a),this.Template[c](b),console.groupEnd()}store(a,b,c=null){switch(a[0]){case "g":return this.GM[a](b,c);case "s":return null!==c?this.GM[a](b,c):null;default:return Error("wrong type of operation")}}async Menu(a){for(const [b,c]of Object.entries(a))GM_registerMenuCommand(b,()=>{c()})}};