You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hiding tabs that have a zero (the number is often in an attribute as well, so it can be targeted)
hiding events from the newsfeed
showing our “update branch” button if the native button doesn’t exist, dynamically, without events! We append the link and just use body:has(native button) .our-button {hide} 🤯
I swear this selector is a game changer for extensions. The only thing it can’t do is alert us of such events (maybe 😏 via empty animationend on these elements + JS listener)
Please wait until Firefox has full support for has.
There are already 3 features that use has in CSS.
One of which I wanted to propose, only to found out it already exists, but just doesn't work on Firefox.
We're not going to retroactively break features, so it's ok. As mentioned, new features and bugfixes can already use the new selector. Firefox will get them whenever it becomes ready.
The features you mentioned simply would not exist without :has(), in fact one of them was years old and I implemented it as soon as the selector was available in Safari, in 15 minutes of my time. We're not going to write JS code for new features that are 3 lines of CSS, only for it to be obsolete in 3 months. I hope that makes sense.
Hmm... Firefox doesn't seem to have moved any closer on this in the last 6 months; based on the activity on the tracking issue and hide-own-stars' fix is not compatible with Firefox's experiemental implementation.
Is there a suggested workaround for Firefox users, since currently, we're getting a degraded experience (even after enabling the experimental flag)?
Unfortunately not. GitHub has also been making changes to their DOM making it increasingly difficult to target elements reliably, which means I have no choice but use has()
Apparently on hold until at least Firefox v121, December 19th. It's strange because it already passes the web interop tests 10x faster than Chrome, even.
Anyway presumably this already works well if you enable the layout.css.has-selector.enabled, so if you're here you can already enjoy the latest features. 🚀
See you in 2024 guys
Reacted by Κριστιάν3β
Reacted by Jeroen van Warmerdam and Κριστιάν3β
Reacted by Philipp Bammes, Nemo, jtagcat and yakov116
Can be closed. I cleaned up past polyfills and some TODOs. Due to performance issues, :has() cannot be used on large elements. This is quite unfortunate because of the benefits that moving logic to the CSS for extensions and userstyles would bring.
Activity
fregante commentedon Jul 27, 2022
fregante commentedon Aug 30, 2022
It is August 30th.
All new features and "restored features" can use
:has()Firefox will follow at some point. Tracking issues:
jerone commentedon Sep 6, 2022
Please wait until Firefox has full support for
has.There are already 3 features that use
hasin CSS.One of which I wanted to propose, only to found out it already exists, but just doesn't work on Firefox.
fregante commentedon Sep 6, 2022
We're not going to retroactively break features, so it's ok. As mentioned, new features and bugfixes can already use the new selector. Firefox will get them whenever it becomes ready.
The features you mentioned simply would not exist without :has(), in fact one of them was years old and I implemented it as soon as the selector was available in Safari, in 15 minutes of my time. We're not going to write JS code for new features that are 3 lines of CSS, only for it to be obsolete in 3 months. I hope that makes sense.
fregante commentedon Sep 8, 2022
Possible new selector usage:
dim-bots, except for its "expand bots" JS listenerconversation-activity-filterFloEdelmann commentedon Sep 8, 2022
@jerone By the way, you can opt-in to Firefox's preliminary implementation by enabling the
layout.css.has-selector.enabledrule inabout:config(see https://caniuse.com/css-has), which seems to work fine for these three RGH features.jtagcat commentedon Dec 4, 2022
Note:
layout.css.has-selector.enabledalso requires a restart.unhide-reactions-on-mobile(#6182) now also uses:has.pradyunsg commentedon Dec 21, 2022
Hmm... Firefox doesn't seem to have moved any closer on this in the last 6 months; based on the activity on the tracking issue and hide-own-stars' fix is not compatible with Firefox's experiemental implementation.
Is there a suggested workaround for Firefox users, since currently, we're getting a degraded experience (even after enabling the experimental flag)?
fregante commentedon Dec 22, 2022
Unfortunately not. GitHub has also been making changes to their DOM making it increasingly difficult to target elements reliably, which means I have no choice but use
has()fregante commentedon Jan 17, 2023
Which probably means 12 more months of no "has"
jtagcat commentedon Jan 18, 2023
1 remaining item
nitzcard commentedon Aug 7, 2023
fregante commentedon Sep 20, 2023
Upstream bug closed! Coming to Firefox 119 on October
202424thWe can start fixing all the TODOs (but they won't be merged until that date)
jerone commentedon Sep 20, 2023
FloEdelmann commentedon Sep 20, 2023
fregante commentedon Nov 1, 2023
New issue to track:
Apparently on hold until at least Firefox v121, December 19th. It's strange because it already passes the web interop tests 10x faster than Chrome, even.
Anyway presumably this already works well if you enable the
layout.css.has-selector.enabled, so if you're here you can already enjoy the latest features. 🚀See you in 2024 guys
marvinhagemeister commentedon Nov 6, 2023
fregante commentedon Nov 7, 2023
marvinhagemeister commentedon Nov 7, 2023
fregante commentedon Nov 7, 2023
ChaseKnowlden commentedon Dec 18, 2023
Firefox 121 is released! @fregante
https://archive.mozilla.org/pub/firefox/releases/121.0/
fregante commentedon Dec 19, 2023
We'll likely still wait a few weeks before releasing a release that breaks Firefox <120.
It turned out just about right 😃
fregante commentedon Jun 5, 2024
Can be closed. I cleaned up past polyfills and some TODOs. Due to performance issues,
:has()cannot be used on large elements. This is quite unfortunate because of the benefits that moving logic to the CSS for extensions and userstyles would bring.