Fuck CSDN

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

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

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

QingJ © 2025

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