Permissions Declarations

Introduction

It is required to first declare which permissions you would like the browser to grant your extension. Some permissions are also displayed to users before installation. Permissions are declared in the manifest file, for example:

"permissions": [
	"tabs",
	"https://www.opera.com/",
	"http://*.example.org/",
]

Permissions declarations allowed in Opera extensions

The following is an overview of the various permissions declarations possible in extensions in Opera, and what they mean.

  • match pattern: Specifies a host permission. Required if the extension or app wants to interact with the code running on pages. Many capabilities, such as cross-origin XMLHttpRequests, programmatically injected content scripts, etc., require host permissions. For details on the syntax, see Match Patterns.
  • activeTab: The activeTab permission gives an extension temporary access to the currently active tab when the user invokes the extension – for example by clicking its browser action. Access to the tab lasts until the tab is navigated or closed. This serves as an alternative for many uses of <all_urls>, but displays no warning message during installation
  • alarms: Required if the extension or app uses the chrome.alarms API.
  • background: You typically use the background permission with a background page or event page.
  • bookmarks: Gives your extension access to the chrome.bookmarks API.
  • browsingData: Gives your extension access to the chrome.browsingData API.
  • contextMenus: Required if the extension or app uses the chrome.contextMenus API.
  • cookies: Required if the extension or app uses the chrome.cookies API.
  • downloads: Required if the extension or app uses the chrome.downloads API.
  • fontSettings: Required if the extension or app uses the chrome.fontSettings API.
  • geolocation: Allows the extension or app to use the proposed HTML5 geolocation API without prompting the user for permission.
  • history: Required if the extension or app uses the chrome.history API.
  • identity: Required if the extension or app uses the chrome.identity API.
  • idle: Required if the extension or app uses the chrome.idle API.
  • management: Required if the extension uses the chrome.management API.
  • nativeMessaging: Required if the extension wants to use native messaging.
  • pageCapture: Gives the extension access to the chrome.pageCapture API.
  • power: Required if the extension or app uses the chrome.power API.
  • printerProvider: Required if the extension or app uses the chrome.printerProvider API.
  • proxy: Required if the extension or app uses the chrome.proxy API.
  • storage: Required if the extension or app uses the chrome.storage API. Note: storage.sync is not supported.
  • tabs: Required if the extension uses the chrome.tabs or chrome.windows API.
  • webNavigation: Gives your extension access to the chrome.webNavigation API.
  • webRequest: Required if the extension uses the chrome.webRequest API.

Optional permissions

You can use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary.