docs.rodeo

MDN Web Docs mirror

optional_host_permissions

{{AddonSidebar}} 

Type Array
Mandatory No
Manifest version 3 or higher
Example
"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 {{WebExtAPIRef("cookies")}} , {{WebExtAPIRef("webRequest")}} , and {{WebExtAPIRef("tabs")}} . This key is an array of strings.

See host_permissions for more information on defining hosts.

Use the {{webextapiref("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

 "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

{{Compat}} 

In this article

View on MDN