Fuck CSDN

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

Verze ze dne 05. 01. 2019. Zobrazit nejnovější verzi.

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