Improve validating of CSS rules
Not recognized as invalid - no CSS style / mistaken $
investing.com#$#.relative ~ div[class^="fixed bottom-0 z-50"]
investing.com#@$#.relative ~ div[class^="fixed bottom-0 z-50"]
Extended CSS is detected
investing.com#$?#.relative ~ div[class^="fixed bottom-0 z-50"]
investing.com#@$?#.relative ~ div[class^="fixed bottom-0 z-50"]
Details
The issue here is that both ABP and ADG use the #$# / #@$# separators — ABP for snippets and ADG for style injection. If the parser cannot interpret the body as CSS injection, it falls back and parses it as ABP snippet injection, this is why you do not see error in the first case. In the second case (with the addition of the Extended CSS marker, ?), only ADG uses the separator, so a clear error message can be provided at the parser level.
There are likely two solutions to this problem:
- specifying the syntax more strictly and excluding ABP syntax in certain cases; or
- validating ABP snippets.
@Alex-302 You can try at https://scripthunter7.github.io/agtree-astexplorer/
I don't see #$# in
https://easylist.to/easylist/easylist.txt
https://easylist.to/easylistgermany/easylistgermany.txt
I don't see
#$#in https://easylist.to/easylist/easylist.txt https://easylist.to/easylistgermany/easylistgermany.txt
I think it's for the following reason.
from https://help.adblockplus.org/hc/en-us/articles/1500002338501-Snippet-filters-tutorial
For security reasons, snippet filters can only be added to a user's custom filters list or in the ABP Anti-Circumvention Filter List, the latter being vetted and reviewed.
Ok, I see it in https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt