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 #82

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

Exception rules interfere with each other #82

jellizaveta opened this issue Apr 12, 2023 · 4 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.

@ameshkov ameshkov added the bug Something isn't working label Apr 12, 2023
@ameshkov
Copy link
Member

Do we have the same issue in CoreLibs?

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

jellizaveta commented Apr 12, 2023

AdguardTeam/CoreLibs#1749 - yep, created

@ameshkov
Copy link
Member

In tsurlfilter there's a simple rule of calculating rules priorities: the more "specific" the rule is, the higher the priority is:

isHigherPriority(r: NetworkRule): boolean {

We already have logic for higher priority of document-level rules:
https://github.com/AdguardTeam/tsurlfilter/blob/master/packages/tsurlfilter/src/rules/network-rule.ts#L763

However, missed generichide / genericblock there.

@105th
Copy link
Member

105th commented Jan 10, 2024

@jellizaveta looks like it was fixed with new priority schema. i checked in 4.2.249 - links are visible
Снимок экрана 2024-01-10 в 17 40 42
Снимок экрана 2024-01-10 в 17 40 38

If not fixed, please reopen.

@105th 105th closed this as completed Jan 10, 2024
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

7 participants