Skip bloatware/malware pages from malicious adv-based URL shorteners

Discussion in 'Feature Requests (AdGuard for Mac)' started by Roccobot, Jun 2, 2019.

  1. Roccobot

    Roccobot New Member

    Joined:
    Jul 25, 2017
    Messages:
    63
    Basically, a feature I recently discovered in uBlock Origin which I use at work: really handy (also improves security a lot), so I'd like to have the same in Adguard. Don't know if it's just a filter thing or if it has to be implemented specifically as a feature. Anyway, I enabled all the uBlock filters lists in Adguard and it doesn't seem to work.

    The following is the best example I could find.
    If you open this page*, then you click on Download, you completely bypass the gloyah.net ad-filled page (which usually opens a lot of popups and stuff). With Adguard, I need to whitelist some of those domains in order to proceed, then wait for the countdown to turn into the 'Next' button, then click and cross my fingers (sometimes an ugly fullscreen mobile game ad appears thanks to the whitelisting).

    * (it takes you to the download of a fansubbed show, hosted in Italy where it's 100% legal, so I hope I can use it as an example here)

    Is it possible to have the same enhancement in Adguard? It would be awesome.
     
  2. Boo Berry

    Boo Berry Moderator + Beta Tester Moderator

    Joined:
    May 30, 2012
    Messages:
    4,215
    That's because AdGuard doesn't support uBlock Origin's extended syntax for filters... yet. I say yet because that's coming through Scriptlets, meaning you'll be able to use uBlock Origin filters that uses extended syntax in AdGuard for Windows, AdGuard for Mac and AdGuard for Android. Experimental support landed recently in the AdGuard Adblocker browser extensions.

    Scriptlets: https://github.com/AdguardTeam/Scriptlets
    Compatibility: https://github.com/AdguardTeam/Scriptlets#compatibility
     
    Roccobot likes this.
  3. Roccobot

    Roccobot New Member

    Joined:
    Jul 25, 2017
    Messages:
    63
    Thank you! So I'm assuming your answer means the thing is achieved 'just' by filters with extended syntax?
     
  4. Boo Berry

    Boo Berry Moderator + Beta Tester Moderator

    Joined:
    May 30, 2012
    Messages:
    4,215
    Yes.
     
    Roccobot likes this.
  5. Roccobot

    Roccobot New Member

    Joined:
    Jul 25, 2017
    Messages:
    63
    I see it's way more complicated than I thought
    Hope the community will come to help basic users with the scriplets, they seem very powerful!
     
    Last edited: Jun 2, 2019
  6. Adam

    Adam Filters Developer Staff Member Moderator

    Joined:
    Aug 17, 2014
    Messages:
    1,456
    I think that you can use the same script which uBlock Origin is using to bypass gloyah.net timer/ads, but with AdGuard syntax.
    If you add this rule to user filter it should skip timer/ads:
    Code:
    gloyah.net#%#(function(){var f=/^\d$/;try{var g,h=!0;Object.defineProperty(window,"ysmm",{configurable:!1,set:function(d){if(h){h=!1;try{if("string"===typeof d){var c="",e="",a;for(a=0;a<d.length;a++)0===a%2?c+=d.charAt(a):e=d.charAt(a)+e;var b=(c+e).split("");for(a=0;a<b.length;a++)if(f.test(b[a]))for(c=a+1;c<b.length;c++)if(f.test(b[c])){var k=parseInt(b[a],10)^parseInt(b[c],10);10>k&&(b[a]=k.toString());a=c;break}b=b.join("");var l=window.atob(b).slice(16,-16);window.stop();window.onbeforeunload=null;window.location.href= l}}catch(m){}}g=d},get:function(){return g}})}catch(d){window.console.error("Failed to set up Adfly bypasser!")}})();
     
  7. Roccobot

    Roccobot New Member

    Joined:
    Jul 25, 2017
    Messages:
    63
    Amazing, it seems to work! But for some reason only if I add it as a 'local' filter (in the Adguard for Mac Preferences pane). If I add it to my remote TXT file I use to sync my rules between my different devics it won't work o_O
     
  8. Adam

    Adam Filters Developer Staff Member Moderator

    Joined:
    Aug 17, 2014
    Messages:
    1,456
    I don't have MacOS, so I'm not sure how it looks like in AdGuard for Mac, but if I'm not wrong in AdGuard for Windows from version 7 is necessary to mark filters as trusted to make JavaScript/$replace rules work.
    upload_2019-6-3_13-54-26.png
    I guess that the same is necessary in AdGuard for Mac.
     
  9. Roccobot

    Roccobot New Member

    Joined:
    Jul 25, 2017
    Messages:
    63
    Yeah, I added my 'remote' filter list as a trusted source, but I see at the next boot it lost his 'trusted' mark. Could this be a bug?
     
  10. Roccobot

    Roccobot New Member

    Joined:
    Jul 25, 2017
    Messages:
    63
    Actually, I double checked: it losts its mark immediately: I add my filter from URL, click 'Next', confirm and my 'Roccobot Filters' list is marked as trusted.
    I close then reopen the Preferences pane and the mark is gone and the extended syntax doesn't work (screenshots in sequence).

    Side question: I didn't add @@||hbl.local$document in my custom user filters list.. is it something that the application adds by itself?
     
  11. Adam

    Adam Filters Developer Staff Member Moderator

    Joined:
    Aug 17, 2014
    Messages:
    1,456
    Probably it is, but unfortunately I can't check it.
    Could you please report it here - https://github.com/AdguardTeam/AdguardForMac/issues

    To be honest, I don't know, but I think it shouldn't happens.
     
  12. Roccobot

    Roccobot New Member

    Joined:
    Jul 25, 2017
    Messages:
    63
  13. Boo Berry

    Boo Berry Moderator + Beta Tester Moderator

    Joined:
    May 30, 2012
    Messages:
    4,215
  14. Boo Berry

    Boo Berry Moderator + Beta Tester Moderator

    Joined:
    May 30, 2012
    Messages:
    4,215
    Confirmed. It is indeed a bug.
     
  15. Adam

    Adam Filters Developer Staff Member Moderator

    Joined:
    Aug 17, 2014
    Messages:
    1,456
    Customer ID is optional, so of course it's valid.
    Thank you for reporting it.
     
  16. Roccobot

    Roccobot New Member

    Joined:
    Jul 25, 2017
    Messages:
    63
    A reboot isn't actually required: I see the bug immediately after I reopen the preferences pane
     
  17. Boo Berry

    Boo Berry Moderator + Beta Tester Moderator

    Joined:
    May 30, 2012
    Messages:
    4,215
    Ah, so you're right.
     
  18. Blaz

    Blaz Moderator & Translator Staff Member Moderator

    Joined:
    Dec 21, 2014
    Messages:
    9,939
    Added to Annoyances filter (tweaks). Update available in about 3 hours.
     
    Roccobot likes this.
  19. Roccobot

    Roccobot New Member

    Joined:
    Jul 25, 2017
    Messages:
    63
    WOW, thanks!