.This post lists all kinds ways to block ads or anti-block-ads
https://antiblock.org/
Settings:
<style>
 #haaa {
  position: fixed; /* Fixed position to cover the whole screen */
  top: 3px;Â
  left: 2px;
  width: 100vw;
  height: 90vh;
  background-color: #fff;
  opacity: 0.95;
  display: block;
  padding: 20% 0;
 }
 #haaa * {
  text-align: center;
  margin: 0 auto;
  display: block;
  font: bold 14px Verdana, Arial, sans-serif;
  text-decoration: none; color: yellow;
 }
</style><div id="haaa"><font>Please enable / Bitte aktiviere JavaScript!<br>Veuillez activer / Por favor activa el Javascript!<a href="http://sites.51sec.org">[ ? ]</a></font></div><script>window.document.getElementById("haaa").parentNode.removeChild(window.document.getElementById("haaa"));(function(l,m){function n(a){a&&haaa.nextFunction()}var h=l.document,p=["i","s","u"];n.prototype={rand:function(a){return Math.floor(Math.random()*a)},getElementBy:function(a,b){return a?h.getElementById(a):h.getElementsByTagName(b)},getStyle:function(a){var b=h.defaultView;return b&&b.getComputedStyle?b.getComputedStyle(a,null):a.currentStyle},deferExecution:function(a){setTimeout(a,2E3)},insert:function(a,b){var c=h.createElement("font"),e=h.body,d=e.childNodes.length,g=e.style,f=0,k=0;if("haaa"==b){c.setAttribute("id",b);g.margin=g.padding=0;g.height="100%";for(d=this.rand(d);f<d;f++)1==e.childNodes[f].nodeType&&(k=Math.max(k,parseFloat(this.getStyle(e.childNodes[f]).zIndex)||0));k&&(c.style.zIndex=k+1);d++}c.innerHTML=a;e.insertBefore(c,e.childNodes[d-1])},r:function(a){var b=h.body.style;this.getElementBy(a).parentNode.removeChild(this.getElementBy(a));b.height=b.margin=b.padding=""},displayMessage:function(a){a="abisuq".charAt(this.rand(5));var b,c='<input type="button" onclick="haaa.r(\'haaa\')" value=20 disabled></'+a+">";this.insert("<"+a+'>Please disable your ad blocker!<br><br>Visit blog.51sec.org, www.51sec.org for more! <br><br>Bitte deaktiviere Deinen Werbeblocker!<br>Veuillez désactiver votre bloqueur de publicité!<br>Por favor, desactive el bloqueador de anuncios! <a href="http://sites.51sec.org">[ ? ]</a>'+c,"haaa");c=this.getElementBy("haaa").firstChild.lastChild;b=setInterval(function(){c.value--;1>c.value&&(clearInterval(b),c.value="Close",c.disabled="")},1E3)},i:function(){for(var a="adSky,adunitl,div-ad-1x1,marquee_ad,right_ad_2,slider_ad,visual-ad,ad,ads,adsense".split(","),b=a.length,c="",e=this,d=0,g="abisuq".charAt(e.rand(5));d<b;d++)e.getElementBy(a[d])||(c+="<"+g+' id="'+a[d]+'"></'+g+">");e.insert(c);e.deferExecution(function(){for(d=0;d<b;d++)if(null==e.getElementBy(a[d]).offsetParent||"none"==e.getStyle(e.getElementBy(a[d])).display)return e.displayMessage("#"+a[d]+"("+d+")");e.nextFunction()})},s:function(){var a={'pagead2.googlesyndic':'google_ad_client','js.adscale.de/getads':'adscale_slot_id','get.mirando.de/miran':'adPlaceId'},b=this,c=b.getElementBy(0,"script"),e=c.length-1,d,g,f,k;h.write=null;for(h.writeln=null;0<=e;--e)if(d=c[e].src.substr(7,20),a[d]!==m){f=h.createElement("script");f.type="text/javascript";f.src=c[e].src;g=a[d];l[g]=m;f.onload=f.onreadystatechange=function(){k=this;l[g]!==m||k.readyState&&"loaded"!==k.readyState&&"complete"!==k.readyState||(l[g]=f.onload=f.onreadystatechange=null,c[0].parentNode.removeChild(f))};c[0].parentNode.insertBefore(f,c[0]);b.deferExecution(function(){if(l[g]===m)return b.displayMessage(f.src);b.nextFunction()});return}b.nextFunction()},u:function(){var a=".480x60-,.480x60/,/120_600_,/468-60.,/468x72_,/486x60_,/780x90.,_300x250-,_468-60_,_728x60.".split(","),b=this,c=b.getElementBy(0,"img"),e,d;c[0]!==m&&c[0].src!==m&&(e=new Image,e.onload=function(){d=this;d.onload=null;d.onerror=function(){p=null;b.displayMessage(d.src)};d.src=c[0].src+"#"+a.join("")},e.src=c[0].src);b.deferExecution(function(){b.nextFunction()})},nextFunction:function(){var a=p[0];a!==m&&(p.shift(),this[a]())}};l.haaa=haaa=new n;h.addEventListener?l.addEventListener("load",n,!1):l.attachEvent("onload",n)})(window);</script>
To make sure the layer #haaa shows on top of layer, you can add
- Â z-index: 9999;
after the "padding: 20% 0;" this line. Â
Ads Blocker
- still need to find a good way to detect this. It can bypass those javascript.Â
Anti Ads Blocker
Anti Adblock Killer
Detect Adblocker  Â
 https://www.detectadblock.com/All block lists include a reference to "adex.js" because it's a common name for JavaScript files that are associated with serving ads. Knowing this, save the following JavaScript code which creates a hidden div to a file called "adex.js" and place it in the root directory of your website.
var e=document.createElement('div'); e.id='eNmOUiSgyxfM'; e.style.display='none'; document.body.appendChild(e);
Note: the obscure div id is to ensure that it doesn't conflict with any other div's that your website might use.
<style>
#iaMFGndsgOhR {
display: none;
top: 50%;
left: 50%;
width: 50em;
height: 25em;
margin-top: -20em;
margin-left: -20em;
border: 1px solid #666;
background: #D30000;
position: fixed;
margin-bottom: 30px;
padding: 20px 10px;
font-size: large;
text-align: center;
font-weight: bold;
color: #fff;
border-radius: 5px;
}
</style>
<div id="iaMFGndsgOhR">
<br>
Our website is made possible by displaying online advertisements to our visitors.<br><br><br>
Please consider supporting us by disabling your ad blocker.<br><br><br>
Please turn off your Adsblocker to support 51sec!<br><br><br>
Thank you!<br><br>
51sec.org!
</div>
<script src="https://51sec.org/adex.js" type="text/javascript"></script>
<script type="text/javascript">
if(!document.getElementById('eNmOUiSgyxfM')){
document.getElementById('iaMFGndsgOhR').style.display='block';
}
</script>
<style> #iaMFGndsgOhR { display: none; margin-bottom: 30px; padding: 20px 10px; background: #D30000; text-align: center; font-weight: bold; color: #fff; border-radius: 5px; } </style> <div id="iaMFGndsgOhR"> <br> Our website is made possible by displaying online advertisements to our visitors.<br> Please consider supporting us by disabling your ad blocker. 51sec.org! </div> <script src="https://51sec.org/adex.js" type="text/javascript"></script> <script type="text/javascript"> if(!document.getElementById('eNmOUiSgyxfM')){ document.getElementById('iaMFGndsgOhR').style.display='block'; } </script>
References
- ublock origion
Â
No comments:
Post a Comment