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

Cosmetic filter does not work if exception for this filter or filter with negated domain exist in other list #388

Closed
8 tasks
gwarser opened this issue Jan 21, 2019 · 3 comments
Labels
wontfix won't be addressed

Comments

@gwarser
Copy link

gwarser commented Jan 21, 2019

Prerequisites

Prerequisites

  • I verified that this is not a filter issue
  • This is not a support issue or a question
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
    • Your issue may already be reported.
  • I tried to reproduce the issue when...
    • uBlock Origin is the only extension
    • uBlock Origin with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uBlock Origin
  • I checked the documentation to understand that the issue I report is not a normal behavior

Description

Element cannot be hidden by cosmetic filter if one of third party filter lists contains exception for this filter.
This can be cosmetic exception filter (#@#...), or hiding filter with negated domain (~...##...) which will not apply to our test page.

A specific URL where the issue occurs

https://www.telepolis.pl/

Facebook icon in top right corner (.icon-facebook) cannot be hidden in "My filters"/"Polish Social Filters", because "AdGuard Social Media" list contains filter similar to this: ~ozracing.com,~telepolis.pl,~deezer.com##.icon-facebook

Steps to Reproduce

  1. select "AdGuard Social Media" list
  2. add telepolis.pl##.icon-facebook to "My filters"
  3. visit https://www.telepolis.pl/

Expected behavior:

Facebook icon in top right corner should be hidden

Actual behavior:

Icon is not hidden

Your environment

  • uBlock Origin version: 1.17.4
  • Browser Name and version: Firefox 64, Chromium 71
  • Operating System and version: Linux

Notes

Internal discussion: https://github.com/orgs/uBlockOrigin/teams/ublock-issues-volunteers/discussions/69
Simillar issue on ABP issue tracker: https://issues.adblockplus.org/ticket/5665 (other way around - generic blocking filter overrides filter with negated domain)
Original issue: MajkiIT/polish-ads-filter#11494

@gwarser
Copy link
Author

gwarser commented Jan 21, 2019

This is by design behavior.

Workaround - use different selector.
In this example, one of:

  • telepolis.pl##a.icon-facebook
  • telepolis.pl##.icon-facebook,.icon-facebook
  • telepolis.pl##.icon-facebook.icon-facebook
  • telepolis.pl##.icon-facebook,irrelevant_selector

For scriptlet injection filters use additional dummy parameter:

example.com##+js(nobab) -> excepted by example.com#@#+js(nobab) -> overriden by example.com##+js(nobab, important)

Mind that some scriptlet use optional parameters.

@krystian3w
Copy link

network filters use same mechanism? #620

@uBlock-user uBlock-user added wontfix won't be addressed and removed fixed issue has been addressed labels Jun 9, 2019
@gwarser
Copy link
Author

gwarser commented Jun 9, 2019

||domain.com^$~image

this is also translated into:

@@||domain.com^$image? #388


||domain.com^$~image

Block all connections, except image

@@||domain.com^$image

If something is blocked and it is image then allow it.

For network filters you have important option to override exceptions from other filter lists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix won't be addressed
Projects
None yet
Development

No branches or pull requests

3 participants