Fuck CSDN

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

Version vom 03.01.2019. Aktuellste Version

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name                   Fuck CSDN
// @version                1.4
// @description          去除CSDN BBS&BLOG&DOWNLOAD&WWW ADP检测/广告/展开全文限制/复制小尾巴/其它
// @author                 流星暴雨
// @grant                   none
// @match                  http*://blog.csdn.net/*
// @match                  http*://bbs.csdn.net/*
// @match                  http*://download.csdn.net/*
// @match                  http*://www.csdn.net/*
// @run-at                  document-body
// @homepageURL    https://greatest.deepsurf.us/scripts/374950
// @supportURL         https://greatest.deepsurf.us/scripts/374950
// @namespace Eternal
// ==/UserScript==

(function () {
	'use strict';
	var extension = true; //如为真则开启拓展功能 去除 联系方式/赚零钱/传资源

	var hook = function () {
		window.setInterval_ = setInterval;
		var mysetInterval = function (fun, time) {
			if ((fun + '').match("check-adblock-time")) {
				return null;
			} else {
				return setInterval_(fun, time);
			}
		}
		setInterval = mysetInterval;
		document.body.insertBefore_ = document.body.insertBefore;
		var myinsertBefore = function (ele, box) {
			if (ele.innerHTML.match("ADP") || ele.innerHTML.match("广告")) {
				return document.body;
			} else {
				return document.body.insertBefore_(ele, box);
			}
		};
		document.body.insertBefore = myinsertBefore;
	}

	var addTimer = function (ele, time, code) {
		var i = time == -1 ? undefined : (time ? time : 10000) / 10;
		var timer = setInterval(function () {
				i--;
				if ($(ele).size() > 0 || i < 0) {
					clearInterval(timer);
					setTimeout(function () {
						code && eval(code);
						$(ele).remove();
					}, 50)
				}
			}, 10);
	}

	if (location.host.match("blog")) {
		$(function () {
			$("#article_content").css("height", '');
			$(".hide-article-box").remove();
			$(".fourth_column").remove();
			$(".pulllog-box").remove();
			$(".box-shadow").remove();
			$(".aside-box > div[data-track-click]").parent().remove();
			$(".BAIDU_DUP_fp_wrapper").remove();
			$(".adsbygoogle").parent().remove();
			$("#commentBox").prev().remove();
			$(".recommend-ad-box").remove();
			$("#adContent").remove();
			$("div[id*='kp_box']").remove();

			if (csdn.copyright) {
				csdn.copyright.init = function () {};
			}

			$("img[onerror]").remove();

			if (extension) {
				$(".gitChat").remove();
				$(".persion_article").empty();
			}
		});
		addTimer(".right-item[class*='ads']");
		addTimer("#asideFooter > .aside-box:has('iframe')");
		addTimer("div[class*='box-box']:has('iframe'):contains('关闭')");

		hook();
	} else if (location.host.match("bbs")) {
		$(function () {
			$(".post_body > div[scrolling=no]").remove();
			$(".bbs_feed_ad_box").remove();
			$(".post_body > div").remove();
			$(".pulllog-box").remove();
			$("#adContent").remove();
			$("div[id*='kp_box']").remove();

			if (extension) {
				$(".gitChat").remove();
				$(".footer_box").empty();
				$(".footer_box").css("visibility", "hidden");
			}

			addTimer(".hide_topic_box", undefined, "$('#bbs_detail_wrap').css('max-height', '')");
		});
	} else if (location.host.match("download")) {
		$(".check-adblock-bg").parent().remove();

		$(function () {
			$(".dl_mar").remove();
			$(".right_bottom").remove();
			$(".hot_arti_list > div").remove();
			$("#adContent").remove();
			$("#album_detail_wrap > div:not(.dl_more)").remove();
			$(".dl_edu").remove();
			$("div[id*='kp_box']").remove();

			if (extension) {
				$(".gitChat").remove();
				$(".fixed_dl").remove();
			}
		});

		hook();

		var timer = setInterval(function () {
				if (document.body.insertBefore_ == undefined) {
					clearInterval(timer);
					document.body.insertBefore_ = document.body.insertBefore;
					var myinsertBefore = function (ele, box) {
						if (ele.innerHTML.match("ADP") || ele.innerHTML.match("广告")) {
							return document.body;
						} else {
							return document.body.insertBefore_(ele, box);
						}
					};
					document.body.insertBefore = myinsertBefore;
				}
			}, 10);

	} else if (location.host.match("www")) {
		$(function () {
			$(".banner-ad-box").remove();
			$(".slide-outer").remove();
			$(".indexSuperise").remove();
			$("div[id*='kp_box']").remove();

			addTimer("#adContent");

			if (extension) {
				$(".gitChat").remove();
				$(".persion_article").empty();
			}
		});
	}

	console.log("Fuck CSDN!")
})();