Skip to content

$redirect-rules used with $Important act as $redirect #231

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

Open
ghost opened this issue Oct 23, 2022 · 1 comment
Open

$redirect-rules used with $Important act as $redirect #231

ghost opened this issue Oct 23, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 23, 2022

As the title say, there is a problem with the $redirect-rules acting as simple $redirect when paired with the $important filter.

example: *$script,redirect-rule=noopjs,domain=brave.com,important every script will get the noopjs, just like if you used the simple $redirect filter.

If you remove the $important from the filter, then only matomo.js gets the noopjs.

It works fine in uBlock and while it is not something critical or something everyone will use, it is still a misbehavior by Brave's adblocker not to respect the $redirect-rule filter and how it only should apply redirection to blocked elements.

@antonok-edm
Copy link
Collaborator

This redirect/important interaction has been quite frustrating in the past (#131)...

If I understand correctly:

  • adblock-rust currently treats $important as "block this regardless of any exceptions"
  • uBlock Origin treats $important as "if there's a blocking rule, block this regardless of any exceptions"

Until $redirect-rule came around, every rule was also a blocking rule so the difference didn't really matter.

It looks like there are only 5 such filters in Brave's default lists, so I agree that this isn't a super critical issue:

||google-analytics.com/analytics.js$script,redirect-rule=noopjs,domain=hudsonvalleypost.com|seacoastcurrent.com|popcrush.com,important
||googletagmanager.com/gtm.js$script,redirect-rule=noopjs,domain=hudsonvalleypost.com|seacoastcurrent.com|popcrush.com,important
||prebid.elespectador.com^$script,redirect-rule=googletagservices_gpt.js,1p,important
||rudaw.net/images/$image,1p,redirect-rule=1x1.gif,important
||elpais.com/t.gif$image,1p,redirect-rule=1x1.gif,important

The easy fix for this (duplicating all important filters without redirect-rule) would have a significant increase in memory consumption so I'll probably revisit this after some further optimizations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant