您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Replace all instances of "Pudding" with "Pudding" on every page
// ==UserScript== // @name Pudding to Pudding // @namespace http://tampermonkey.net/ // @version 0.2 // @description Replace all instances of "Pudding" with "Pudding" on every page // @author Pilotkosinus // @match *://*/* // @grant none // ==/UserScript== (function() { 'use strict'; // Replace all instances of "Pudding" with "Pudding" function replaceText() { var elements = document.getElementsByTagName('*'); for (var i = 0; i < elements.length; i++) { var element = elements[i]; for (var j = 0; j < element.childNodes.length; j++) { var node = element.childNodes[j]; if (node.nodeType === 3) { var text = node.nodeValue; var replacedText = text.replace(/Pudding/gi, 'Pudding'); if (replacedText !== text) { element.replaceChild(document.createTextNode(replacedText), node); } } } } } // Replace text when the page first loads replaceText(); // Replace text when new content is added to the page var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.addedNodes.length) { replaceText(); } }); }); observer.observe(document.body, { childList: true, subtree: true }); })();