Feature Policy

The Feature Policy API allows you to programmatically access the currently supported features of the document.

This returns a Boolean that indicates whether a particular feature is enabled in the specified context.
RESETRUNFULL
<!DOCTYPE html><html><body><script>
if (document.featurePolicy.allowsFeature("camera"))
  document.write("FP allows camera.");
else
  document.write("FP does not allows camera.");
</script></body></html>
This returns a list of names of all features supported by the User-Agent. Feature whose name appears on the list might not be allowed by the Feature Policy of the current execution context and/or might not be accessible because of user's permissions.
RESETRUNFULL
<!DOCTYPE html><html><body><script>
for (const directive of document.featurePolicy.features()) document.write(directive+"<br/>");
</script></body></html>
This returns a list of names of all features supported by the User Agent and allowed by the Feature Policy. Note that features appearing on this list might still be behind user permission.
RESETRUNFULL
<!DOCTYPE html><html><body><script>
for (const directive of document.featurePolicy.allowedFeatures()) document.write(directive+"<br/>");
</script></body></html>
This returns the Allow list for the specified feature.
RESETRUNFULL
<!DOCTYPE html><html><body><script>
for (const origin of document.featurePolicy.getAllowlistForFeature("camera")) document.write(origin+"<br/>");
</script></body></html>