必应搜索过滤

过滤必应和谷歌的搜索结果。包括几个不方便的网站、国内假新闻站和个人需要临时忽略的网站的过滤。

目前为 2025-03-23 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name 必应搜索过滤
  3. // @namespace huelse/js-scripts/bing-filter
  4. // @version 1.0.1.2
  5. // @description 过滤必应和谷歌的搜索结果。包括几个不方便的网站、国内假新闻站和个人需要临时忽略的网站的过滤。
  6. // @author limbopro
  7. // @license MIT
  8. // @match https://www.google.com/search*
  9. // @match https://www.google.com.hk/search*
  10. // @match https://www.bing.com/search*
  11.  
  12. // @match https://cn.bing.com/search*
  13.  
  14. // @match https://www.bing.com/?FORM*
  15. // @icon https://www.bing.com/favicon.ico
  16. // @run-at document-end
  17. // @grant none
  18. // ==/UserScript==
  19. /* 源码地址
  20. // https://limbopro.com/Adguard/contentFarm/contentFarm.js 每日更新;供 Quantumult X / Surge 等代理软件调用;
  21. // https://raw.githubusercontent.com/limbopro/Adblock4limbo/main/Adguard/contentFarm/contentFarm.js push 后更新至GitHub 方便查看历史更新内容
  22. */
  23.  
  24. /*
  25. Written by limbopro
  26. https://limbopro.com/archives/block-contentfarm.html
  27. https://t.me/Adblock4limbo
  28. There are 7179 content farm domains in total until now.
  29. Last updated at 31/5月/2024/23:12
  30. */
  31.  
  32.  
  33. /*
  34. Google TxT Ads block
  35. */
  36.  
  37. function contentFarm_AdsRemove_Auto(){
  38.  
  39. //var ads_cssSelectors = [
  40. //"[data-text-ad]",
  41. //"#tvcap"
  42. //];
  43. //var ads_List = document.querySelectorAll( ads_cssSelectors );
  44. //if (ads_List.length >0) {
  45. //for (xyz = 0; xyz < ads_List.length; xyz++){
  46. //ads_List[xyz].style.display = "none";
  47. //}
  48. //}
  49. /*
  50. var ads_cssSelectors = ["[data-text-ad],#tvcap"];
  51. var ads_List = document.querySelectorAll( ads_cssSelectors );
  52. var ads_Block;
  53. for (ads_Block = 0; ads_Block < ads_List.length; ads_Block++){
  54. ads_List[ads_Block].style.display = "none";
  55. }
  56. */
  57. /*
  58. content farm domains list.
  59. */
  60. var ads_host = [
  61.  
  62. ".pc6.com",
  63. ".jb51.net",
  64. "://myqqjd.com",
  65. ".elecfans.com",
  66. ".shangyexinzhi.com",
  67. "://aigcdaily.cn",
  68. //".guancha.cn",
  69. ".people.com.cn",
  70. ".pdnews.cn",
  71. ".cctv.cn",
  72. ".cctv.com",
  73. ".news.cn",
  74. ".china.com.cn",
  75. ".china.com",
  76. ".hunantoday.cn",
  77. "://chinareform.net",
  78. ".szhgh.com",
  79. ".m4.cn",
  80. ".fx168news.com",
  81. ".youth.cn",
  82. "://qbitai.com",
  83. "://zhenyes.com",
  84. ".bbtnews.com.cn",
  85. ".caijing.com.cn",
  86. ".10jqka.com.cn",
  87. ".jrj.com.cn",
  88. ".mydrivers.com",
  89. ".cnstock.com",
  90. ".eastmoney.com",
  91. ".qianzhan.com",
  92. ".xinmin.cn",
  93. ".sqxfw.net",
  94. ".chanyejiawang.com",
  95. ".baai.ac.cn",
  96. "://tre6.com",
  97. "://mnsac.com",
  98. "://shengco.com.cn",
  99. ".wyzxwk.com",
  100. //"://dictionary.cambridge.org",
  101. "://weidown.com",
  102. ".xinhuanet.com",
  103. ".chinadaily.com.cn",
  104. ".uivita.com",
  105. ".dedaozhishi.cn",
  106. ".chinanews.com.cn",
  107. ".hswh.org.cn",
  108. ".stdaily.com",
  109. ".962.net",
  110. ".kxdw.com",
  111. ".jb51.net",
  112. ".xitongzhijia.net",
  113. ".pcsoft.com.cn",
  114. "://www.msn.cn/zh-cn/",
  115. ".gushiwen.cn",
  116. "://guid.cam",
  117. ".j9p.com",
  118. ".baobeiy.com",
  119. ".ludown.com",
  120. ".ittel.cn",
  121. "://cj.sina.cn",
  122. "://cj.sina.com.cn",
  123. ".vocofm.com",
  124. "://www.12371.cn",
  125. "://www.youth.cn",
  126.  
  127.  
  128. "zditect.com",
  129. "whatthefuck.wtf"
  130. //"csdn.net"
  131. ];
  132. var search_results_css = [
  133. "li.b_algo", // bing 搜索结果样式
  134. ".mnr-c.xpd.O9g5cc.uUPGi", // Google 富文本搜索结果 style
  135. "div[data-sokoban-grid]", // 通用
  136. "div.Ww4FFb.vt6azd.xpd.EtOod.pkphOe", // 新增 2023.08.27
  137. "div.g", // Google PC 搜索结果样式
  138. "div[class='g'][data-hveid]", // 这是谷歌PC端搜索结果页的 style
  139. "div[class='mnr-c g'][data-hveid]", // 这是谷歌手机端搜索结果页的 style
  140. "div[class][data-sokoban-container]"// 最后一个选择器也不需要逗号结尾
  141. ]
  142. var i, x;
  143. setTimeout(() => {
  144. var huge = document.querySelectorAll(search_results_css);
  145. console.log("捕获" + huge.length + "个有效样式!")
  146. for (i = 0; i < ads_host.length; i++) {
  147. var ads_host_css = "[href*='" + ads_host[i] + "']";
  148. for (x = 0; x < huge.length; x++) {
  149. if (huge[x].querySelectorAll(ads_host_css).length) {
  150. huge[x].remove();
  151. console.log(huge[x].textContent + " -> 涉及内容农场!已移除!")
  152. }
  153. }
  154. }
  155. }, 500);
  156. timecount +=1;
  157. console.log("循环第" + timecount + "次")
  158. if (timecount === 1) {
  159. clearInterval(id);
  160. console.log("循环结束!")
  161. }
  162. }
  163. contentFarm_AdsRemove_Auto();
  164. var timecount = 0;
  165. var id = setInterval(contentFarm_AdsRemove_Auto, 2000);

QingJ © 2025

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