[Resolved] AG_AntiAntiBlock

Adam

Filters Developer
Staff member
Moderator
Rules with AG_AntiAntiBlock breaks websites.
For example these:
Code:
avaxhome.co#%#var AG_AntiAntiBlock = function() { var baseCreateElement = document.createElement; document.createElement = function(name) { if (name && name.match(/div|font|center/i)) { return null; } else { return baseCreateElement(name); } } };
avaxhome.co#%#AG_onLoad(function() { AG_AntiAntiBlock(); });
idevice.ro#%#var AG_AntiAntiBlock = function() { var baseCreateElement = document.createElement; document.createElement = function(name) { if (name && name.match(/div|font|center/i)) { return null; } else { return baseCreateElement(name); } } };
idevice.ro#%#AG_onLoad(function() { AG_AntiAntiBlock(); });
androconsejos.com#%#var AG_AntiAntiBlock = function() { var baseCreateElement = document.createElement; document.createElement = function(name) { if (name && name.match(/div|font|center/i)) { return null; } else { return baseCreateElement(name); } } };
androconsejos.com#%#AG_onLoad(function() { AG_AntiAntiBlock(); });
Here - https://www.idevice.ro/2017/01/28/sports-games-cele-mai-bune-jocuri-de-sport-pentru-iphone-si-ipad-7/
I see errors in console and comments from disqus does not load.
upload_2017-1-28_17-20-7.png

Here - http://www.androconsejos.com/2017/01/review-del-letv-le2.html
Errors in console and gallery is broken, if you click on image it should load in gallery, but it is not.

Here - http://www.avaxhome.co/mastering-probabilistic-graphical-models-using-python.html
Errors in console and Captcha does not load.
upload_2017-1-28_17-27-58.png
I think, that avaxhome.co now use BlockAdblock script.


By the way, how to properly block script from antiblock.org?
I think this website is using this - http://www.terrarium.com.pl/763-poecilotheria-regalis-ptasznik-krolewski/
 

Adam

Filters Developer
Staff member
Moderator
I think this website (abcast.net) is also using "antiblock" script - http://livemecz.com/u3/u7.php
Code:
(function(w, u) {
    var d = w.document,
        z = typeof u;

    function nf37() {
        function c(c, i) {
            var e = d.createElement('span'),
                b = d.body,
                s = b.style,
                l = b.childNodes.length;
            if (typeof i != z) {
                e.setAttribute('id', i);
                s.margin = s.padding = 0;
                s.height = '100%';
                l = Math.floor(Math.random() * l) + 1
            }
            e.innerHTML = c;
            b.insertBefore(e, b.childNodes[l - 1])
        }

        function g(i, t) {
            return !t ? d.getElementById(i) : d.getElementsByTagName(t)
        };

        function f(v) {
            if (!g('nf37')) {
                c('<p><br></br>DESACTIVE (ADBLOCK).<br></br>DISABLE your ad blocker.<br /><br></i></p>', 'nf37')
            }
        };
        (function() {
            var a = ['ad300x250', 'ad_J', 'featuredAdContainer2', 'nbaMidAds', 'search-sponsored-links-top', 'sponseredlinks', 'video_overlay_ad', 'ad', 'ads', 'adsense'],
                l = a.length,
                i, s = '',
                e;
            for (i = 0; i < l; i++) {
                if (!g(a[i])) {
                    s += '<a id="' + a[i] + '"></a>'
                }
            }
            c(s);
            l = a.length;
            for (i = 0; i < l; i++) {
                e = g(a[i]);
                if (e.offsetParent == null || (w.getComputedStyle ? d.defaultView.getComputedStyle(e, null).getPropertyValue('display') : e.currentStyle.display) == 'none') {
                    return f('#' + a[i])
                }
            }
        }());
        (function() {
            var t = g(0, 'img'),
                a = ['/ad-pub.', '/adpopup.', '/adsense24.', '/adsup.', '/bannercode.php', '/dcloadads/ad', '/framead-', '/loadadsparam.', '/new/ad/ad', '/wallpaper_ads/ad'],
                i;
            if (typeof t[0] != z && typeof t[0].src != z) {
                i = new Image();
                i.onload = function() {
                    this.onload = z;
                    this.onerror = function() {
                        f(this.src)
                    };
                    this.src = t[0].src + '#' + a.join('')
                };
                i.src = t[0].src
            }
        }());
        (function() {
            var o = {
                    'http://pagead2.googlesyndication.com/pagead/show_ads.js': 'google_ad_client',
                    'http://js.adscale.de/getads.js': 'adscale_slot_id',
                    'http://get.mirando.de/mirando.js': 'adPlaceId'
                },
                S = g(0, 'script'),
                l = S.length - 1,
                n, r, i, v, s;
            d.write = null;
            for (i = l; i >= 0; --i) {
                s = S[i];
                if (typeof o[s.src] != z) {
                    n = d.createElement('script');
                    n.type = 'text/javascript';
                    n.src = s.src;
                    v = o[s.src];
                    w[v] = u;
                    r = S[0];
                    n.onload = n.onreadystatechange = function() {
                        if (typeof w[v] == z && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) {
                            n.onload = n.onreadystatechange = null;
                            r.parentNode.removeChild(n);
                            w[v] = null
                        }
                    };
                    r.parentNode.insertBefore(n, r);
                    setTimeout(function() {
                        if (w[v] !== null) {
                            f(n.src)
                        }
                    }, 2000);
                    break
                }
            }
        }())
    }
    if (d.addEventListener) {
        w.addEventListener('load', nf37, false)
    } else {
        w.attachEvent('onload', nf37)
    }
})(window);

