搜索引擎去广告

搜索引擎去除广告信息,干净无其它任何功能

  1. // ==UserScript==
  2. // @name 搜索引擎去广告
  3. // @namespace joyber
  4. // @version 0.5
  5. // @description 搜索引擎去除广告信息,干净无其它任何功能
  6. // @author joyber
  7. // @match https://*.bing.com/*
  8. // @match https://*.baidu.com/s*
  9. // @match https://*.google.com/search*
  10. // @require http://libs.baidu.com/jquery/2.0.0/jquery.min.js
  11. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  12. // @grant none
  13. // @license MIT
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18. // bing.com
  19. let cssText = '.b_ad{display:none;}#taw{display:none}';
  20. let styleDom = document.createElement('style'), head = document.head || document.getElementsByTagName('head')[0]; //获取head元素
  21. styleDom.type = 'text/css'; //这里必须显示设置style元素的type属性为text/css
  22. let textNode = document.createTextNode(cssText);
  23. styleDom.appendChild(textNode);
  24. head.appendChild(styleDom); //把创建的style元素插入到head中
  25.  
  26. //baidu.com
  27. if (location.host.indexOf('baidu.com') > -1) {
  28. let adremove = function(){$('._2z1q32z').remove();$(".result.c-container.new-pmd:contains('广告')").remove();}
  29. $(function(){
  30. setInterval(adremove, 100)
  31. adremove()
  32. })
  33. }
  34.  
  35. //google.com
  36. if (location.host.indexOf('google') > -1) {
  37. let dom = document.getElementById("taw")
  38. if (dom) dom.remove()
  39. }
  40. })();

QingJ © 2025

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