屏蔽广告 网站(百度、csdn、凤凰网、百度文库、凤凰网等)

广告去除脚本

  1. // ==UserScript==
  2. // @name 屏蔽广告 网站(百度、csdn、凤凰网、百度文库、凤凰网等)
  3. // @namespace http://tampermonkey.net/
  4. // @version v0.307
  5. // @description 广告去除脚本
  6. // @author Skity666
  7. // @match https://*.baidu.com/*
  8. // @match http://*.baidu.com/*
  9. // @match https://*csdn.net*
  10. // @match https://www.zhihu.com/*
  11. // @match https://www.ifeng.com/*
  12. // @include https://*.baidu.com/*
  13. // @include https://*csdn.net*
  14. // @include https://www.zhihu.com/*
  15. // @grant none
  16. // @require https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js
  17. // ==/UserScript==
  18. //百度首页广告去除,csdn博客广告去除,csdn论坛广告去除、凤凰网广告去除 ,知乎登录(不可用)页面自动关闭
  19. //
  20. jQuery.noConflict();
  21. (function($) {
  22. '屏蔽百度广告,csdn全网广告';
  23.  
  24. setInterval(function(){
  25. filter()
  26. }, 1000);
  27. $(document).ready(function() {
  28. if(location.href.indexOf('www.zhihu.com')>0){
  29. closeZhiHu();
  30. }
  31. });
  32.  
  33. function filter(){
  34. //csdn首页
  35. if(location.href.indexOf('blog.csdn.net')>0){
  36. //推荐位第一广告
  37. $("[data-type='ad']")
  38. //左下角的广告
  39. $("#footerRightAds").remove();
  40. //博客评论上方的广告
  41. $("#dmp_ad_58").remove()
  42. //博客评论下方的广告
  43. $("#recommend-item-box-tow").remove();
  44. $(".adsbygoogle").remove();
  45. }
  46. //csdn论坛
  47. if(location.href.indexOf('bbs.csdn.net')>0){
  48. //本周牛人上方的广告
  49. $(".ad_top.bbs_left_box").remove()
  50. //右下方的广告
  51. $(".ad_1.bbs_left_box").remove();
  52.  
  53. //中部的广告
  54. $(".bbs_left_box .ad_1").remove();
  55. }
  56. //百度
  57. if(location.href.indexOf('www.baidu.com')>0){
  58. //右边栏的广告
  59. $("#zsyx_im0").remove()
  60. $("#m3423525928_canvas").remove()
  61. $("#m3424514202_canvas").remove()
  62.  
  63. $("div").each(function(){
  64. if($(this).attr("id")!='undefined'& $(this).attr("id")>3000){
  65. $(this).remove()
  66. }
  67. })
  68.  
  69. //百度右边栏
  70. if(localStorage.getItem("right-setting")!=null){
  71. //console.log(localStorage.getItem("right-setting"))
  72. $("#content_right").remove()
  73. }
  74.  
  75. //$("#content_right").remove()
  76.  
  77.  
  78. //第一层广告去除掉后出现的广告
  79. setTimeout(function(){
  80. $("div.result.c-container").each(function(){
  81. //console.log($("span:contains('广告')",this).length)
  82. if($("span:contains('广告')",this).length>0||$("a:contains('广告')",this).length>0){
  83. $(this).remove()
  84. }
  85.  
  86. })
  87. //$("div.result.c-container>.f13").parent().remove()
  88. }, 2000);
  89.  
  90. //百度首页
  91. $("span:contains('广告')").parent().parent().parent().remove()
  92.  
  93.  
  94. }
  95. //百度文库
  96. if(location.href.indexOf('wenku.baidu.com')>0){
  97. //中间内容栏的广告
  98. $(".hx-warp").remove()
  99. }
  100.  
  101. //凤凰网
  102. if(location.href.indexOf('www.ifeng.com')>0){
  103. $("#couplet3_left").remove()
  104. $("[c]").remove()
  105.  
  106. }
  107. }
  108. function closeZhiHu(){
  109. setTimeout(function(){
  110. //知乎登录(不可用)页面
  111. $(".Button.Modal-closeButton.Button--plain").click();
  112. },100);
  113. }
  114.  
  115. // Your code here...
  116. })(jQuery);

QingJ © 2025

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