-
Notifications
You must be signed in to change notification settings - Fork 83
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 ignore redirect=
directives with unrecognized redirect token
#1366
Comments
Invalid, use |
|
there are 2 filters in my sheet, both for adguard and for ubo. read the link I posted above |
There is no resource token matching |
That AdGuard rule will not work in uBO, I can reproduce what you're saying but you need to use the one I posted. |
Which AdGuard list(s) make use of |
@uBlock-user Fuck, I know the adguard rule won't work in uBO. I'm talking about something else.
|
@gorhill english |
What do you mean "detected incorrectly"? The URL I get is:
So the filter you use does match that URL. uBO tries to redirect to |
@bogachenko Okay, I think I understand what you're saying now, that rule is invalid and hnce shouldn't be compiled, but somehow it got compiled and applied as per https://user-images.githubusercontent.com/8535285/100518332-f6ed8d80-31e4-11eb-9a61-9ef8cfe94b92.png ? |
@gorhill Seems the redirection does occur as per https://user-images.githubusercontent.com/8535285/100518332-f6ed8d80-31e4-11eb-9a61-9ef8cfe94b92.png even though the resource token name doesn't exist ? |
Well I made the choice in the static filtering parser to not discard redirect filters for which no token exists, the idea is that maybe someone will modify The redirect should not be fired, the yellow line is ultimately confirmation the redirect occurs, the other lines are just confirmation a filter is matching. No yellow |
Modifier filters are coloured in blue. |
I prefer to keep open. There is this edge case where uBO should fall back to a working redirect filter if the picked one is not ultimately taken. I can reproduce this with the provided test case if I remove the |
Also, unrelated but I will try to fix at the same time, adding a priority to the redirect token causes uBO to think the token is invalid in the editor, though it ultimately work fine at runtime. |
@gorhill explain why the speed race does not work(although recently worked), I have 2 filters , see 1 for ubo 2 for adguard if you add them together in strict order (rule for ubo on 1 line, for adguard on 2), as I wrote, that's the rule for adguard. your extension will try to execute, but the rule for ubo will not. although it is the first |
That it worked before is just luck, there has never been documentation stating the order of the In any case, the fix proposed here is that uBO will disregard |
that would be wonderful |
`match-case` ------------ Related issue: - uBlockOrigin/uAssets#8280 (comment) The new filter option `match-case` can be used only for regex-based filters. Using `match-case` with any other sort of filters will cause uBO to discard the filter. `redirect=` ----------- Related issue: - uBlockOrigin/uBlock-issues#1366 `redirect=` filters with unresolvable resource token at runtime will be discarded. Additionally, the implicit priority is now set to 1 (was 0). The idea is to allow custom `redirect=` filters to be used strictly as fallback `redirect=` filters in case another `redirect=` filter is not picked up. For example, one might create a `redirect=click2load.html:0` filter, to be taken if and only if the blocked resource is not already being redirected by another "official" filter in one of the enabled filter lists.
redirect=
directives with unrecognized redirect token
@bogachenko Any change if you add |
nope |
Nevermind, internally the |
the |
This has always been the case, |
Yes, the only difference now is you will be seeing the internal representation in the logger too |
Looks fine to me. You created a |
Isn't it better if uBO translates redirect resources of AG into uBO counterparts? If AG adds a redirect filter there must be a reason and uBO uses some AG lists including French and Japanese. In case of Compatibility table of redirect resources is here |
The only one not available in uBO which I see used in AdGuard Base is |
What about |
I think gorhill/uBlock@904aa87 broke this again. OP filter has |
Yes, |
Ok I see your point now that I can test (was on my phone when I answered yesterday), so yes, I need to fix this. |
Correct redirection is now applied when both filters are used, but filter with invalid token is still logged. When only one filter, the one with invalid token is used, no redirection is logged. ❓ |
You think the redirect directives with invalid token should not be logged? |
I'm asking for opinions. |
Actually I described part of this bug here but today for some reason it has changed, and what I described in the link above will no longer help
SO. add this adguard rule to uBO my filters
||pagead2.googlesyndication.com^$important,script,redirect=googlesyndication-adsbygoogle,domain=animedigitalnetwork.fr|baddiehub.com|clockks.com|coron.tech|earn4files.com|extremereportbot.com|gatcha.org|huljjang.com|jemerik.com|moviessquad.com|scat.gold|sitarchive.com|tellynewsarticles.com|webkod.pl|youneed.win|darmowa-tv.ws|mr9soft.com
and go to the site, for example here
https://baddiehub.com/
{NSFW}, please note that this filter is aredirect=
and now what do you get https://user-images.githubusercontent.com/8535285/100518332-f6ed8d80-31e4-11eb-9a61-9ef8cfe94b92.pngtested on a stable release version and on the latest version for developers, of course with default settings
PS: You have a rule in your main list, add badfilter flag for a second. so that he does not bother you to check
||googlesyndication.com^$script,redirect-rule=googlesyndication_adsbygoogle.js,domain=baddiehub.com,badfilter
The text was updated successfully, but these errors were encountered: