您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Murderise target="_blank"
// ==UserScript== // @name Untarget _blank // @namespace https://git.sr.ht/~remph // @include * // @grant none // @version 0.2 // @author Remph // @description Murderise target="_blank" // @license GPL-3.0-or-later // ==/UserScript== function unblank(root) { root.querySelectorAll( 'a[target="_blank"], base[target="_blank"]' // form[target="_blank"] ).forEach((a) => a.setAttribute('target', '_self')); // could also removeAttribute } (function() { unblank(document.body); // run straight away to unblank static content // hang around in the background to keep interfering new MutationObserver( (muts) => muts.forEach((mut) => unblank(mut.target)) ).observe(document.body, { subtree: true, childList: true, attributes: true }); })();