permissions.getAll()

Retrieves a permissions.Permissions object containing all the permissions currently granted to the extension.

Syntax

js
let gettingAll = browser.permissions.getAll()

Parameters

None.

Return value

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

Examples

js
// Extension permissions are:
// "webRequest", "tabs", "*://*.mozilla.org/*", and "healthInfo" in "data_collection"

const currentPermissions = await browser.permissions.getAll();

console.log(currentPermissions.permissions); // [ "webRequest", "tabs" ]
console.log(currentPermissions.origins); // [ "*://*.mozilla.org/*" ]
console.log(currentPermissions.data_collection); // [ healthInfo" ]

Example extensions

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
getAll
Chrome – Full support
Chrome 16 (Release date: 2011-12-13)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 55 (Release date: 2017-08-08)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

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