Security & Privacy

sandbox="allow-pointer-lock"

Allows requests to lock the pointer to an element in the frame. The Pointer Lock API still imposes its own user-interaction and browser requirements; provide an exit path. 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-pointer-lock"

Parameters & Attributes

NameTypeDescription
sandboxspace-separated token listAllows requests to lock the pointer to an element in the frame. The Pointer Lock API still imposes its own user-interaction and browser requirements; provide an exit path.

Working Example

Example Snippethtml
<iframe title="Isolated example" sandbox="allow-pointer-lock" srcdoc="&lt;p&gt;Embedded content&lt;/p&gt;"></iframe>

Browser Compatibility

Minimum supported versions across modern rendering engines

Chrome
23
Yes
Firefox
≤49
Yes
Safari
10.1
Yes
Checked desktop BCD snapshot: iframe sandbox token allow-pointer-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
HTML Reference