净化Baidu首页

A script to remove baidu AD.

  1. // ==UserScript==
  2. // @name 净化Baidu首页
  3. // @version 1.0
  4. // @description A script to remove baidu AD.
  5. // @match *://*.baidu.com/*
  6. // @namespace https://gf.qytechs.cn/users/1363287
  7. // ==/UserScript==
  8.  
  9. (function() {
  10. function main(){
  11. const observer = new MutationObserver(()=>{document.querySelector(`#s_wrap`);document.querySelector(`#s_wrap`).style.display = `none`;}); //处理广告
  12. observer.observe(document.body, {childList: true, subtree: true }); //以上述配置开始观察广告节点
  13. }
  14.  
  15. if (document.readyState === `loading`) {
  16. document.addEventListener(`DOMContentLoaded`, main); // 此时加载尚未完成
  17. } else {
  18. main();// 此时`DOMContentLoaded` 已经被触发
  19. }
  20.  
  21. })();

QingJ © 2025

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