Firefox Tomorrow

web api interface

Permissions

View on MDN ↗

Available in workers

The Permissions interface of the Permissions API provides the core Permission API functionality, such as methods for querying and revoking permissions

Instance methods

Example

navigator.permissions.query({ name: "geolocation" }).then((result) => {
  if (result.state === "granted") {
    showLocalNewsWithGeolocation();
  } else if (result.state === "prompt") {
    showButtonToEnableLocalNews();
  }
  // Don't do anything if the permission was denied.
});

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.