This repository was archived by the owner on Mar 17, 2025. It is now read-only.
Add procedural cosmetic operators remove() and upward()#252
Merged
JustOff merged 3 commits intogorhill:masterfrom Jul 24, 2020
Merged
Add procedural cosmetic operators remove() and upward()#252JustOff merged 3 commits intogorhill:masterfrom
JustOff merged 3 commits intogorhill:masterfrom
Conversation
Collaborator
|
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>
fbb2f51 to
440917e
Compare
Contributor
Author
|
@JustOff Done |
Collaborator
|
Thanks, I started using this in my main browser and if nothing unexpected happens I'm going to initiate a release early next week. |
Collaborator
|
It seems that changes to cosmetic-logger.js are not working as expected. I guess we can just exclude them, right? |
Contributor
Author
|
Oops, seems that change was related with gorhill/uBlock@3573b6b#diff-fe57879eb27e2bdc0b78a77743617201. Anyway, should be fixed with latest commit. |
Collaborator
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #233 and fixes #224. Code is almost original, only changed const to let in for of loop.