-
Notifications
You must be signed in to change notification settings - Fork 12
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
Escape quotes (' and ") in arguments of :contains in lists for uBO #156
Comments
Probably only |
CC @slavaleleka |
@Alex-302 It's totally different. The PR was about an uBO issue that will eventually be fixed but the problem here is permanent change of uBO. |
@Yuki2718 FYI: We have created the ECSSTree library, which is fully backwards compatible with basic CSSTree, but thanks to re-tokenization it can parse the edge case you mentioned and many other cases as well. You can find it at the following link: https://github.com/AdguardTeam/ecsstree Related: uBlockOrigin/uBlock-issues#2328 |
Also a little outdated is escape method, now works only in uBo:
to avoid regex syntax for that as long uBo consider switch to ECSSTree. Same protection needed orphaned |
|
I'm curious if ECSSTree is used to compile filters in the "/ublock/" directory - if that is, the AdGuard filter problem fixed outside of Quickly I can no longer find any filters what would have (I did the same myself with one detection of incompatible filter - for me it was enough to check less characters) The one from the demo I think someone has already rewritten/removed by hand (But can be cumbersome for new cases). |
I don't think this is a "problem" of AdGuard filters only, but a more general problem, since this syntax is used in all adblockers, as far as I know. It's simply that CSSTree's tokenizer doesn't support this syntax (for obvious reasons). CSSTree is an excellent library for various purposes, I have been experimenting with it since June 2022, that's why ECSSTree was created to solve these annoying edge cases. I tested ECSSTree on the entire AG Filters Registry and the entire uAssets, so I handled several edge cases. We will use ECSSTree in a static analyzer tool, which should parse all types of adblock rules, but I think it can be used for any other purpose as long as it helps working with Extended CSS language elements. |
Due to new cosmetic filter parser, uBO requires quotes in arguments to be escapsed: gorhill/uBlock@a71b71e
An example that needs the fix is
thetimestribune.com#?##tncms-region-option-rail-top-one > .tncms-block:has(> .block-title:contains(This Week's Circulars))
in Base filter.The text was updated successfully, but these errors were encountered: