How Do You Block Anti Adblock Script?

Discussion in 'Technical Support (Adguard for Windows)' started by Joe, May 20, 2014.

  1. Joe

    Joe New Member

    Joined:
    Apr 14, 2014
    Messages:
    20
  2. Boo Berry

    Boo Berry Moderator + Beta Tester Moderator

    Joined:
    May 30, 2012
    Messages:
    2,623
    Heh, an Anti Block script that's a bit of a PITA. This rule *should* work, but it doesn't work for me (yet), odd.

    Code:
    @@||pagead2.googlesyndication.com/pagead/show_ads.js$domain=better-explorer.com
    Avatar, perhaps this filter addon subscription for Easylist may be useful for Adguard too?
     
    Last edited by a moderator: May 20, 2014
  3. Nameless

    Nameless Beta Tester

    Joined:
    Mar 19, 2014
    Messages:
    723
    Seen a few fixes for this and so far all have failed, the one that looked right which is in the easy list is below but it failed.

    Code:
    @@.png#$domain=android-zone.org|anonytext.tk|backin.net|better-explorer.com|chrissmoove.com|lordpyrak.net|myiplayer.eu
    @@||better-explorer.com^$elemhide
    
    I think the best solution is a userscript this one works: http://userscripts.org:8080/scripts/review/155840
     
  4. Boo Berry

    Boo Berry Moderator + Beta Tester Moderator

    Joined:
    May 30, 2012
    Messages:
    2,623
    Ah, the author also has a filter subscription available to use with this userscript. We should start a recommended extension (userscript) thread. You should install the userscript from this direct link (copy and paste). Avatar, any chance at having an anti-adblock filter?
     
    Last edited by a moderator: May 21, 2014
  5. avatar

    avatar Administrator Staff Member Administrator

    Joined:
    Oct 26, 2010
    Messages:
    12,285
    Why? We have javascript injection rules that could work as good as this userscript.
    Storing these anti-adblock rules in our filters is much simpler than installing some third-party userscript.

    So, let's do it in English filter.

    First, we'll create a simple API to use:
    Code:
    #%#AG_onLoad = function(func) { window.addEventListener('DOMContentLoaded', func); };
    #%#AG_removeElementById = function(id) { var element = document.getElementById(id); if (element && element.parentNode) { element.parentNode.removeChild(element); }};
    
    And now blocking anti-adblock:)
    Code:
    better-explorer.com#%#AG_onLoad(function() { AG_removeElementById('y34e') });
    
    I think we could think of some heuristic to block antiblock.org scripts but we'll do it simple way this time.
    Btw, maybe you have thoughts on this heuristic?
     
  6. Boo Berry

    Boo Berry Moderator + Beta Tester Moderator

    Joined:
    May 30, 2012
    Messages:
    2,623
    Using heuristics might be beneficial but there's always that potential Antiblock could update to break successful blocking. One other thought that came to mind yesterday was a custom extension (userscript) maintained by you guys like the Assistant and popup blocker that's updated for anti-Adblock scripts. However seeing how the filters can do this, that's probably better, right?