Security & Privacy
sandbox="allow-orientation-lock"
Allows the frame to request screen orientation locking where the API is supported. Other requirements, including fullscreen or device policy, may still prevent the operation. A space-separated token list on iframe. An empty sandbox imposes the full sandbox restrictions; each token removes a particular restriction, not all restrictions. This inert srcdoc demonstrates syntax only, not the granted capability.
Formal Syntax & Structure
html syntaxhtml
sandbox="allow-orientation-lock"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| sandbox | space-separated token list | Allows the frame to request screen orientation locking where the API is supported. Other requirements, including fullscreen or device policy, may still prevent the operation. |
Working Example
Example Snippethtml
<iframe title="Isolated example" sandbox="allow-orientation-lock" srcdoc="<p>Embedded content</p>"></iframe>Browser Compatibility
Minimum supported versions across modern rendering engines
Chrome
68
Yes
Firefox
≤49
Yes
Safari
Not supported in checked snapshot
No
Checked desktop BCD snapshot: iframe sandbox token allow-orientation-lock. Versions denote the recorded start of support (≤ means at least that early), not a guarantee of all behavior. Unresolved mirror and preview rows omitted. Token support does not guarantee permission to perform the action in every context.
HTML Living Standard