Replace "Level" with "Game" on Bopimo

Replace most instances of "level" to "game" on bopimo.

目前為 2025-01-16 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Replace "Level" with "Game" on Bopimo
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Replace most instances of "level" to "game" on bopimo.
  6. // @author Teemsploit
  7. // @match https://www.bopimo.com/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. function replaceTextExceptLinks() {
  16. const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null, false);
  17. let node;
  18. while ((node = walker.nextNode())) {
  19. if (!node.parentNode.closest('a')) {
  20. node.nodeValue = node.nodeValue.replace(/level/gi, 'game');
  21. }
  22. }
  23. }
  24.  
  25. replaceTextExceptLinks();
  26. })();