Fuck CSDN

去除CSDN BBS&BLOG&DOWNLOAD&WWW ADP检测/广告/展开全文限制/复制小尾巴/离线网页限制/其它

目前为 2019-01-11 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @namespace Eternal
  3. // @name Fuck CSDN
  4. // @version 2.0
  5. // @description 去除CSDN BBS&BLOG&DOWNLOAD&WWW ADP检测/广告/展开全文限制/复制小尾巴/离线网页限制/其它
  6. // @author 流星暴雨
  7. // @grant none
  8. // @match *blog.csdn.net/*
  9. // @match *bbs.csdn.net/*
  10. // @match *download.csdn.net/*
  11. // @match *www.csdn.net/*
  12. // @run-at document-body
  13. // @homepageURL https://greasyfork.org/scripts/374950
  14. // @supportURL https://greasyfork.org/scripts/374950
  15. // ==/UserScript==
  16.  
  17. (function () {
  18. 'use strict';
  19. var extension = true; //如为真则开启拓展功能 去除 联系方式/赚零钱/传资源/文章推荐/热词推荐/博主推荐
  20.  
  21. var addTimer = function (isTrue, code, time) {
  22. var i = time == -1 ? undefined : (time ? time : 10000) / 10;
  23. var mySetInterval = window.setInterval_ ? setInterval_ : setInterval;
  24. var timer = mySetInterval(function () {
  25. i--;
  26. if (i < 0 || (typeof isTrue == "string" ? eval(isTrue) : isTrue())) {
  27. clearInterval(timer);
  28. i >= 0 && (typeof code == "string" ? eval(code) : code());
  29. }
  30. }, 10);
  31. }
  32.  
  33. var addRMTimer = function (ele, time, code) {
  34. addTimer(`$("${ele}").size() > 0`, function () {
  35. code && eval(code);
  36. $(ele).remove();
  37. /*setTimeout(function () {
  38. code && eval(code);
  39. $(ele).remove();
  40. }, 50)*/
  41. }, time)
  42. }
  43.  
  44. var hook = function () {
  45. window.setInterval_ = setInterval;
  46. var mysetInterval = function (fun, time) {
  47. if ((fun + '').match("check-adblock-time")) {
  48. return null;
  49. } else {
  50. return setInterval_(fun, time);
  51. }
  52. }
  53. setInterval = mysetInterval;
  54. document.body.insertBefore_ = document.body.insertBefore;
  55. var myinsertBefore = function (ele, box) {
  56. if (ele.innerHTML.match("ADP") || ele.innerHTML.match("广告")) {
  57. return document.body;
  58. } else {
  59. return document.body.insertBefore_(ele, box);
  60. }
  61. };
  62. document.body.insertBefore = myinsertBefore;
  63. }
  64.  
  65. if (location.host.match("blog")) {
  66. $(function () {
  67. $("#article_content").css("height", '');
  68. //$(".hide-article-box").remove();
  69. $(".hide-article-box").removeClass("hide-article-pos");
  70. $("#btn-readmore").remove();
  71. $(".fourth_column").remove();
  72. $(".pulllog-box").remove();
  73. $(".box-shadow").remove();
  74. $(".aside-box > div[data-track-click]").parent().remove();
  75. $(".BAIDU_DUP_fp_wrapper").remove();
  76. $(".adsbygoogle").parent().remove();
  77. $("#commentBox").prev().remove();
  78. $(".recommend-ad-box").remove();
  79. $("#adContent").remove();
  80. $("div[id*='kp_box']").remove();
  81.  
  82. csdn.copyright && (csdn.copyright.init = function () {});
  83.  
  84. $("img[onerror]").remove();
  85.  
  86. if (extension) {
  87. $(".gitChat:contains('赚零钱')").remove();
  88. $(".footer_box").remove();
  89. $(".article-copyright").remove();
  90. $(".blog-expert-recommend-box").remove();
  91. $(".recommend-item-box[data-track-click*='click.hm.baidu.com']").remove();
  92. $(".type_hot_word").remove();
  93. }
  94. });
  95. addRMTimer(".right-item[class*='ads']");
  96. addRMTimer("#asideFooter > .aside-box:has('iframe')");
  97. addRMTimer("div[class*='box-box']:has('iframe'):contains('关闭')");
  98.  
  99. hook();
  100. } else if (location.host.match("bbs")) {
  101. $(function () {
  102. $(".post_body > div[scrolling=no]").remove();
  103. $(".bbs_feed_ad_box").remove();
  104. $(".post_body > div").remove();
  105. $(".pulllog-box").remove();
  106. $("div[id*='kp_box']").remove();
  107.  
  108. if (extension) {
  109. $(".gitChat:contains('赚零钱')").remove();
  110. $("#thirdList").css("margin-bottom", "0px");
  111. $(".footer_box").remove();
  112. $(".control").css("cssText", "bottom:0!important;");
  113. $(".post_recommend").remove();
  114. }
  115.  
  116. addRMTimer("#adContent");
  117. addRMTimer(".ad_item");
  118. addRMTimer(".hide_topic_box", undefined, "$('#bbs_detail_wrap').css('max-height', '')");
  119. });
  120. } else if (location.host.match("download")) {
  121. addTimer("$", function () {
  122. $(".check-adblock-bg").parent().remove();
  123. $(function () {
  124. $(".dl_mar").remove();
  125. $(".right_bottom").remove();
  126. $(".hot_arti_list > div").remove();
  127. $("#album_detail_wrap > div:not(.dl_more)").remove();
  128. $(".dl_edu").remove();
  129. $(".right_bottom_ads").remove();
  130. $("div[id*='kp_box']").remove();
  131. $(".carousel_box").remove();
  132.  
  133. addRMTimer("#adContent");
  134.  
  135. if (extension) {
  136. $(".gitChat:contains('赚零钱')").remove();
  137. $(".nav_upload").remove();
  138. //$(".fixed_dl").find(".footer_box").remove();
  139. $(".footer_box").remove();
  140. }
  141. });
  142. });
  143.  
  144. hook();
  145.  
  146. addTimer("document.body.insertBefore_ == undefined", function () {
  147. document.body.insertBefore_ = document.body.insertBefore;
  148. var myinsertBefore = function (ele, box) {
  149. if (ele.innerHTML.match("ADP") || ele.innerHTML.match("广告")) {
  150. return document.body;
  151. } else {
  152. return document.body.insertBefore_(ele, box);
  153. }
  154. };
  155. document.body.insertBefore = myinsertBefore;
  156. });
  157. } else if (location.host.match("www")) {
  158. $(function () {
  159. $(".banner-ad-box").remove();
  160. $(".slide-outer").remove();
  161. $(".indexSuperise").remove();
  162. $("div[id*='kp_box']").remove();
  163.  
  164. addRMTimer("#adContent");
  165.  
  166. if (extension) {
  167. $(".gitChat:contains('赚零钱')").remove();
  168. $(".footer_box").remove();
  169. }
  170. });
  171. }
  172.  
  173. console.log("Fuck CSDN!")
  174. })();