Greasy Fork

hanascan,rawdevart网站去广告

Remove ADs from hanascan.com and rawdevart.com, make the pictures to be seen better on hanascan.com

目前为 2020-05-31 提交的版本。查看 最新版本

// ==UserScript==
// @name		hanascan,rawdevart网站去广告
// @description	Remove ADs from hanascan.com and rawdevart.com, make the pictures to be seen better on hanascan.com
// @version		1.11
// @author		Tinyblack
// @namespace	http://tampermonkey.net/
// @namespace	http://greasyfork.org/
// @include		*://hanascan.com/*
// @include		*://comic-walker.com/*
// @include		*://rawdevart.com/*
// @require		https://code.jquery.com/jquery-3.5.1.min.js
// @grant		none
// ==/UserScript==
(function () {
    var web = window.location.href;
	function importjquery() {
		var ele = document.createElement("script");
		ele.setAttribute("type", "text/javascript");
		ele.setAttribute("src", "https://code.jquery.com/jquery-3.5.1.min.js");
		document.head.appendChild(ele);
	}
    importjquery();
    function resetimg(){
		$('img').each(function(){
			$(this).css('width','90');
			$(this).css('height','100%');
		});
		return 0;
	}
	$(window).bind('load',function() {

	var web = window.location.href;
	if(web.match('comic-walker')!==null)		//is comic-walker
		{
			$('.i-amphtml-inabox.i-amphtml-singledoc.i-amphtml-standalone.i-amphtml-iframed').remove();
			$('.GoogleActiveViewElement').remove();
		}
	if(web.match('hanascan')!==null)			//is hanascan
		{
			$('iframe').remove();
			resetimg();
		}
	if(web.match('rawdevart')!==null)			//is rawdevart
		{
			var matchele;
			for(var eles = 1 ; eles <= 2 ; eles ++)
			{
				if(eles == 1){matchele = 'div';}
				if(eles == 2){matchele = 'iframe';}
				$(matchele).children().each(function(){
					var eleid = $(this).attr('id');
					var eleclass = $(this).attr('class');
					if( eleid !== undefined )
					{
						if( eleid.match('adtruefr')!==null )	//is ad element
						{
							console.log("Removed AD element's id:"+eleid);
							$(this).remove();
						}
					}
					if( eleclass !== undefined)
					{
						if( eleclass.match('runative-banner')!==null || eleclass.match('rn_ad_native')!==null)	//is ad element
						{
							console.log("Removed AD element's class:"+eleclass);
							$(this).remove();
						}
					}
				});
			}
		}
	}

	);
})();