optional_permissions

Type Array
Mandatory No
Example

"optional_permissions": [
  "*://developer.mozilla.org/*",
  "webRequest"
]

Use the optional_permissions key to list permissions which you want to ask for at runtime, after your extension has been installed.

While the permissions key lists permissions which your extension needs if it is to be installed at all, optional_permissions lists permissions which your extension doesn't need at install time, but which it might need to ask for at runtime at some point after it has been installed. To ask for a permission, use the permissions API. Asking for a permission will probably present the user with a dialog asking them to grant the permission to your extension.

The key can contain two kinds of permissions: host permissions and API permissions.

Host permissions

These are the same as the host permissions you can specify in the permissions key.

API permissions

You can include any of the following here, but not in all browsers: check the compatibility table for browser-specific details:

  • activeTab
  • background
  • bookmarks
  • browserSettings
  • clipboardRead
  • clipboardWrite
  • contentSettings
  • contextMenus
  • cookies
  • debugger
  • downloads
  • downloads.open
  • find
  • geolocation
  • history
  • idle
  • management
  • notifications
  • pageCapture
  • tabHide
  • tabs
  • topSites
  • webNavigation
  • webRequest
  • webRequestBlocking

Note that this is a subset of the API permissions allowed in permissions.

Of this set, the following permissions are granted silently, without a user prompt: activeTab, cookies, idle, webRequest, webRequestBlocking.

Example

 "optional_permissions": ["*://developer.mozilla.org/*"]

Enable the extension to ask for privileged access to pages under developer.mozilla.org.

  "optional_permissions": ["tabs"]

Enable the extension to ask for access to the privileged pieces of the tabs API.

  "optional_permissions": ["*://developer.mozilla.org/*", "tabs"]

Enable the extension to ask for both of the above permissions.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxOperaFirefox for Android
Basic supportChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android Full support 55
activeTabChrome No support NoEdge No support NoFirefox Full support 55Opera No support NoFirefox Android Full support 55
backgroundChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
bookmarksChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android No support No
browserSettingsChrome No support NoEdge No support NoFirefox Full support 57Opera No support NoFirefox Android Full support 57
clipboardReadChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android Full support 55
clipboardWriteChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android Full support 55
contentSettingsChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
contextMenusChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
cookiesChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android Full support 55
debuggerChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
downloadsChrome No support NoEdge No support NoFirefox Full support 60Opera No support NoFirefox Android Full support 60
downloads.openChrome No support NoEdge No support NoFirefox Full support 60Opera No support NoFirefox Android Full support 60
findChrome No support NoEdge No support NoFirefox Full support 57Opera No support NoFirefox Android No support No
geolocationChrome No support NoEdge No support NoFirefox Full support 55Opera No support NoFirefox Android Full support 55
historyChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android No support No
idleChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android Full support 55
managementChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
notificationsChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android Full support 55
pageCaptureChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
tabHideChrome No support NoEdge No support NoFirefox Full support 61Opera No support NoFirefox Android No support No
tabsChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android Full support 55
topSitesChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android Full support 55
webNavigationChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android Full support 55
webRequestChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android Full support 55
webRequestBlockingChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android Full support 55

Legend

Full support  
Full support
No support  
No support

Document Tags and Contributors

Contributors to this page: glacambre, wbamberg, aswan, stoically, andrewtruongmoz
Last updated by: glacambre,