Docin Cleaner

豆丁网清理页面广告及无关信息

目前为 2022-03-03 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Docin Cleaner
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0.1
  5. // @description 豆丁网清理页面广告及无关信息
  6. // @author Zzn
  7. // @match https://www.docin.com/*
  8. // @match https://jz.docin.com/*
  9. // @icon https://www.docin.com/favicon.ico
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. //from here
  17. window.onload = function(){
  18. var el0 = document.getElementById("floderbtn")//默认将侧边推荐折叠
  19. if(el0 != undefined && el0 != null)
  20. el0.click();
  21.  
  22. el0 = document.getElementById("top_right_ad")//header广告
  23. if(el0 != undefined && el0 != null)
  24. el0.remove();
  25. el0 = document.getElementById("docinShareSlider")//侧边分享
  26. if(el0 != undefined && el0 != null)
  27. el0.remove();
  28. el0 = document.getElementsByClassName('head_wrapper');//header
  29. if(el0 != undefined && el0 != null)
  30. el0[0].remove();
  31. el0 = document.getElementsByClassName('sider_guanggao');//侧边广告
  32. if(el0 != undefined && el0 != null)
  33. el0[0].remove();
  34. el0 = document.getElementsByClassName('docin_share_sns ');//header分享
  35. el0[0].remove();
  36. el0 = document.getElementsByClassName('backToTop');
  37. if(el0 != undefined && el0 != null)
  38. el0[0].remove();
  39. el0 = document.getElementById("jControlDiv")//末尾广告
  40. if(el0 != undefined && el0 != null)
  41. el0.remove();
  42.  
  43. //每页的小广告
  44. var i = 1;
  45. var mini_ads;
  46. do{
  47. mini_ads = document.getElementById("ad"+(i++))
  48. }while((mini_ads != undefined || mini_ads != null)?(mini_ads.remove() || true):false);
  49.  
  50. //末尾处猜你喜欢
  51. var j_recomm_flag = true;
  52. document.addEventListener("DOMNodeInserted",function(e) {
  53. if(j_recomm_flag && e.target.id != undefined && e.target.id == "j_recomm"){
  54. console.log("remove j_recomm",e.target);
  55. el0 = document.getElementById("j_recomm")
  56. empty(el0);
  57. j_recomm_flag = false;
  58. }
  59. });
  60.  
  61.  
  62. //jz.docin
  63. el0 = document.getElementById("docin-global-nav")//header
  64. if(el0 != undefined && el0 != null)
  65. el0.remove();
  66. el0 = document.getElementById("showPrice")//价格优惠
  67. if(el0 != undefined && el0 != null)
  68. el0.remove();
  69. el0 = document.getElementsByClassName('doc_fun_wrap');//下载收藏打印分享
  70. if(el0 != undefined && el0 != null)
  71. el0[0].remove();
  72. el0 = document.getElementsByClassName('addMember tools_btns');//加入会员
  73. if(el0 != undefined && el0 != null)
  74. el0[0].remove();
  75. el0 = document.getElementsByClassName('share_new_style');//结尾处分享
  76. if(el0 != undefined && el0 != null)
  77. el0[0].remove();
  78.  
  79.  
  80. };
  81.  
  82. function empty (e) {
  83. while (e.firstChild) {
  84. e.removeChild (e.firstChild);
  85. }
  86. }
  87.  
  88. // $(document).ready(function(){
  89. // $(".head_wrapper").remove();//header
  90. // $("#container").remove();//head ads
  91. // $("#docinShareSlider").remove();//share
  92. // $(".sider_guanggao").remove();//aside ads
  93. // $(".sider_gg").remove();//aside ads
  94. // $(".backToTop").remove();//aside ads
  95.  
  96. // var i = 1;
  97. // var mini_ads;
  98. // do{
  99. // mini_ads = document.getElementById(i++)
  100. // }while(mini_ads != undefined || mini_ads != null);
  101.  
  102. // //$("#ocinShareSlider").remove();//share
  103. // })
  104. //end here
  105.  
  106. })();

QingJ © 2025

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