Text Replacement

Replaces all text on a webpage with "fuc"

当前为 2023-11-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Text Replacement
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Replaces all text on a webpage with "fuc"
  6. // @author DAC
  7. // @match *://*/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. const replaceText = () => {
  15. const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null, false);
  16. while (walker.nextNode()) {
  17. const node = walker.currentNode;
  18. node.nodeValue = 'this page has been hacked';
  19. }
  20. };
  21.  
  22. // Wait for the page to load, then replace the text
  23. window.addEventListener('load', () => {
  24. replaceText();
  25. });
  26. })();