网页特定文本屏蔽器

网页特定文本屏蔽器 ,被屏蔽的文本会被划上黑线

  1. // ==UserScript==
  2. // @name 网页特定文本屏蔽器
  3. // @version 1.0.0
  4. // @description 网页特定文本屏蔽器 ,被屏蔽的文本会被划上黑线
  5. // @author WildXBird
  6. // @match https://www.tampermonkey.net/scripts.php
  7. // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
  8. // @grant none
  9. // @license MIT
  10. // @match *://*/*
  11. // @namespace https://gf.qytechs.cn/users/1066035
  12. // ==/UserScript==
  13.  
  14. (function () {
  15. 'use strict';
  16.  
  17. const blockedList = new Set()
  18. const operation = () => {
  19. //修改这里为你要屏蔽的文本
  20. const blockTexts = ["deepseek"]
  21.  
  22. let walker = document.createTreeWalker(
  23. document.body,
  24. NodeFilter.SHOW_TEXT,
  25. null,
  26. false
  27. );
  28.  
  29. let node;
  30. while ((node = walker.nextNode())) {
  31. if (blockedList.has(node)) {
  32. continue
  33. }
  34.  
  35. const text = node.textContent.trim().toLowerCase();
  36. for (let target of blockTexts) {
  37. if (text.includes(target.toLowerCase())) {
  38. blockedList.add(node)
  39. console.log("blocked=>", node)
  40. const element = node.parentElement
  41. element.style.backgroundColor = "black"
  42. element.style.color = "black"
  43. element.style.pointerEvents = "none"
  44. element.style.userSelect = "none"
  45. element.style.filter = `brightness(0)`
  46. }
  47. }
  48. }
  49. }
  50. operation()
  51. setInterval(operation, 2500)
  52. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址