-
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
Create AdGuard's :matches-attr
#2329
Comments
So AdGuard forgot fix use filter without fallback: AdguardTeam/ExtendedCss#122 (broken unhide node action) His implementation works fine in add-on 3.3.2 so don't added In short I mean this is two different mechanisms. To avoid break pages in outdated uBo better copy AdGuard name if worth for only few Korean pages (WP.pl in uBo no need implementation |
What you want is a new operator which matches text on attribute name and value. It's best to add this new operator |
@gorhill Great. Thanks a lot. |
:watch-attr
like AdGuard's :matches-attr
:matches-attr
In the meantime, https://stackoverflow.com/questions/8308328/xpath-to-find-attributes-where-the-name-starts-with-a-given-value Ah, and you don't need to specify attribute in |
I can find only two instances of |
Related issue: - uBlockOrigin/uBlock-issues#2329 The supported syntax is exactly as per AdGuard's documentation: - https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#extended-css-matches-attr Though recommended, the quotes are not mandatory in uBO if the argument does not cause the parser to fail and if there are no ambiguities. Additionally, improved the code to better unquote pseudo-operator arguments, and to bring it closer to how AdGuard does it as per documentation. When using quotes, `"` and `\` should be escaped to preserve these characters in the unquoted version of the argument. Additionally, it is now possible to have `:has-text()` match the empty string by just quoting the empty string: ...##foo:has-text("")
It seems this got implemented. Great! Though as I'm testing it, it seems that if I put quotes around the attribute, it doesn't match. If I remove them, it matches. Example:
Putting this rule to the picker
Shows matches, but when I add the quotes around the attribute, matches are gone:
I'm trying to match this element: Did I understand something wrong or am I just being stupid now? What I understood is that having quotes is better so that it's AG-compatible rule as well. |
I would expect this to work the same as I will investigate. |
Related feedback: - uBlockOrigin/uBlock-issues#2329 (comment)
Ok, it will be considered invalid in next release -- currently the |
Is it all good now? Can it be closed? |
Yup. It can be closed. |
Prerequisites
I tried to reproduce the issue when...
Description
Unlike AdGuard's
:matches-attr
, uBO's:watch-attr
can only observe any changes of specific element attributes.A filter developer cannot use a regexp in uBO's
:watch-attr
in order to match a randomized attribute.Therefore, I request expansion of uBO's
:watch-attr
.Related: AdguardTeam/AdguardFilters#132468
A specific URL where the issue occurs.
https://www.clien.net/service/board/news
Steps to Reproduce
Expected behavior
Only one element is blocked correctly as AdGuard Browser Extension performs.
Actual behavior
All element having
class
attribute are blocked.uBO version
1.44.4
Browser name and version
Mozilla Firefox Developer Edition 106.0b9
Operating System and version
Ubuntu 22.04.1 LTS
The text was updated successfully, but these errors were encountered: