-
Notifications
You must be signed in to change notification settings - Fork 81
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 always hide elements #3127
Comments
There is a bad cosmetic filter in that list:
If you create an exception for that filter (or remove it from the list), all works fine:
The bad part is the
Which is an invalid selector as seen when entering the following in dev console:
However the cosmetic filter compiler should catch such invalid filter and discard it, but it didn't. This needs to be fixed. Note that there are many other invalid cosmetic filters in that list which are caught and discarded by uBO. If you open the list with the eye icon, uBO highlights those invalid filters. Example: ABP won't notify you about such invalid cosmetic filters, and will actually even inject them into the document. However in ABP each cosmetic filter is injected in its own CSS declaration, such that they won't break other valid cosmetic filters. uBO injects all cosmetic filters into as few CSS declaration as possible such that an invalid cosmetic filter will break other cosmetic filters in the same CSS declaration. This works fine unless the filter compiler fails to detect an invalid cosmetic filter such as the case here. |
Correction: as per CSS character escape sequences, the selector is valid:
The issue is that I didn't expect CSSTree (the tool uBO uses to compile cosmetic filters) to cause newlines to end up in parsed selector data. The fix is for uBO to be prepared for this to happen. |
Fix will be in next dev build. I haven't decided yet if I should publish a revision to last stable release. |
[some lists were old] Other lists:
|
Each affected list must be updated for fix to work? I tried with Maybe I did not think about it before - just purged caches :) |
Yes, they need to be re-compiled. |
I have fixed almost all errors in the list, but if anyone needs the old one for testing purposes, i renamed it to AdBlockPlusBroken.txt Thank you for the quick response and fix! |
Would it make sense for uBO to encase selectors in a forgiving selector list such as Unless I'm missing something, the minimum browser versions for uBO are already beyond what it requires (due to the |
|
Prerequisites
I tried to reproduce the issue when...
Description
Cosmetic filters are not always applied correctly.
Filters like this:
hwupgrade.it,punto-informatico.it,tomshw.it,telefonino.net##[href*="super-sconto"]
appears in yellow in logger, marked as DOM filters, but the element is not hidden in the page.
this is the list of custom filters about that site. I have also tried to load them as "my filters", but still doesn't hide the links.
hwlist.txt
Thank you
A specific URL where the issue occurs.
Steps to Reproduce
Filters will appear yellow in logger but the elemts will not be hidden
Expected behavior
This is the same page using adblock plus and same list:
i expect that cosmetic filter hides all matching tags
Actual behavior
uBO version
1.55.0
Browser name and version
Chromium Version 109.0.5414.120 (Official Build, ungoogled-chromium) (32-bit)
Operating System and version
Windows 7
The text was updated successfully, but these errors were encountered: