Fuck CSDN

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

נכון ליום 20-01-2019. ראה הגרסה האחרונה.

  1. // ==UserScript==
  2. // @namespace Eternal
  3. // @name Fuck CSDN
  4. // @version 2.1
  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://greatest.deepsurf.us/scripts/374950
  14. // @supportURL https://greatest.deepsurf.us/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. $(".blog_star_enter").remove();
  82.  
  83. csdn.copyright && (csdn.copyright.init = function () {});
  84.  
  85. $("img[onerror]").remove();
  86.  
  87. if (extension) {
  88. $(".gitChat:contains('赚零钱')").remove();
  89. $(".footer_box").remove();
  90. $(".article-copyright").remove();
  91. $(".blog-expert-recommend-box").remove();
  92. $(".recommend-item-box[data-track-click*='click.hm.baidu.com']").remove();
  93. $(".type_hot_word").remove();
  94. }
  95. });
  96. addRMTimer(".right-item[class*='ads']");
  97. addRMTimer("#asideFooter > .aside-box:has('iframe')");
  98. addRMTimer("div[class*='box-box']:has('iframe'):contains('关闭')");
  99.  
  100. hook();
  101. } else if (location.host.match("bbs")) {
  102. $(function () {
  103. $(".post_body > div[scrolling=no]").remove();
  104. $(".bbs_feed_ad_box").remove();
  105. $(".post_body > div").remove();
  106. $(".pulllog-box").remove();
  107. $("div[id*='kp_box']").remove();
  108.  
  109. if (extension) {
  110. $(".gitChat:contains('赚零钱')").remove();
  111. $("#thirdList").css("margin-bottom", "0px");
  112. $(".footer_box").remove();
  113. $(".control").css("cssText", "bottom:0!important;");
  114. $(".post_recommend").remove();
  115. }
  116.  
  117. addRMTimer("#adContent");
  118. addRMTimer(".ad_item");
  119. addRMTimer(".hide_topic_box", undefined, "$('#bbs_detail_wrap').css('max-height', '')");
  120. });
  121. } else if (location.host.match("download")) {
  122. addTimer("$", function () {
  123. $(".check-adblock-bg").parent().remove();
  124. $(function () {
  125. $(".dl_mar").remove();
  126. $(".right_bottom").remove();
  127. $(".hot_arti_list > div").remove();
  128. $("#album_detail_wrap > div:not(.dl_more)").remove();
  129. $(".dl_edu").remove();
  130. $(".right_bottom_ads").remove();
  131. $("div[id*='kp_box']").remove();
  132. $(".carousel_box").remove();
  133.  
  134. addRMTimer("#adContent");
  135.  
  136. if (extension) {
  137. $(".gitChat:contains('赚零钱')").remove();
  138. $(".nav_upload").remove();
  139. //$(".fixed_dl").find(".footer_box").remove();
  140. $(".footer_box").remove();
  141. }
  142. });
  143. });
  144.  
  145. hook();
  146.  
  147. addTimer("document.body.insertBefore_ == undefined", function () {
  148. document.body.insertBefore_ = document.body.insertBefore;
  149. var myinsertBefore = function (ele, box) {
  150. if (ele.innerHTML.match("ADP") || ele.innerHTML.match("广告")) {
  151. return document.body;
  152. } else {
  153. return document.body.insertBefore_(ele, box);
  154. }
  155. };
  156. document.body.insertBefore = myinsertBefore;
  157. });
  158. } else if (location.host.match("www")) {
  159. $(function () {
  160. $(".banner-ad-box").remove();
  161. $(".slide-outer").remove();
  162. $(".indexSuperise").remove();
  163. $("div[id*='kp_box']").remove();
  164.  
  165. addRMTimer("#adContent");
  166.  
  167. if (extension) {
  168. $(".gitChat:contains('赚零钱')").remove();
  169. $(".footer_box").remove();
  170. }
  171. });
  172. }
  173.  
  174. console.log("Fuck CSDN!")
  175. })();