Fuck CSDN

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

Fra 09.04.2019. Se den seneste versjonen.

  1. // ==UserScript==
  2. // @namespace Eternal
  3. // @name Fuck CSDN
  4. // @version 2.4
  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, multiple) {
  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. if (!multiple) {
  28. clearInterval(timer);
  29. }
  30. i >= 0 && (typeof code == "string" ? eval(code) : code());
  31. }
  32. }, 10);
  33. }
  34.  
  35. var addRMTimer = function (ele, time, code, multiple) {
  36. addTimer(`$("${ele}").size() > 0`, function () {
  37. code && eval(code);
  38. $(ele).remove();
  39. /*setTimeout(function () {
  40. code && eval(code);
  41. $(ele).remove();
  42. }, 50)*/
  43. }, time, multiple)
  44. }
  45.  
  46. var hook = function () {
  47. window.setInterval_ = setInterval;
  48. var mysetInterval = function (fun, time) {
  49. if ((fun + '').match("check-adblock-time")) {
  50. return null;
  51. } else {
  52. return setInterval_(fun, time);
  53. }
  54. }
  55. setInterval = mysetInterval;
  56. document.body.insertBefore_ = document.body.insertBefore;
  57. var myinsertBefore = function (ele, box) {
  58. if (ele.innerHTML.match("ADP") || ele.innerHTML.match("广告")) {
  59. return document.body;
  60. } else {
  61. return document.body.insertBefore_(ele, box);
  62. }
  63. };
  64. document.body.insertBefore = myinsertBefore;
  65. }
  66.  
  67. if (location.host.match("blog")) {
  68. $(function () {
  69. $(".article_content").css("height", '');
  70. //$(".hide-article-box").remove();
  71. $(".hide-article-box").removeClass("hide-article-pos");
  72. $("#btn-readmore").remove();
  73. $(".fourth_column").remove();
  74. $(".pulllog-box").remove();
  75. $(".box-shadow").remove();
  76. $(".aside-box > div[data-track-click]").parent().remove();
  77. $(".BAIDU_DUP_fp_wrapper").remove();
  78. $(".adsbygoogle").parent().remove();
  79. $("#commentBox").prev().remove();
  80. $(".recommend-ad-box").remove();
  81. $("#adContent").remove();
  82. $("div[id*='kp_box']").remove();
  83. $(".blog_star_enter").remove();
  84. $("#totast-js:contains('APP')").parent().remove();
  85.  
  86. csdn.copyright && (csdn.copyright.init = function () {});
  87.  
  88. $("img[onerror]").remove();
  89.  
  90. if (extension) {
  91. $(".gitChat:contains('赚零钱')").remove();
  92. $(".footer_box").remove();
  93. $(".article-copyright").remove();
  94. $(".blog-expert-recommend-box").remove();
  95. $(".recommend-item-box[data-track-click*='click.hm.baidu.com']").remove();
  96. $(".type_hot_word").remove();
  97. }
  98. });
  99. addRMTimer(".right-item[class*='ads']");
  100. addRMTimer("#asideFooter > .aside-box:has('iframe')");
  101. addRMTimer("div[class*='box-box']:has('iframe'):contains('关闭')");
  102. addRMTimer("div[id*='kp_box']", undefined, undefined, true);
  103. addRMTimer("#BAIDU_DUP_fp_wrapper");
  104. addRMTimer("iframe[src*='pos.baidu.com']", undefined, undefined, true);
  105. addRMTimer("#passportbox");
  106. addRMTimer(".login-mark");
  107.  
  108. hook();
  109. } else if (location.host.match("bbs")) {
  110. /*window.onerror = function (message, source, lineno, colno, error) {
  111. if (source.indexOf("mvf_news_feed") != -1){
  112. return true;
  113. }
  114. console.log(message,source,lineno,colno,error);
  115. return false;
  116. }*/
  117. $(function () {
  118. $(".post_body > div[scrolling=no]").remove();
  119. $(".bbs_feed_ad_box").remove();
  120. $(".post_body > div").remove();
  121. $(".pulllog-box").remove();
  122. $("div[id*='kp_box']").remove();
  123.  
  124. if (extension) {
  125. $(".gitChat:contains('赚零钱')").remove();
  126. $("#thirdList").css("margin-bottom", "0px");
  127. $(".footer_box").remove();
  128. $(".control").css("cssText", "bottom:0!important;");
  129. $(".post_recommend").remove();
  130. }
  131.  
  132. addRMTimer("#adContent");
  133. addRMTimer(".ad_item");
  134. addRMTimer(".hide_topic_box", undefined, "$('#bbs_detail_wrap').css('max-height', '')");
  135. addRMTimer("#totast-js:contains('APP')");
  136. });
  137. } else if (location.host.match("download")) {
  138. addTimer("$", function () {
  139. $(".check-adblock-bg").parent().remove();
  140. $(function () {
  141. $(".dl_mar").remove();
  142. $(".right_bottom").remove();
  143. $(".hot_arti_list > div").remove();
  144. $("#album_detail_wrap > div:not(.dl_more)").remove();
  145. $(".dl_edu").remove();
  146. $(".right_bottom_ads").remove();
  147. $("div[id*='kp_box']").remove();
  148. $(".carousel_box").remove();
  149.  
  150. addRMTimer("#adContent");
  151.  
  152. if (extension) {
  153. $(".gitChat:contains('赚零钱')").remove();
  154. $(".nav_upload").remove();
  155. //$(".fixed_dl").find(".footer_box").remove();
  156. $(".footer_box").remove();
  157. }
  158. });
  159. });
  160.  
  161. hook();
  162.  
  163. addTimer("document.body.insertBefore_ == undefined", function () {
  164. document.body.insertBefore_ = document.body.insertBefore;
  165. var myinsertBefore = function (ele, box) {
  166. if (ele.innerHTML.match("ADP") || ele.innerHTML.match("广告")) {
  167. return document.body;
  168. } else {
  169. return document.body.insertBefore_(ele, box);
  170. }
  171. };
  172. document.body.insertBefore = myinsertBefore;
  173. });
  174. } else if (location.host.match("www")) {
  175. $(function () {
  176. $(".banner-ad-box").remove();
  177. $(".slide-outer").remove();
  178. $(".indexSuperise").remove();
  179. $("div[id*='kp_box']").remove();
  180.  
  181. addRMTimer("#adContent");
  182.  
  183. if (extension) {
  184. $(".gitChat:contains('赚零钱')").remove();
  185. $(".footer_box").remove();
  186. }
  187. });
  188. }
  189.  
  190. console.log("Fuck CSDN!")
  191. })();