// First, get the Feature Policy object
const featurePolicy = document.featurePolicy;
// Then query feature for specific
const allowed = featurePolicy.allowsFeature("camera");
if (allowed) {
console.log("FP allows camera.");
} else {
console.log("FP does not allows camera.");
}FeaturePolicy: allowsFeature() method / notebook
FeaturePolicy: allowsFeature() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.