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 $important modifier #833

Closed
ameshkov opened this Issue Oct 7, 2016 · 8 comments

Comments

Projects
None yet
3 participants
@ameshkov
Member

ameshkov commented Oct 7, 2016

$important modifier applied to a rule increases its priority over any other rule without $important modifier. Even over basic exception rules.

Example 1:

||example.org^$important
@@||example.org^

||example.org^$important will block all requests despite of the exception rule.

Example 2:

||example.org^$important
@@||example.org^$important

Now exception rule also has $important modifier, so it will be applied.

Example 3:

$important modifier will be ignored if document-level exception rule is applied to the document.

||example.org^$important
@@||test.org^$document

If request to example.org is sent from test.org, the rule won't be applied despite it has $important modifier.

@ameshkov ameshkov added the Filtering label Oct 7, 2016

@ameshkov ameshkov added this to the 2.8 milestone Oct 7, 2016

@ameshkov ameshkov self-assigned this Oct 7, 2016

@ameshkov

This comment has been minimized.

Show comment
Hide comment
@ameshkov

ameshkov Oct 7, 2016

Member

@Alex-302 please note, that after implementing this $replace and $protobuf rules will loose their priority over other basic rules. So, you'll have to add $important modifier to them.

Also older AG versions will ignore rules with unknown modifiers, so you'll have to keep old rules for some time.

Member

ameshkov commented Oct 7, 2016

@Alex-302 please note, that after implementing this $replace and $protobuf rules will loose their priority over other basic rules. So, you'll have to add $important modifier to them.

Also older AG versions will ignore rules with unknown modifiers, so you'll have to keep old rules for some time.

@TPS

This comment has been minimized.

Show comment
Hide comment
@TPS

TPS Oct 8, 2016

Contributor

If this is added, will this also solve the issue of anti-adblockers abusing !important (such as f***adblock) to mess up such users — or is this not related @ all?

Contributor

TPS commented Oct 8, 2016

If this is added, will this also solve the issue of anti-adblockers abusing !important (such as f***adblock) to mess up such users — or is this not related @ all?

@ameshkov

This comment has been minimized.

Show comment
Hide comment
@ameshkov

ameshkov Oct 10, 2016

Member

@TPS no, that's not related.

The purpose is to allow us to change particular rules priority.

Member

ameshkov commented Oct 10, 2016

@TPS no, that's not related.

The purpose is to allow us to change particular rules priority.

@ameshkov

This comment has been minimized.

Show comment
Hide comment
@ameshkov

ameshkov Oct 10, 2016

Member

@Alex-302 it's time to add duplicate rules with $important modifier.

We need to do this for $replace and $protobuf rules.

Member

ameshkov commented Oct 10, 2016

@Alex-302 it's time to add duplicate rules with $important modifier.

We need to do this for $replace and $protobuf rules.

@ameshkov

This comment has been minimized.

Show comment
Hide comment
@ameshkov

ameshkov Oct 10, 2016

Member

Done

Member

ameshkov commented Oct 10, 2016

Done

@ameshkov ameshkov closed this Oct 10, 2016

Alex-302 added a commit to AdguardTeam/AdguardFilters that referenced this issue Oct 10, 2016

Alex-302 added a commit to AdguardTeam/AdguardFilters that referenced this issue Oct 10, 2016

@Alex-302

This comment has been minimized.

Show comment
Hide comment
@Alex-302

Alex-302 Oct 10, 2016

Member

We need to do this for $replace and $protobuf rules.

done

Member

Alex-302 commented Oct 10, 2016

We need to do this for $replace and $protobuf rules.

done

@ameshkov

This comment has been minimized.

Show comment
Hide comment
@ameshkov

ameshkov Oct 20, 2016

Member

Just found a bug, $replace rules could cause elements removal from the page code.

Member

ameshkov commented Oct 20, 2016

Just found a bug, $replace rules could cause elements removal from the page code.

@ameshkov ameshkov reopened this Oct 20, 2016

@ameshkov

This comment has been minimized.

Show comment
Hide comment
@ameshkov

ameshkov Nov 2, 2016

Member

Resolved

Member

ameshkov commented Nov 2, 2016

Resolved

@ameshkov ameshkov closed this Nov 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment