← Back to release summary

Feature Policy: JavaScript API

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome 74)
Intent stage
None

Summary

A JavaScript API will be exposed for feature policy. This API contains three functions. document.featurePolicy.allowedFeatures() // What are the allowed features in this document? document.featurePolicy.allowsFeature('geolocation', <origin>?) // Is geolocation allowed in this document or origin? document.featurePolicy.getAllowlistForFeature('geolocation') // What origins are allowed to use geolocation?

Standards & signals

Docs: https://docs.google.com/a/chromium.org/document/d/1wvk3cXkblNnbkMcsKayseK-k0SMGiP9b9fQFgfpqQpc/edit?usp=sharing

View on chromestatus.com