Enables extensions to request extra permissions at runtime, after they have been installed.
Extensions need permissions to access more powerful WebExtension APIs. They can ask for permissions at install time, by including the permissions they need in the permissions
manifest.json key. The main advantages of asking for permissions at install time are:
In most major browsers, users can see if their installed extensions request advanced permissions through the browser's extensions manager.
With the permissions API, an extension can ask for additional permissions at runtime. These permissions need to be listed in the optional_permissions
manifest.json key. Note that some permissions are not allowed in optional_permissions
. The main advantages of this are:
To use the permissions API, decide which permissions your extension can request at runtime, and list them in optional_permissions
. After this, you can request any permissions that were included in optional_permissions
. Requests may only be made in the handler for a user action (for example, a click handler).
Starting with Firefox 84, users will be able to manage optional permissions of installed extensions from the Add-ons Manager. Extensions that use optional permissions should listen for browser.permissions.onAdded and browser.permissions.onRemoved API events to know when a user grants or revokes these permissions.
For advice on designing your request for runtime permissions, to maximize the likelihood that users grant them, see Request permissions at runtime.
Typespermissions.Permissions
Represents a set of permissions.
permissions.contains()
Discover an extension's given set of permissions.
permissions.getAll()
Get all the permissions this extension currently has.
permissions.remove()
Give up a set of permissions.
permissions.request()
Ask for a set of permissions.
permissions.onAdded
Fired when a new permission is granted.
permissions.onRemoved
Fired when a permission is removed.
manifest.json
permissions
propertymanifest.json
optional_permissions
propertyRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4