Implement the `scripting` media feature from Media Queries Level 5
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
People
(Reporter: mozilla, Assigned: canadahonk, Mentored)
References
(Blocks 1 open bug, )
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Reporter | ||
Updated•9 years ago
|
Reporter | ||
Updated•9 years ago
|
Reporter | ||
Updated•9 years ago
|
Updated•8 years ago
|
Updated•8 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
I think this is already implemented, but no statement has been given about its status.
According to the WHATWG spec, the @media (scripting)
at-rule controls if <noscript>
tags can appear. This is now fully supported in Firefox.
How to check:
- Copy-paste the following to the
<body>
of an HTML document:
<style>
@media not (scripting) {
.only-js {
display: none !important;
}
}
</style>
<div class="only-js">This text will disappear if JavaScript is disabled.</div>
- Disable JavaScript through the inspector.
- This media argument works if the div disappears.
Sorry, but I forgot to put my navigator.userAgent
here: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0
.
Updated•2 years ago
|
Comment 4•2 years ago
|
||
This should be reasonably straight-forward to implement.
This is what controls noscript
behavior: https://searchfox.org/mozilla-central/rev/32ca4fc265150e7d3d7aa6c6abea088768cf024b/dom/base/Document.cpp#3175-3177
We could reasonably enough just call that from the media query code or so. Media queries are implemented here.
Updated•2 years ago
|
Assignee | ||
Comment 5•2 years ago
|
||
Implemented the scripting media feature.
Not locked behind a pref as it does not do anything new or particularly
give new data which could be used for fingerprinting (see <noscript>, etc).
Also added new WPT tests (none previously). Not supported in any other browsers yet.
Test page: https://goose.icu/media-scripting
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Comment 7•2 years ago
|
||
bugherder |
Assignee | ||
Comment 8•2 years ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: New CSS media query feature now implemented and shipping on by default in 113
[Affects Firefox for Android]: Yes
[Suggested wording]: Not sure
[Links (documentation, blog post, etc)]: MDN page - https://developer.mozilla.org/en-US/docs/Web/CSS/@media/scripting
Comment 9•2 years ago
|
||
Added to the Fx113 Nightly relnotes, but right now I'm thinking that I'll probably rework this into a "here's some new CSS features we shipped" kind of roll-up note once 113 rides to Beta/Release.
Comment 10•2 years ago
|
||
The following issue can be used to track updates on MDN: https://github.com/mdn/content/issues/26150
Thank you CanadaHonk [:canadahonk] for updating the browser compat table!!
I've added an entry to the Fx113 release note.
Description
•