-
Notifications
You must be signed in to change notification settings - Fork 9
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
Implement new pseudo-class ':others()' #164
Comments
Sounds as if it should be handled via rules conversion isn't it?
|
I might be missing something, but As I recall, |
AFAIK uBO doesn't do |
I assumed it does from the issue text:
|
I'm sure he meant "hide".
|
Ah, then it's even easier, |
#164 (comment) / #164 (comment): <body> <!-- A simple ":not" should not hide me -->
<p> uneeded text </p> <!-- it should be hidden due bla-bla-car:others() -->
<div> <!-- A simple ":not" should not hide me -->
<bla-bla-car>
don't hide my parent "div" and "grandparent" body!
<p> text </p> <!-- A simple ":not" should not hide me -->
<div> <!-- A simple ":not" should not hide me -->
<button type="button"> click </button> <!-- A simple ":not" should not hide me -->
</div>
</bla-bla-car>
<p> uneeded text </p> <!-- it should be hidden due bla-bla-car:others() -->
</div>
<p> uneeded text </p> <!-- it should be hidden due bla-bla-car:others() -->
</body>
As for me, rewriting to pure CSS would require |
Ah, now it makes perfect sense to me, thank you! |
Then I guess it can be rewritten this way, right?
edit: ah, nope, it cannot, won't cover the elements inside |
For only showing
|
not yet sir |
Any progress update on this ?🙃 |
@BlazeFTL it hasn't been yet planned to be implemented soon |
With CSS4 should run at page: body :not(.TimelineItem, .TimelineItem *, :has(.TimelineItem)) { display: none !important }
/* First protect element, second child, last one 'root'. */
body :not([data-testid="primaryColumn"], [data-testid="primaryColumn"] *, :has([data-testid="primaryColumn"])) { display: none !important } Gaps gone, looks works based on ExtCSS library. It remains to be assessed whether it is worth replacing comma elements to three " In native CSS3 this seems to be the closest:
body :not(.TimelineItem, .TimelineItem *, [data-testid="primaryColumn"], [data-testid="primaryColumn"] *) {
visibility: hidden !important;
/* at own risk in huge DOM tree:
padding: 0 !important;
margin: 0 !important;
height: 0 !important */
}
:root [data-testid="primaryColumn"],
:root .TimelineItem { visibility: visible !important } with little chance of hiding gaps left by invisible elements. RraaLL idea is not CSS "selector" (that is procedural selector - works in legacy browsers or with outdated uBo 1.45+ to 1.54 in modern browsers) so do not works in Chrome 105-109 and Firefox 115 as raw CSS (latter I can check in Safari 17.2, Firefox Nightly and Chrome Canary). Hiding on Chrome 1*-87, Firefox 1*-83, Safari 1*-8 may need (legacy browsers - mostly CSS 2.1)::root { visibility: hidden !important }
:root [data-testid="primaryColumn"],
:root .TimelineItem { visibility: visible !important } (With harder implementation hide gaps). |
@iSmokeMid69 commented on Thu Feb 09 2023
Issue Details
Ublock Has :others() Operator..Which Keep Only A Selected Element Of A Page And Remove Everything Else..This Is Very Useful For Link Shortener Sites
Details -
subject:others()
Experimental.
Introduced in uBO 1.41.1b2
For any element feeding into others(), the resultset of the others() operator will include everything else except:
The resultset will contains the siblings of a subject element except when those siblings are either a descendant or ancestor of another subject element.
Though this operator is unlikely to be used in default lists, it opens the door to create specialized filter lists which purpose is some sort of "reader mode", where everything else than a selected set of elements are hidden from view.
Related discussion:
Proposed solution
No response
Alternative solution
No response
The text was updated successfully, but these errors were encountered: