-
Notifications
You must be signed in to change notification settings - Fork 81
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
uBO should not parse filters inside an invaild !#if
directive
#2577
Comments
It's by design, unknown
|
You want me to have the syntax highlighter render it as a comment? The bottom line is that unparseable directives should have a default which is to not filter out, otherwise uBO is just guessing, and you want that guessing to be |
It is not a comment from uBO's point of view. It is a comment from any other blocker which do not parse Solution is simple, just wrap the block around a directive uBO understand. |
Edit: Okay, I had sent the following before your final reply arrived.
I meant it should ideally be shown by its true nature:
Syntax highlighter rendering it as a invalid directive gives the wrong impression that down the road uBO will ignore whatever is thrown inside this directive. If the syntax highlighter were to render it as a comment then I'd have known that I should not count on uBO ignoring this in the future. |
You are missing that what you ask is essentially that you want uBO to be tailored to your state of mind when you craft your filters. You want uBO to guess
Common sense dictate to not make a decision when not knowing what to do with a directive, and not making a decision means behaving as if the directive does not exist. |
Point taken. I'm okay with limiting the invalid directive with
You should look at it from a filter author's perspective that is not acquainted with uBO's undocumented inner-evaluation. The filter author decides to limit a filter using directives, he certainly will not expect that the said limit might be ignored and the filter might be run at places he never intended it to. Imagine if a programming language that only accepts conditions in the form of
I can't imagine the benefits it would have for that person. |
[Side note] Will that trigger this behavior?: I've been using those directives for a such long time, does that mean every directives were ignored all these time? Sigh. |
I decided to remove all AdGuard-specific directives from my list, for me it's not worth piling up lines of filters for this (with |
Why not just use
|
This means unbalanced |
I don't want to spend time maintaining the same set of verbatim filters with just different directives. The issue here was just the tipping point for me to come to that realization. |
Please do not spoil the operation of this method: https://github.com/FiltersHeroes/PolishAnnoyanceFilters/blob/96d5f4c721f28688e1c1473a9400f9dc28178fe9/templates/PPB.template#L107-L110 ! Adding a supplement list to uBlock Origin and AdGuard MV2/App for Windows&macOS&Android so users don't have to subscribe to it
!#if (!adguard_ext_android_cb && !adguard_app_ios)
!#include PAF_supp.txt
!#endif I use it to exclude the list on the iPhone and iPad (AdGuard has not added an option to detect if someone has an active extension for Safari - Unfortunately they rely on In the past, there was an add-on for macOS Safari too (FiltersHeroes/PolishAnnoyanceFilters@d4510ae), but seemingly all of a sudden there was support for |
This should be fixed in:
|
Prerequisites
I tried to reproduce the issue when...
Description
Similar but unrelated:
#1712 (comment)
As per uBO docs:
As per AdGuard docs:
I use uBO's
!#if !cap_html_filtering
and!#if env_mobile
directives in my list.AdGuard doesn't have an equivalent as of now, they're planning on adding them:
AdguardTeam/AdguardBrowserExtension#2146
AdguardTeam/AdguardBrowserExtension#2259
So as a workaround for AdGuard I use:
!#if (!adguard_app_windows && !adguard_app_mac && !adguard_app_android && !adguard_ext_firefox)
and!#if (adguard_app_android || adguard_app_ios)
I had expected uBO to ignore filters inside those, but apparently it doesn't.
A specific URL where the issue occurs.
github.com
Steps to Reproduce
Or
github.com
Expected behavior
The page shouldn't be hidden because the directive is invalid and uBO should just ignore filters inside an invalid directives (well, valid according to AdGuard).
Actual behavior
The page is hidden.
uBO version
1.48.3b3 dev
Browser name and version
Firefox 111
Operating System and version
.
The text was updated successfully, but these errors were encountered: