您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This script opens tags links on www.w3school.com.cn in a new tab.
// ==UserScript== // @name Open Tags Links in New Tab for W3School // @namespace w3school_newtab // @description This script opens tags links on www.w3school.com.cn in a new tab. // @author AustinL // @include https://www.w3school.com.cn/* // @version 1.3 // @grant none // ==/UserScript== (function() { function modifyLinks() { var anchors = document.getElementsByTagName("a"); for (var i = 0; i < anchors.length; i++) { if (anchors[i].href.startsWith("https://www.w3school.com.cn/tags/")) { anchors[i].setAttribute("target", "_blank"); } } } var observer = new MutationObserver(modifyLinks); observer.observe(document, { childList: true, subtree: true }); modifyLinks(); // Handle existing links on the page })();