Fuck Baidu

屏蔽搜索引擎中所有来自百度的搜索结果. 支持的搜索引擎: Google / Bing / Yahoo / Yandex / DuckDuckGo

  1. // ==UserScript==
  2. // @name Fuck Baidu
  3. // @name:zh-CN 去你妈的百度
  4. // @name:en-US Fuck Baidu
  5. // @namespace http://tampermonkey.net/
  6. // @version 1.7.4
  7. // @description 屏蔽搜索引擎中所有来自百度的搜索结果. 支持的搜索引擎: Google / Bing / Yahoo / Yandex / DuckDuckGo
  8. // @description:zh-CN 屏蔽搜索引擎中所有来自百度的搜索结果. 支持的搜索引擎: Google / Bing / Yahoo / Yandex / DuckDuckGo
  9. // @description:en-US Block search results from Baidu in search engines. Supported search engines: Google / Bing / Yahoo / Yandex / DuckDuckGo
  10. // @author Hijack_Nick & Spectrollay
  11. // @match *://*.google.com/*
  12. // @match *://*.google.com.hk/*
  13. // @match *://*.google.com.tw/*
  14. // @match *://*.bing.com/*
  15. // @match *://*.yahoo.com/*
  16. // @match *://*.yandex.com/*
  17. // @match *://*.duckduckgo.com/*
  18. // @grant none
  19. // @license MIT
  20. // ==/UserScript==
  21.  
  22. (function () {
  23. 'use strict';
  24.  
  25. const filterKeywords = ['baidu.', '220.181.38.149'];
  26.  
  27. function filterResults() {
  28. let results = [];
  29.  
  30. if (location.hostname.includes('google.com')) {
  31. results = document.querySelectorAll('.g');
  32. } else if (location.hostname.includes('bing.com')) {
  33. results = document.querySelectorAll('.b_algo');
  34. } else if (location.hostname.includes('yahoo.com')) {
  35. results = document.querySelectorAll('.dd.algo');
  36. } else if (location.hostname.includes('yandex.com')) {
  37. results = document.querySelectorAll('.k_5ay1tJkv0OU_card');
  38. } else if (location.hostname.includes('duckduckgo.com')) {
  39. results = document.querySelectorAll('li[data-layout="organic"]');
  40. }
  41.  
  42. results.forEach(result => {
  43. const resultText = result.innerText.toLowerCase();
  44.  
  45. filterKeywords.forEach(keyword => {
  46. if (resultText.includes(keyword)) {
  47. result.style.display = 'none';
  48. }
  49. });
  50. });
  51. }
  52.  
  53. filterResults();
  54.  
  55. const searchInput = document.querySelector('input[name="q"], input[name="p"], input[name="text"], #sb_form_q');
  56. if (searchInput) {
  57. searchInput.addEventListener('input', () => {
  58. const results = document.querySelectorAll('.g, .b_algo, .dd.algo, .k_5ay1tJkv0OU_card, li[data-layout="organic"]');
  59. results.forEach(result => {
  60. result.style.display = '';
  61. });
  62. filterResults();
  63. });
  64.  
  65. const searchForm = searchInput.closest('form');
  66. if (searchForm) {
  67. searchForm.addEventListener('submit', (event) => {
  68. event.preventDefault();
  69. filterResults();
  70. });
  71. }
  72. }
  73.  
  74. const observer = new MutationObserver((mutations) => {
  75. mutations.forEach((mutation) => {
  76. if (mutation.addedNodes.length || mutation.removedNodes.length) {
  77. filterResults();
  78. }
  79. });
  80. });
  81.  
  82. observer.observe(document.body, { childList: true, subtree: true });
  83.  
  84. })();

QingJ © 2025

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