Retrieve a permissions.Permissions
object containing all the permissions currently granted to the extension.
This is an asynchronous function that returns a Promise
.
Retrieve a permissions.Permissions
object containing all the permissions currently granted to the extension.
This is an asynchronous function that returns a Promise
.
let gettingAll = browser.permissions.getAll()
None.
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()
.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
getAll |
Yes | 79 | 55 | ? | Yes | 14 | ? | ? | 79 | ? | 15 | ? |
// 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/*" ]
Note: This API is based on Chromium's chrome.permissions
API.
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/permissions/getAll