MDN’s new design is in Beta! A sneak peek: https://blog.mozilla.org/opendesign/mdns-new-design-beta/

permissions.getAll()

Retrieve a permissions.Permissions object containing all the permissions currently granted to the add-on.

This is an asynchronous function that returns a Promise.

Syntax

var gettingAll = browser.permissions.getAll()

Parameters

None.

Return value

A Promise that will be fulfilled with a permissions.Permissions object containing all the permissions currently granted to the add-on. This includes all permissions the add-on has listed in the permissions key, and any permissions listed in optional_permissions that the add-on has been granted by calling permissions.request().

Browser compatibility

ChromeEdgeFirefoxFirefox for AndroidOpera
Basic supportYesNo5555Yes

Examples

// Add-on permissions are:
// "webRequest", "tabs", "*://*.mozilla.org/*"

browser.permissions.getAll().then((result) => {
  console.log(result.permissions); // [ "webRequest", "tabs" ]
  console.log(result.origins)      // [ "*://*.mozilla.org/*" ]
});

Example Add-ons

Acknowledgements

This API is based on Chromium's chrome.permissions API.

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,