Fuck CSDN

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

  1. // ==UserScript==
  2. // @namespace Eternal
  3. // @name Fuck CSDN
  4. // @version 2.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, multiple) {
  22. var i = time == -1 ? 0 : (time ? time : 10000) / 10;
  23. var mySetInterval = window.setInterval_ ? setInterval_ : setInterval;
  24. var timer = mySetInterval(function () {
  25. time!=-1 && 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. $(".opt-box").remove();
  86. $(".btn-readmore").remove();
  87. addTimer("$('.comment-list-box').css('max-height')", function () {
  88. $(".comment-list-box").css("max-height", '');
  89. }, -1, true);
  90.  
  91. csdn.copyright && (csdn.copyright.init = function () {});
  92.  
  93. $("img[onerror]").remove();
  94.  
  95. addTimer("true", function () {
  96. $("#content_views > pre").attr('style', 'user-select:auto !important;');
  97. $("code").attr('style', 'user-select:auto !important;');
  98.  
  99. $(".hljs-button").remove();
  100. }, -1, true);
  101.  
  102. if (extension) {
  103. $(".gitChat:contains('赚零钱')").remove();
  104. $(".footer_box").remove();
  105. $(".article-copyright").remove();
  106. $(".blog-expert-recommend-box").remove();
  107. $(".recommend-item-box[data-track-click*='click.hm.baidu.com']").remove();
  108. $(".type_hot_word").remove();
  109. }
  110. });
  111. addRMTimer(".right-item[class*='ads']");
  112. addRMTimer("#asideFooter > .aside-box:has('iframe')");
  113. addRMTimer("div[class*='box-box']:has('iframe'):contains('关闭')");
  114. addRMTimer("div[id*='kp_box']", undefined, undefined, true);
  115. addRMTimer("#BAIDU_DUP_fp_wrapper");
  116. addRMTimer("iframe[src*='pos.baidu.com']", undefined, undefined, true);
  117. addRMTimer("#passportbox");
  118. addRMTimer(".login-mark");
  119.  
  120. hook();
  121. } else if (location.host.match("bbs")) {
  122. /*window.onerror = function (message, source, lineno, colno, error) {
  123. if (source.indexOf("mvf_news_feed") != -1){
  124. return true;
  125. }
  126. console.log(message,source,lineno,colno,error);
  127. return false;
  128. }*/
  129. $(function () {
  130. $(".post_body > div[scrolling=no]").remove();
  131. $(".bbs_feed_ad_box").remove();
  132. $(".post_body > div").remove();
  133. $(".pulllog-box").remove();
  134. $("div[id*='kp_box']").remove();
  135.  
  136. if (extension) {
  137. $(".gitChat:contains('赚零钱')").remove();
  138. $("#thirdList").css("margin-bottom", "0px");
  139. $(".footer_box").remove();
  140. $(".control").css("cssText", "bottom:0!important;");
  141. $(".post_recommend").remove();
  142. }
  143.  
  144. addRMTimer("#adContent");
  145. addRMTimer(".ad_item");
  146. addRMTimer(".hide_topic_box", undefined, "$('#bbs_detail_wrap').css('max-height', '')");
  147. addRMTimer("#totast-js:contains('APP')");
  148. });
  149. } else if (location.host.match("download")) {
  150. addTimer("$", function () {
  151. $(".check-adblock-bg").parent().remove();
  152. $(function () {
  153. $(".dl_mar").remove();
  154. $(".right_bottom").remove();
  155. $(".hot_arti_list > div").remove();
  156. $("#album_detail_wrap > div:not(.dl_more)").remove();
  157. $(".dl_edu").remove();
  158. $(".right_bottom_ads").remove();
  159. $("div[id*='kp_box']").remove();
  160. $(".carousel_box").remove();
  161.  
  162. addRMTimer("#adContent");
  163.  
  164. if (extension) {
  165. $(".gitChat:contains('赚零钱')").remove();
  166. $(".nav_upload").remove();
  167. //$(".fixed_dl").find(".footer_box").remove();
  168. $(".footer_box").remove();
  169. }
  170. });
  171. });
  172.  
  173. hook();
  174.  
  175. addTimer("document.body.insertBefore_ == undefined", function () {
  176. document.body.insertBefore_ = document.body.insertBefore;
  177. var myinsertBefore = function (ele, box) {
  178. if (ele.innerHTML.match("ADP") || ele.innerHTML.match("广告")) {
  179. return document.body;
  180. } else {
  181. return document.body.insertBefore_(ele, box);
  182. }
  183. };
  184. document.body.insertBefore = myinsertBefore;
  185. });
  186. } else if (location.host.match("www")) {
  187. $(function () {
  188. $(".banner-ad-box").remove();
  189. $(".slide-outer").remove();
  190. $(".indexSuperise").remove();
  191. $("div[id*='kp_box']").remove();
  192.  
  193. addRMTimer("#adContent");
  194.  
  195. if (extension) {
  196. $(".gitChat:contains('赚零钱')").remove();
  197. $(".footer_box").remove();
  198. }
  199. });
  200. }
  201.  
  202. console.log("Fuck CSDN!")
  203. })();

QingJ © 2025

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