🏠 Home 

Greasy Fork is available in English.

爆杀网络阴阳人

屏蔽那些阴阳怪气的言论!还世界一个清净。


安装此脚本?
  1. // ==UserScript==
  2. // @name 爆杀网络阴阳人
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.44
  5. // @description 屏蔽那些阴阳怪气的言论!还世界一个清净。
  6. // @author Mahiru Shiina (Mahiru)/Meowrain
  7. // @match http://*/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @source https://github.com/MakinoharaShoko/NoYYGQ
  10. // @include https://www.bilibili.com/*
  11. // @include https://www.zhihu.com/*
  12. // @include https://space.bilibili.com/*
  13. // @include https://tieba.baidu.com/*
  14. // @include https://www.weibo.com/*
  15. // @include https://weibo.com/*
  16. // @grant none
  17. // ==/UserScript==
  18. 'use strict';
  19. let blackList = [];
  20. fetch("https://ghproxy.org/https://raw.githubusercontent.com/meowrain/NoYYGQ/main/block.json")
  21. .then((response) => {
  22. return response.json();
  23. })
  24. .then((data) => {
  25. blackList = data.blockedWords;
  26. console.log(blackList);
  27. }).catch((err) => {
  28. console.log(err);
  29. });
  30. const siteList = ['.j_th_tit','.d_post_content j_d_post_content','.threadlist_abs threadlist_abs_onlyline','.t_con', '.p_content', '.lzl_cnt', '.CommentRichText', '.RichContent-inner', '.text', '.text-con', '.WB_text W_f14', '.WB_text', '.reply-content'];
  31. (function () {
  32. function debounce(fn, wait) {
  33. const timeout = null;
  34. return function () {
  35. if (timeout !== null) clearTimeout(timeout);
  36. timeout = setTimeout(fn, wait);
  37. };
  38. }
  39. // 处理函数
  40. function handle() {
  41. for (let j = 0; j < siteList.length; j++) {
  42. document.querySelectorAll(siteList[j]).forEach(function (item) {
  43. const str = item.textContent;
  44. for (let i = 0; i < blackList.length; i++) {
  45. const r = new RegExp(blackList[i]);
  46. const res = r.test(str);
  47. if (res) {
  48. console.log(blackList[i] + " FOUND");
  49. item.style.borderRadius = "4px";
  50. item.style.color = "rgba(0,0,0,0)";
  51. item.style.background = `rgba(0,92,175,0.3)`;
  52. // item.remove();
  53. item.addEventListener("mouseover", function (event) {
  54. item.style.color = "black";
  55. item.style.background = "none";
  56. });
  57. item.addEventListener("mouseout", function (event) {
  58. item.style.borderRadius = "4px";
  59. item.style.color = "rgba(0,0,0,0)";
  60. item.style.background = `rgba(0,92,175,0.3)`;
  61. });
  62. }
  63. }
  64. });
  65. }
  66. }
  67. // 滚动事件
  68. window.addEventListener("scroll", debounce(handle, 1000));
  69. })();