sandbox directive enables a sandbox for the requested
resource similar to the
attribute. It applies restrictions to a page's actions including preventing popups,
preventing the execution of plugins and scripts, and enforcing a same-origin policy.
|CSP version||1.1 / 2|
|Directive type||Document directive|
This directive is not supported in the
Content-Security-Policy: sandbox; Content-Security-Policy: sandbox <value>;
<value> can optionally be one of the following values:
Allows downloading files through an
<area>element with the download attribute, as well as through the navigation that leads to a download of a file. This works regardless of whether the user clicked on the link, or JS code initiated it without user interaction.
Allows for downloads to occur without a gesture from the user.
Allows the page to submit forms. If this keyword is not used, form will be displayed as normal, but submitting it will not trigger input validation, sending data to a web server or closing a dialog.
Allows the page to open modal windows by
Window.prompt(), while opening a
<dialog>is allowed regardless of this keyword. It also allows the page to receive
Lets the resource lock the screen orientation.
Allows the page to use the Pointer Lock API.
Allows popups (like from
Window.showModalDialog()). If this keyword is not used, that functionality will silently fail.
Allows a sandboxed document to open new windows without forcing the sandboxing flags upon them. This will allow, for example, a third-party advertisement to be safely sandboxed without forcing the same restrictions upon the page the ad links to.
Allows embedders to have control over whether an iframe can start a presentation session.
Allows the page to run scripts (but not create pop-up windows). If this keyword is not used, this operation is not allowed.
Lets the resource request access to the parent's storage capabilities with the Storage Access API.
Lets the resource navigate the top-level browsing context (the one named
Lets the resource navigate the top-level browsing context, but only if initiated by a user gesture.
Allows navigations to non-
httpprotocols built into browser or registered by a website. This feature is also activated by
Content-Security-Policy: sandbox allow-scripts;
|Content Security Policy Level 3 |
BCD tables only load in the browser