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
Specification |
---|
HTML Standard # document-domain-feature |
Browser compatibility
BCD tables only load in the browser