-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for AdGuard Special Case Pre-Processor Directives #1205
Comments
No, this could cripple uBO's parsing of otherwise good filters if a list makes use of an unknown directives. Throwing away filters should be done only when the intent is clear and explicit. Imagine ABP coming up with pre-parser support and start to ask filter list maintainers to make use of them for whatever reasons, this could cause uBO to unduly throw away perfectly compatible filters. |
@gorhill The issue is not fully resolved, the combination of conditions does not work. You can add to my filters and check it https://raw.githubusercontent.com/bogachenko/filterlist/personal/bogachenkoPF.txt !#if (adguard_ext_safari || adguard_app_ios || adguard_ext_android_cb)
||google.com^
!#endif
!#if (adguard_app_android && adguard_app_ios)
||google.com^
!#endif FAQ - https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#conditions |
The issue as described is resolved. What you are asking is something unrelated to the original issue. |
Why should I create the same type of topic with issue, when i can write here, in addition. |
Prerequisites
Description
From AdGuard's KB Allowed Pre-Processor Directive List they use additional AdGuard product specific directives in special cases that uBO doesn't recognize.
I'd like to use the
adguard_app_ios
directive to conditionally load a sublist in Web Annoyances Ultralist only in the iOS AdGuard environment (Due to iOS not allowing CSS modifications and needing to remove some companion filters that make the page incorrect render when the CSS rules don't get loaded) but uBO doesn't recognize theadguard_app_ios
directive and then loads the sublist wrapped in directive not recognized that I only want to conditionally load when it is iOS AdGuard envionment.The same behavior is observed if when only loading the sublist directly - The filters wrapped in the unrecognized directive gets loaded because uBO just ignores the directive rather than recognize the directive as false and treat everything until the closing
!#endif
as not to be loaded.If uBO encounters a directive it doesn't understand does it make more sense to throw out all content between the invalid directive and the closing
!#endif
?Is it possible to add additional directives that uBO will recognize to mirror AdGuard used directives? I can elaborate more on what issue this specific sublist fixes (screenshots, video) if you'd like.
adguard_app_mac
-- AG for Macadguard_app_android
-- AG for Androidadguard_app_ios
-- AG for iOSadguard_ext_safari
-- AG browser extension for Safariadguard_ext_android_cb
-- AG content blocker for Samsung/YandexRelated:
yourduskquibbles/webannoyances#241
A specific URL where the issue occurs
N/A
Steps to Reproduce
https://raw.githubusercontent.com/yourduskquibbles/webannoyances/master/ultralist.txt
filters/adguard_app_ios_exclusion_filters.txt
wrapped in invalid directiveadguard_app_ios
https://raw.githubusercontent.com/yourduskquibbles/webannoyances/master/ultralist.txt
https://raw.githubusercontent.com/yourduskquibbles/webannoyances/master/filters/adguard_app_ios_exclusion_filters.txt
adguard_app_ios
Expected behavior:
uBO ignores everything inside of invalid
!#if
directive until closing!#endif
Actual behavior:
uBO ignores only the 1 line of the invalid directive and proceeds to load content within the invalid
!#if
statementYour environment
The text was updated successfully, but these errors were encountered: