optional_host_permissions

Type Array
Mandatory No
Manifest version 3 or higher
Example
json;

"optional_host_permissions": [
  "*://developer.mozilla.org/*",
  "*://*.example.org/*"
]

Use the optional_host_permissions key to enable runtime requests for access (access granted by the user after your extension has been installed) for the APIs in your extension that read or modify host data, such as cookies, webRequest, and tabs. This key is an array of strings.

See host_permissions for more information on defining hosts.

Use the permissions API to request an optional host permission at runtime. Requesting a host permission may present the user with a dialog asking whether they want to grant the permission to your extension.

Example

json
 "optional_host_permissions": ["*://developer.mozilla.org/*"]

Enables your extension to make a runtime request for privileged access to pages under developer.mozilla.org.

Browser compatibility

BCD tables only load in the browser