您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
增加返回列表按钮
当前为
// ==UserScript== // @name GDFZOJ返回列表 // @version 1.1 // @description 增加返回列表按钮 // @author MlkMathew // @match *://*.gdfzoj.com*/* // @grant GM_setValue // @grant GM_getValue // @namespace https://greasyfork.org/users/1068192 // ==/UserScript== (function() { 'use strict'; const s=document.querySelectorAll('a'); if(window.location.href.match('exercise')||window.location.href.match('problems$')){ for(let i=0;i<s.length;i++) { if(s[i].href.match('problem/')){ //console.log(s[i]); GM_setValue(s[i].href,window.location.href); } } } //console.log(window.location.href); if(window.location.href.match('problem/')&&(!window.location.href.match('contest/'))){ //console.log(GM_getValue(window.location.href)); var x; const t=document.querySelectorAll('ul'); for(let i=0;i<t.length;i++) { if(t[i].role=='tablist'){ x=t[i]; } } //console.log(x); var add=document.createElement("li"); add.className="nav-item"; var y; for(let i=0;i<s.length;i++) { if(s[i].textContent==' 提交'){ y=s[i].cloneNode(true); } } y.textContent=' 返回列表'; y.dataset.toggle=''; y.href=GM_getValue(window.location.href); add.insertAdjacentElement("beforeend",y); x.insertAdjacentElement("beforeend",add); } })();