document.featurePolicy is a read-only property that returns a FeaturePolicy object for inspecting Permissions Policy settings on the current document (MDN).
Read the notes below before you get or set this property. Prefer feature detection when support is limited.
Syntax
Use document.featurePolicy. Start with this line.
JavaScript
document.featurePolicy
Call
What it does
document.featurePolicy
Primary signature.
Built into the browser. Read or assign document.featurePolicy — no import required.
Library declarations
JavaScript
document.featurePolicy
Parameters
Parameter
Description
Writable?
Optional. Read-only
Feature-detect
Required. "featurePolicy" in document
Return Value
Return Value
Description
*
FeaturePolicy object
JavaScript Examples
Example 1 — Feature-Detect First
Never assume the property exists.
JavaScript
if ("featurePolicy" in document) {
console.log("available");
console.log(typeof document.featurePolicy);
} else {
console.log("Not supported in this browser");
}
available
object
/* or: Not supported in this browser */
How It Works
Use in. Safe check for the property on document.
Read only when present. Avoids errors on unsupported engines.
Log type. Confirms you have an object, not a boolean.
Deprecated API. Prefer HTTP Permissions Policy for real control (MDN).
Example 2 — allowsFeature("camera")
Ask whether Permissions Policy allows the camera feature.
JavaScript
if (!("featurePolicy" in document)) {
console.log("document.featurePolicy not available");
} else {
const ok = document.featurePolicy.allowsFeature("camera");
console.log(ok ? "FP allows camera." : "FP does not allow camera.");
}
supported: 40
allowed: 35
camera allowlist: self
/* counts vary by browser */
How It Works
features(). Names the UA knows about (MDN).
allowedFeatures(). Names allowed by the current policy.
getAllowlistForFeature. Origins allowed for one feature.
Debug aid only. Prefer configuring policy on the server, not in JS.
Compatibility
Browser Support
Document.featurePolicy is marked Deprecated, Experimental, and Non-standard on MDN. Support varies — always feature-detect. Logos use the shared browser-image-sprite.png sprite from this project.
✓ Deprecated · Experimental
Document.featurePolicy
Inspector for Permissions Policy settings. Prefer the Permissions-Policy HTTP header for new work.
LimitedNon-standard
Google ChromePartial / Chromium engines
Partial
Microsoft EdgePartial / Chromium
Partial
Mozilla FirefoxLimited / may differ
Limited
Apple SafariLimited / may differ
Limited
OperaPartial / Chromium
Partial
Internet ExplorerNot supported
No
document.featurePolicyFeature-detect required
Bottom line: Learn it to read old demos. See the MDN Document.featurePolicy reference and configure policy with Permissions-Policy instead.
Frequently Asked Questions
A FeaturePolicy object used to inspect Permissions Policy settings applied to the document (MDN).
Yes. MDN marks Document.featurePolicy (and FeaturePolicy) as Deprecated. Feature Policy was superseded by Permissions Policy.
Yes. MDN marks it Experimental and Non-standard, and notes it does not appear in a formal specification. Always feature-detect.
Permissions Policy is the modern name. Configure with the Permissions-Policy HTTP header (and iframe allow). The JS inspector property is still named document.featurePolicy in some browsers.
No. It only reflects Permissions Policy allowlists. Camera and similar APIs may still need a separate user permission (for example via getUserMedia).
No for new projects. Prefer configuring policy with Permissions-Policy headers. If you inspect policy in JS, feature-detect and treat missing support as unknown — not as denied.