upload_2017-1-29_22-26-17.png
 

Blaz

Moderator & Translator
Staff member
Moderator
Restoring restricted elements on livemecz.site:
Code:
livemecz.com#%#Object.defineProperty(document, 'oncontextmenu', { get: function() { return; } });
livemecz.com#%#Object.defineProperty(document, 'onselectstart', { get: function() { return; } });
livemecz.com#%#Object.defineProperty(document, 'onclick', { get: function() { return; } });
livemecz.com#%#Object.defineProperty(document, 'onmousedown', { get: function() { return; } });
Blocking strange script:
Code:
||abcast.net/p.js
Adblock Detection and removing restriction to view the embedded video directly:
Code:
abcast.net$$script[tag-content="self.location==top.location"]
@@||abcast.net^$generichide
Terrarium website:
Code:
terrarium.com.pl#%#Object.defineProperty(window, 'Abd_Detector', { get: function() { return function(){}; } });
||terrarium.com.pl/wp-content/plugins/disgruntled-nerve/assets/js/529efd72.js
terrarium.com.pl##a[href*="&section=adclick&"]
||terrarium.com.pl/*banner_
terrarium.com.pl##.widget-mystery-ad125
Anti-Adblock code for avaxhome (when disabling the two "broken" rules):
Code:
@@||avaxhome.co^$generichide
avaxhome.co##a[href^="http://ul.to/ref"]
avaxhome.co###sidebar > div[style^="background:#fff;float:left;"]
avaxhome.co###sidebar > div[id^="sidebar-"]:not(#sidebar-top)
Ad left-over on idevice.ro:
Code:
idevice.ro##.td-post-content > #getsocialmain + center
IMHO we should remove all those rules mentioned in 1st post and think about a different way like generichide etc. against anti-adblock for the sites.
 
Last edited:

Adam

Filters Developer
Staff member
Moderator
Thank you.
Rules for abcast.net works, but on terrarium.com.pl I still see adblock message.
I think in this case it can be simply hidden:
Code:
terrarium.com.pl###k224
These rules:
Code:
livemecz.com#%#Object.defineProperty(document, 'oncontextmenu', { get: function() { return; } });
livemecz.com#%#Object.defineProperty(document, 'onselectstart', { get: function() { return; } });
livemecz.com#%#Object.defineProperty(document, 'onclick', { get: function() { return; } });
livemecz.com#%#Object.defineProperty(document, 'onmousedown', { get: function() { return; } });
should allow me to use context menu on livemecz.com?
If yes, it does not work for me.
I found similar rule in "Annoyances Filter" and it works:
Code:
livemecz.com#%#AG_onLoad(function() { setTimeout(function() {document.getElementsByTagName("Body")[0].removeAttribute("oncontextmenu");}, 300); });

If it is possible, I prefer JS rules than $generichide :)

I think for avaxhome.co this rule should also works:
Code:
avaxhome.co#%#!function(){var a=window.setTimeout,b=/\.bab_elementid.$/;window.setTimeout=function(c,d){if("string"!=typeof c||!b.test(c))return a(c,d)}.bind(window);var c=[["blockadblock"],["babasbm"],[/getItem\('babn'\)/],["getElementById","String.fromCharCode","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789","charAt","DOMContentLoaded","AdBlock","addEventListener","doScroll","fromCharCode","<<2|r>>4","sessionStorage","clientWidth","localStorage","Math","random"]],d=function(a){for(var b,d,e,f,g,h=0;h<c.length;h++){for(b=c[h],d=0,e=0,g=0;e<b.length;e++)f=b[e],g=f instanceof RegExp?a.search(f):a.indexOf(f),g!==-1&&(d+=1);if(d/b.length>=.8)return!0}return!1},e=window.eval;window.eval=function(a){if(!d(a))return e(a);var b=document.body;b&&b.style.removeProperty("visibility"),b=document.getElementById("babasbmsgx"),b&&b.parentNode.removeChild(b)}.bind(window)}();
 

Blaz

Moderator & Translator
Staff member
Moderator
avaxhome.co only uses basic version of blockadblock, therefore the rule is not completely required.

Contextmenu works fine for me for livemecz.com.

Hiding k224 works only sometimes as they use another style sometimes which hides the usefull stuff.

Please try generichide for terrarium site.
Code:
@@||terrarium.com.pl^$generichide
terrarium.com.pl##.ABD_display_wrapper
 
Last edited:

Adam

Filters Developer
Staff member
Moderator
avaxhome.co only uses basic version of blockadblock, therefore the rule is not required.
Ok, but with generichide I still see adblock message.
I think this rule "avaxhome.co###sidebar > div[id^="sidebar-"]" hide too much. It hides calendar.
upload_2017-1-30_0-32-40.png

Please try generichide for terrarium site.
Code:
@@||terrarium.com.pl^$generichide
terrarium.com.pl##.ABD_display_wrapper
It works.
 

Blaz

Moderator & Translator
Staff member
Moderator
I onyl get adblock detection on avax when I have my Ad Muncher active and generichide is not excluded. Probably me generic rules for blockadblock excluded their urls which get checked.

I modified my post above regarding sidebar.

EDIT: Modification wasn't done :(
Edited again.
 
Last edited:

Adam

Filters Developer
Staff member
Moderator
Ok, if I add these rules it works:
Code:
@@||avaxhome.co^$generichide
@@/favicon.ico$image,domain=avaxhome.co
 

Alex302

Filters Developer
Staff member
Administrator
Removed:
Code:
avaxhome.co#%#var AG_AntiAntiBlock = function() { var baseCreateElement = document.createElement; document.createElement = function(name) { if (name && name.match(/div|font|center/i)) { return null; } else { return baseCreateElement(name); } } };
avaxhome.co#%#AG_onLoad(function() { AG_AntiAntiBlock(); });
idevice.ro#%#var AG_AntiAntiBlock = function() { var baseCreateElement = document.createElement; document.createElement = function(name) { if (name && name.match(/div|font|center/i)) { return null; } else { return baseCreateElement(name); } } };
idevice.ro#%#AG_onLoad(function() { AG_AntiAntiBlock(); });
androconsejos.com#%#var AG_AntiAntiBlock = function() { var baseCreateElement = document.createElement; document.createElement = function(name) { if (name && name.match(/div|font|center/i)) { return null; } else { return baseCreateElement(name); } } };
androconsejos.com#%#AG_onLoad(function() { AG_AntiAntiBlock(); });

Added to English filter:

Code:
avaxhome.co#%#(function() { var sto = window.setTimeout, re = /\.bab_elementid.$/; window.setTimeout = function(a, b) { if ( typeof a !== 'string' || !re.test(a) ) { return sto(a, b); } }.bind(window); var signatures = [ ['blockadblock'], ['babasbm'], [/getItem\('babn'\)/], ['getElementById','String.fromCharCode','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789','charAt','DOMContentLoaded','AdBlock','addEventListener','doScroll','fromCharCode','<<2|r>>4','sessionStorage','clientWidth','localStorage','Math','random'] ]; var check = function(s) { var tokens, match, j, token, pos; for ( var i = 0; i < signatures.length; i++ ) { tokens = signatures[i]; match = 0; for ( j = 0, pos = 0; j < tokens.length; j++ ) { token = tokens[j]; pos = token instanceof RegExp ? s.search(token) : s.indexOf(token); if ( pos !== -1 ) { match += 1; } } if ( (match / tokens.length) >= 0.8 ) { return true; } } return false; }; var realEval = window.eval; window.eval = function(a) { if ( !check(a) ) { return realEval(a); } var el = document.body; if ( el ) { el.style.removeProperty('visibility'); } el = document.getElementById('babasbmsgx'); if ( el ) { el.parentNode.removeChild(el); } }.bind(window); })();
avaxhome.co##div[style$="width:320px;height:235px;"]

idevice.ro##.td-post-content > #getsocialmain + center
Added to Safari filter:
Code:
@@||avaxhome.co^$generichide
@@/favicon.ico$domain=avaxhome.co
avaxhome.co##a[href^="http://ul.to/ref"]
 

Alex302

Filters Developer
Staff member
Administrator
For other sites, please, open new threads, as it is written in the rules.
 

Adam

Filters Developer
Staff member
Moderator
Ok.

I think all others rules with AG_AntiAntiBlock should be also removed.

From English Filter:
Code:
macbed.com#%#AG_onLoad(function() { AG_AntiAntiBlock(); });
macbed.com#%#var AG_AntiAntiBlock = function() { var baseCreateElement = document.createElement; document.createElement = function(name) { if (name && name.match(/div|font|center/i)) { return null; } else { return baseCreateElement(name); } } };
bestbitcoinfaucet.com#%#var AG_AntiAntiBlock = function() { var baseCreateElement = document.createElement; document.createElement = function(name) { if (name && name.match(/div|font|center/i)) { return null; } else { return baseCreateElement(name); } } };
bestbitcoinfaucet.com#%#AG_onLoad(function() { AG_AntiAntiBlock(); });
satoshiocean.com#%#var AG_AntiAntiBlock = function() { var baseCreateElement = document.createElement; document.createElement = function(name) { if (name && name.match(/div|font|center/i)) { return null; } else { return baseCreateElement(name); } } };
satoshiocean.com#%#AG_onLoad(function() { AG_AntiAntiBlock(); });
fullstuff.net#%#var AG_AntiAntiBlock = function() { var baseCreateElement = document.createElement; document.createElement = function(name) { if (name && name.match(/div|font|center/i)) { return null; } else { return baseCreateElement(name); } } };
fullstuff.net#%#AG_onLoad(function() { AG_AntiAntiBlock(); });
gamersglobal.de,latino-serialo.ru,lacasadeltikitaka.org,reality24horas.com#%#AG_onLoad(function() { AG_AntiAntiBlock(); });
gamersglobal.de,latino-serialo.ru,lacasadeltikitaka.org,reality24horas.com#%#var AG_AntiAntiBlock = function() { var baseCreateElement = document.createElement; document.createElement = function(name) { if (name && name.match(/div|font|center/i)) { return null; } else { return baseCreateElement(name); } } };
And maybe this from Russian Filter:
Code:
kingofdown.com#%#var AG_AntiAntiBlock = function() { var baseCreateElement = document.createElement; document.createElement = function(name) { if (name && name.match(/div|font|center/i)) { return null; } else { return baseCreateElement(name); } } };
kingofdown.com#%#AG_onLoad(function() { AG_AntiAntiBlock(); });
 

Alex302

Filters Developer
Staff member
Administrator
Ok, removed unnecessary rules.
kingofdown.com - replaced by $generichide
 

seanl

Well-Known Member
Added to English filter:
Code:
abcast.net#%#var baseCreateElement = document.createElement.bind(document); document.createElement = function(name) { var el = baseCreateElement(name); if(name != 'span') { return el; } else { Object.defineProperty(el, 'innerHTML', { set: function(text) { if(/^(<a id="[^"]*"><\/a>)*$/.test(text)) { throw new Error(); } Object.getOwnPropertyDescriptor(Element.prototype, 'innerHTML').set.call(el, text); }, get: function() { return el.innerHTML; } }); return el; }};
Please, check the result.
 
Last edited:
Top