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
Add procedural cosmetic operators remove() and upward() #252
Conversation
|
Thank you, but could you please update the commit to include the original description from gorhill/uBlock@72bb700? Please use |
New procedural cosmetic operator: `:remove()` Related issue: - gorhill/uBlock#2252 The purpose is to outright remove elements from the DOM tree. Since `:remove()` is an "action" operator, it must only be used as a trailing operator (just like the `:style()` operator). AdGuard's cosmetic filter syntax `{ remove: true; }` will be converted to uBO's `:remove()` operator internally. *** New procedural cosmetic operator: `:upward(...)` The purpose is to lookup an ancestor element. When used with an integer argument, it is synonym of `:nth-ancestor()`, which will be deprecated and which will no longer be supported once no longer used in mainstream filter lists. Filter lists maintainers must only use `:upward(int)` instead of `:nth-ancestor(int)` once the new operator become available in all stable releases of uBO. `:upward()` can also accept a CSS selector as argument, in which case the nearest ancestor which matches the CSS selector will be selected. Co-authored-by: gorhill <585534+gorhill@users.noreply.github.com>
|
@JustOff Done |
|
Thanks, I started using this in my main browser and if nothing unexpected happens I'm going to initiate a release early next week. |
|
It seems that changes to cosmetic-logger.js are not working as expected. I guess we can just exclude them, right? |
|
Oops, seems that change was related with gorhill/uBlock@3573b6b#diff-fe57879eb27e2bdc0b78a77743617201. Anyway, should be fixed with latest commit. |
Yep, it seems it is. |
Related discussion: - gorhill/uBO-Extra#119 (comment) As an incidental side effect, this may or may not prevent execution of the content of some inline script tags. Co-authored-by: gorhill <585534+gorhill@users.noreply.github.com>
Fixes #233 and fixes #224. Code is almost original, only changed const to let in for of loop.