CNBeta首页广告隐藏

通过css隐藏首页滚动时加载的广告

  1. // ==UserScript==
  2. // @name CNBeta首页广告隐藏
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description 通过css隐藏首页滚动时加载的广告
  6. // @author woodj
  7. // @license MIT
  8. // @include *://www.cnbeta.com*
  9. // @icon https://www.cnbeta.com/images/logo_1.png
  10. // @require https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.2.4.js
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15. // 创建 <style> 标签
  16. var style = document.createElement("style");
  17. // 对WebKit hack :(
  18. style.appendChild(document.createTextNode(".trc_related_container { display: none; }"));
  19. // 将 <style> 元素加到页面中
  20. document.head.appendChild(style);
  21. setInterval(function() {
  22. $(".adsbygoogle").css("display", "none");
  23. $(".item.cooperation").css("display", "none");
  24. $(".baidu_dropdown_box").css("display", "none");
  25. }, 500);
  26. })();