-
Notifications
You must be signed in to change notification settings - Fork 513
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
Example unable to be used for ScreenOrientation.lock #12386
Comments
I think we should find some ways to specified sandbox attribute on iframe with live examples... |
Does param $6 of the macro: https://github.com/mdn/yari/blob/main/kumascript/macros/EmbedLiveSample.ejs#L13 help here? |
No, for this case, a |
So would the change be this (in yari)? var allowedFeatures = $6;
+const sandboxAttributes = $7; Can also be -%> sandbox="allow-same-origin allow-scripts"></iframe></div><%
+%> sandbox="allow-same-origin allow-scripts<%= $7 ? ' ' + $7 : '' %>"></iframe></div><% Then param $7 can be set to allow-orientation-lock and param $6 can be used for fullscreen. |
Please note that the macros are now rendered by rari, see: https://github.com/mdn/rari/blob/03fc5598f482df7992ad81c6d25bb0a8c0f17dec/crates/rari-doc/src/templ/templs/mod.rs#L106 Nevertheless I will move this issue to yari, because we might solve this with upcoming Playground changes. |
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/lock
What specific section or headline is this issue about?
Examples
What information was incorrect, unhelpful, or incomplete?
Clicking fullscreen prints TypeError: Disallowed by permissions policy
Clicking Lock prints SecurityError: Failed to execute 'lock' on 'ScreenOrientation': The window is sandboxed and lacks the 'allow-orientation-lock' flag.
What did you expect to see?
Usable example
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
MDN metadata
Page report details
en-us/web/api/screenorientation/lock
The text was updated successfully, but these errors were encountered: