| Type | Array |
|---|---|
| Mandatory | No |
| Manifest version | 2 or higher |
| Example | "optional_permissions": [ "webRequest" ] |
Use the optional_permissions key to list permissions that you want to ask for at runtime, after your extension has been installed.
The permissions key lists permissions that your extension needs before it can be installed. In contrast, optional_permissions lists permissions that your extension doesn't need at install time but it may ask for after it has been installed. To ask for a permission, use the permissions API. Asking for a permission may present the user with a dialog requesting them to grant the permission to your extension.
For advice on designing your request for runtime permissions, to maximize the likelihood that users grant them, see Request permissions at runtime.
Starting with Firefox 84, users will be able to manage optional permissions from the Firefox 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.
The key can contain two kinds of permissions: host permissions and API permissions.