Feature-Policy: document-domain

Feature-Policy: document-domain

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The HTTP Feature-Policy header document-domain directive controls whether the current document is allowed to set document.domain. When this policy is disabled, attempting to set document.domain will fail and cause a SecurityError DOMException to be thrown.

Syntax

Feature-Policy: document-domain <allowlist>;
<allowlist>

A list of origins for which the feature is allowed. See Feature-Policy.

Default policy

Default allow list for document-domain is *.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
document-domain
77
79
65
No
64
No
No
No
65
No
No
No

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy/document-domain