files/en-us/web/http/reference/headers/content-security-policy/sandbox/index.md
The HTTP {{HTTPHeader("Content-Security-Policy")}} (CSP) sandbox directive enables a sandbox for the requested resource similar to the {{HTMLElement("iframe")}} sandbox 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.
Content-Security-Policy: sandbox;
Content-Security-Policy: sandbox <value>;
where <value> can optionally be one of the following values:
allow-downloads
allow-forms
allow-modals
allow-orientation-lock
allow-pointer-lock
allow-popups
target="_blank").
If this keyword is not used, popup display will silently fail.allow-popups-to-escape-sandbox
allow-presentation
allow-same-origin
localstorage and document.cookie and some JavaScript APIs.
The {{httpheader("Origin")}} of sandboxed resources without the allow-same-origin keyword is null.allow-scripts
allow-storage-access-by-user-activation {{experimental_inline}}
allow-top-navigation
_top).allow-top-navigation-by-user-activation
allow-top-navigation-to-custom-protocols
http protocols built into browser or registered by a website. This feature is also activated by allow-popups or allow-top-navigation keyword.[!NOTE] The
allow-top-navigationand related values only make sense for embedded documents (such as child iframes). For standalone documents, these values have no effect, as the top-level browsing context is the document itself.
Content-Security-Policy: sandbox allow-scripts;
{{Specifications}}
{{Compat}}
sandbox attribute on {{HTMLElement("iframe")}}
elements