Skip to content
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

Exception rules interfere with each other #1749

Closed
jellizaveta opened this issue Apr 12, 2023 · 3 comments
Closed

Exception rules interfere with each other #1749

jellizaveta opened this issue Apr 12, 2023 · 3 comments

Comments

@jellizaveta
Copy link

jellizaveta commented Apr 12, 2023

There are two rules in the Basic Filter (from EL) that don't work together:

@@||www.google.*/search?$generichide

@@||www.google.*/search?$domain=google.ae|google.at|google.be|google.bg|google.by|google.ca|google.ch|google.cl|google.co.id|google.co.il|google.co.in|google.co.jp|google.co.ke|google.co.kr|google. co.nz|google.co.th|google.co.uk|google.co.ve|google.co.za|google.com|google.com.ar|google.com.au|google.com.br|google.com.co|google.com.ec|google.com.eg|google.com.hk|google.com.mx|google.com my|google.com.pe|google.com.ph|google.com.pk|google.com.py|google.com.sa|google.com.sg|google.com.tr|google.com.tw|google.com.ua|google.com.uy|google.com.vn|google.cz|google.de|google.dk|google. dz|google.ee|google.es|google.fi|google.fr|google.gr|google.hr|google.hu|google.it|google.lt|google.lv|google.nl|google.no|google.pl|google.pt|google.ro|google.rs|google.ru|google.se|google.sk

because of this rule : ~hatena.ne.jp##a[href*="//b.hatena.ne.jp/entry/"] links in google search results are hidden.

Screenshot:

https://www.google.com/search?q=inurl%3Ab.hatena.ne.jp%2Fentry

Screenshot 2023-04-12 at 17 09 15

Expected behavior: links are not hidden

Screenshot: Screenshot 2023-04-12 at 17 10 45

When I disable one of the rules, the links appear.

AdguardTeam/tsurlfilter#82

Exceptions have been added to the Social Media filter, pay attention to this when checking. AdguardTeam/AdguardFilters@7d05d51

@jellizaveta jellizaveta changed the title Conflict of rules Exception rules interfere with each other Apr 12, 2023
@adguard-bot adguard-bot assigned sfionov and unassigned zzebrum Apr 12, 2023
@ameshkov
Copy link
Member

Please see the discussion in that issue:
AdguardTeam/tsurlfilter#82 (comment)

@sfionov sfionov assigned ngorskikh and unassigned sfionov Apr 26, 2023
@ngorskikh
Copy link
Member

@ameshkov In corelibs, we consider "exception rules with modifiers" the lowest priority, and even have tests that test for that. It looks like the behaviour in the OP is correct. Furthermore, even if we were to shuffle priorities around, then it would only mean that the other rule from the OP would stop working and would become useless altogether. What if instead we started applying some rules (like generichide here) regardless if they are the first match from the urlfilter?

@ameshkov
Copy link
Member

@ngorskikh I am not sure where this logic comes from, in theory the more specific the rule, the higher the priority should be.

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

No branches or pull requests

6 participants