Feature Policy: JavaScript API

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

Documentation

Specification

Editor's draft

Status in Chromium

Blink>FeaturePolicy


Enabled by default (tracking bug) in:

  • Chrome for desktop release 74
  • Chrome for Android release 74
  • Android WebView release 74

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • No public signals
  • No public signals
  • No public signals
  • No signals

Owners

Last updated on 2019-02-26