Annoying Ad blocker

Prevents annoying ads from displaying

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Annoying Ad blocker
// @description Prevents annoying ads from displaying
// @version     2017.08.55
// @match     *://*.amazon.com/*
// @match     *://*.bing.com/*
// @match     *://*.alltrails.com/*
// @match     *://*.ebay.com/*
// @match     *://*.thepiratebay.org/*
// @match     *://*.youtube.com/*
// @match     *://*.stackoverflow.com/*
// @match     *://*.finance.yahoo.com/*
// @match     *://*.dndbeyond.com/*
// @namespace   https://openuserjs.org/users/nonedude
// @require     http://code.jquery.com/jquery-1.11.1.min.js
// @license MIT
// ==/UserScript==

String.prototype.contains = function (it) { return this.indexOf(it) !== -1; };

var ssss = location.href;


function dndbeyond()
{
	$(".header-wrapper").remove();
	$("#site-main").css("background-color", "black");
        $("html").css("background-color", "black");
	$("[id^=cookie-consent-banner]").remove();
	$("footer").remove();
}

function thepiratebay()
{
	$("iframe").remove();
}
function amazon()
{
	window.pdagSparkleClientContext = {};
	$("#pdagDesktopSparkleHeadlineContainer").remove();
	$("#sponsoredLinksCsaIframe").remove();
	$("#reports-ads-abuse").remove();
	$("#sponsoredLinksCSA").remove();
	$("#amsSparkleAdWrapper").remove();
	$("#pdagEncapsulated").remove();
	$(".slot__ad").remove();
	$("#adblk_yes").remove();
	$("#adblk_no").remove();
	$("#adblk_unk").remove();

	$("#sponsoredLinksCsaIframe").html("");
	$("#reports-ads-abuse").html("");
	$("#sponsoredLinksCSA").html("");
	$("#amsSparkleAdWrapper").html("");

	$(".s-sponsored-list-header").each(function (index, value)
	{
		$(this).parent().parent().remove();
	});

	$(".s-sponsored-info-icon").each(function (index, value)
	{
		$(this).parent().parent().parent().parent().remove();
	});

	console.log(new Date().getTime());
}

function bing()
{
	$(".b_ad").remove();
}

function ebay()
{
	$("[id^='wrapperDiv_rtm']").remove();
	$("[id^='scandal']").remove();
	$("[id^='rtm-mb']").remove();
	$(".mfe-cards").html("");
	$("[id^='wrapperDiv_rtm']").html("");
	$(".promoted-lv").parent().remove();
	$(".merch-module").remove();
	$(".s-item__title-tag").each(function (index, value)
	{
		$(this).parent().parent().parent().parent().parent().parent().remove();
	});
}
function youtube()
{
	//$(".ytd-secondary-search-container-renderer").remove();
	//$("ytd-secondary-search-container-renderer").remove();
	$("#main").remove();

        $(".yt-mealbar-promo-renderer").remove();
}
function stackoverflow()
{
	$(".js-consent-banner").remove();
}

function yahoo()
{
	$(".YDC-Overlay").remove();
	$("#dropdown-menu").remove();
}

function alltrails()
{
    console.log(new Date().getTime());
	$("#modalPortal").remove();
}






if (ssss.contains("ebay"))
{
	ebay();
	window.setInterval(function ()
	{
		ebay();
	}, 1000);

}
if (ssss.contains("bing"))
{
	bing();
	window.setInterval(function ()
	{
		bing();
	}, 1000);
}

if (ssss.contains("amazon"))
{
	amazon();
	window.setInterval(function ()
	{
		amazon();
	}, 1000);
}

if (ssss.contains("thepiratebay"))
{
	piratebay();
	window.setInterval(function ()
	{
		piratebay();
	}, 1000);
}
if (ssss.contains("youtube"))
{
	youtube();
	window.setInterval(function ()
	{
		youtube();
	}, 1000);
}
if (ssss.contains("stackoverflow"))
{
	stackoverflow();
	window.setInterval(function ()
	{
		stackoverflow();
	}, 1000);
}
if (ssss.contains("yahoo"))
{
	yahoo();
	window.setInterval(function ()
	{
		yahoo();
	}, 1000);
}
if (ssss.contains("dndbeyond"))
{
	dndbeyond();
	window.setInterval(function ()
	{
		dndbeyond();
	}, 1000);
}

if (ssss.contains("alltrails"))
{
	alltrails();
	window.setInterval(function ()
	{
		alltrails();
	}, 1000);
}