您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Delete all disabled and duplicated scripts.
// ==UserScript== // @name Tampermonkey Clean tmclean // @namespace https://userscript.snomiao.com/ // @version 0.0.1 // @description Delete all disabled and duplicated scripts. // @author [email protected] // @match *://calendar.google.com/* // @grant none // ==/UserScript== // chrome-extension://dhdgffkkebhmkfjojejmpbldmpobfkfo/options.html#url=aHR0cHM6Ly93d3cuemhpaHUuY29tL2NyZWF0b3I=&nav=dashboard // delete all disabled scripts [...document.querySelectorAll('[title="Delete"]')] .filter((e) => e.parentElement.parentElement.parentElement.innerHTML.match( /title="Disabled"/ ) ) .map((e) => e.click()); // delete duplicated scripts (keep the first) [...document.querySelectorAll("tr.scripttr")] .map((e) => ({ id: e.querySelector(".script_name")?.textContent, e, })) .filter(({ id }) => id) .reduce( (dups, { id, e }, i, a) => [ ...dups, a.slice(0, i).find((e) => e.id === id), ], [] ) .filter((e) => e) .map(({ id, e }) => { console.log("Delete " + id); e.querySelector('[title="Delete"]').click(); });