📜 ⬆️ ⬇️

AdBlock Plus and Adguard + Anti-Adblock banner blocking bypass

More and more webmasters are wondering how to bypass the banner blocker and disable the AdBlock Plus and Adguard extension?
It turns out that banner blocking can be bypassed using JavaScript and HTML, using alternative tags, for example, DIV.

So what do we need?



Let's get started


Let's look at the following javascript code (the code is fully working):

/** @name: Banner Creater @versoin: v. 0.4 final @author: Mr.MEX @site: hyperworld.ru */ function bannerCreater(opt){ opt = opt || {}; var h = opt.h, w = opt.w, link = opt.link, img = opt.img, title = opt.title, target = opt.target, attach = opt.attach, create = true, div = document.createElement('div'), result = '', words = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM', max_position = words.length - 1, logging = opt.logging ; for(i = 0; i < 10; ++i) { position = Math.floor (Math.random() * max_position); result = result + words.substring(position, position + 1); } var idgen = result; if (h == null) { h = 60; } else if (w == null) { w = 468; } else if (link == null) { console.error('  ,    .'); create = false; } else if (img == null) { console.error('    ,    .'); create = false; } else if (title == null) { } else if (target == null) { target = '_blank'; } else if (attach == null) { console.error('  id ,     ,    .'); create = false; } else if (logging == null){ logging = false; } if (create == true) { div.setAttribute('id',idgen); div.setAttribute('style','width:'+w+'px !important;height:'+h+'px !important;background-image:url(\''+img+'\') !important;background-repeat:repeat repeat !important;background-position:center center !important;cursor:pointer !important;'); if (title) { div.setAttribute('title',title); } div.setAttribute('onclick', 'window.open(\''+link+'\', \''+target+'\')',0); document.getElementById(attach).appendChild(div); if (logging == true){ console.log('     '+link+'  ID: '+idgen+',  '+w+'x'+h+'px   '+attach+'.'); } } } 

It seems simple, is not it?
')
Let's make an example.

Javascript:

 bannerCreater({ attach: 'hsBnr', //    w: 468, //   h: 60, //   link: 'http://coffeebreak.rusff.ru/', //    img: 'http://savepic.net/5248295.png', //  (     468x60,   ) title: '  CoffeeBreak', //  ()    target: '_blank', //  (   ) logging: true //   }); 


HTML:

 <div id="bannerContainer"></div> <script>createBanner();</script> 

Here is an example:

image
JSfiddle working example.
As you can see, neither Adguard nor AdBlock Plus has blocked the banner.

We disable Adguard and AdBlock Plus in Webkit (Yandex, Amigo), Blink browsers (Google Chrome, Opera)


We build in the JavaScript code page (you can create js and attach to the page header):

 /** @name: Anti-AdBlock for Webkit Browsers @version: 0.2 dev. 3 @author: Mr.MEX @site: hyperworld.ru */ function antiadblock(){ var var1 = $('iframe[style="visibility: visible; position: fixed !important; display: block !important; border: 0px !important; -webkit-box-shadow: rgba(0, 0, 0, 0.498039) 5px 5px 20px; z-index: 2147483647; left: 50px; top: 50px; width: 416px; height: 195px; opacity: 0.7;"]'), var2 = $('iframe[style="visibility: visible; position: fixed !important; display: block !important; border: 0px !important; -webkit-box-shadow: rgba(0, 0, 0, 0.498039) 5px 5px 20px; z-index: 2147483647; left: 50px; top: 50px; width: 416px; height: 195px;"]'), var3 = $('iframe[id="adguard-assistant-dialog"]'), var4 = $('iframe[class="sg_ignore adg-view-important"]'), div = $('div[class="__adblockplus__overlay"]'), div2 = $('div[class="sg_border"]'), div3 = $('div[class="sg_border sg_bottom_border"]') ; var1.remove(); var2.remove(); var3.remove(); var4.remove(); div.remove(); div2.remove(); div3.remove(); setTimeout(function(){antiadblock();},250); } console.info(' Anti-AdBlock   ...'); antiadblock(); console.info(' Anti-AdBlock .'); 

And what does this script do?

And he does something beautiful, namely, removes all the tags that have been embedded extensions Adguard and Adblock Plus.

When does this script start working?

It begins to work when the user decides to block the banner manually, but it does not work for him. At attempt of blocking expansion simply "is hung up".

Conclusion


There is nothing easier than to take the cheat and even break the expansion of ad blocking.
I know that there are many other solutions, but I decided to make something of my own.

Good luck to all!

Source: https://habr.com/ru/post/249169/


All Articles