permissions.getAll()

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

This is an asynchronous function that returns a Promise.

Syntax

js
let 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 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().

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
getAll

Legend

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

Full support
Full support

Examples

js
// Extension permissions are:
// "webRequest", "tabs", "*://*.mozilla.org/*"

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

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

Example extensions

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