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
[...]the value of the scripting media feature should be enabled or initial-only if scripts originating on the same domain as the document are allowed to run, and none otherwise.
Security and privacy browser extensions such NoScript, uBlock Origin or uMatrix currently use CSP directives (typically script-src and script-src-elem) to turn off JavaScript on certain sites of users' choice, and use DOM manipulation to display the content of <noscript> elements (which are not affected by CSP) and provide users with the authors' intended feedback. Of course the JavaScript-toggled CSS classes approach works out of the box.
It would be great if this new feature took in account CSP disabling script execution on the document, making explicit that the value should be none for that case. Otherwise the aforementioned tools would need to scan all the CSS rules applied to the page and manipulate them to force those matching scripting none, which would a ugly, inefficient hack.
The text was updated successfully, but these errors were encountered:
Personally I like this idea but not sure if it's something that would/should be considered under the spec itself since it's more specifically for the case of external extensions (since no site would need to check if scripting is enabled/disabled if they knew CSP would block it anyway).
Agreed that the noscript element should probably trigger when CSP shuts off scripting for the page (and that's an HTML issue, not a CSS one).
For CSS, the MQ is defined using generic language intentionally - if scripting is disabled, it should match. I do think it's ideal for us to match the noscript element, tho, and so UAs should be consistent in that regard.
fantasai
changed the title
[mediaqueries][mediaqueries-5] Account for CSP restrictions in the scripting feature
[mediaqueries-5] Account for CSP restrictions in the scripting feature
Jun 1, 2023
Regarding the @media scripting features, value
none
, the current specification reads:Security and privacy browser extensions such NoScript, uBlock Origin or uMatrix currently use CSP directives (typically
script-src
andscript-src-elem
) to turn off JavaScript on certain sites of users' choice, and use DOM manipulation to display the content of<noscript>
elements (which are not affected by CSP) and provide users with the authors' intended feedback. Of course the JavaScript-toggled CSS classes approach works out of the box.It would be great if this new feature took in account CSP disabling script execution on the document, making explicit that the value should be
none
for that case. Otherwise the aforementioned tools would need to scan all the CSS rules applied to the page and manipulate them to force those matchingscripting none
, which would a ugly, inefficient hack.The text was updated successfully, but these errors were encountered: