Skip to content
AnswerWell geo Documentation

Research · 8 min read · Answerwell

Extension Permissions, Optional Grants, Host Access, and Warnings

How browser extension manifests declare permissions, request optional access at runtime, and avoid install warnings and store policy issues.

This page summarises Chrome Extensions documentation on declaring permissions in the manifest, requesting optional permissions at runtime, and choosing less invasive options such as activeTab. It covers install-time warnings, what happens when you add new permissions in an update, and Chrome Web Store expectations for minimal access.

To use most extension APIs and features, you must declare intent in the manifest’s permission fields. Permissions limit damage if an extension is compromised, and some combinations trigger consent prompts before installation or at runtime, as described in Declare permissions and Permission warning guidelines.

Manifest permission fields: what to declare and when

Section titled “Manifest permission fields: what to declare and when”

An extension can request several categories of access, each with its own manifest key, as listed in Declare permissions:

Manifest key Role
permissions Known API permission strings; changes may trigger a warning
optional_permissions Granted at runtime instead of install time
host_permissions Match patterns for one or more hosts; may trigger a warning
optional_host_permissions Host patterns granted at runtime
content_scripts.matches Where content scripts inject; pattern changes may trigger a warning

Permissions help to limit damage if your extension is compromised by malware. Some permission warnings are displayed to users for their consent before installation or at runtime, as detailed in Permission with warnings.

Consider using optional permissions wherever the functionality of your extension permits, to provide users with informed control over access to resources and data.

— Chrome, Declare permissions

If an API requires a permission, its reference page explains how to declare it. The full list of strings and displayed warnings is in Permissions.

Declare permissions shows a typical split between required API permissions, optional features, and hosts:

{
"name": "Permissions Extension",
"permissions": [
"activeTab",
"contextMenus",
"storage"
],
"optional_permissions": [
"topSites"
],
"host_permissions": [
"https://www.developer.chrome.com/*"
],
"optional_host_permissions": [
"https://*/*",
"http://*/*"
],
"manifest_version": 3
}

Host permissions let the extension interact with URLs that match the patterns—for example fetch() from a service worker, reading sensitive tab fields, programmatic script injection, cookies, or declarativeNetRequest. Some cases do not need host permissions (for example many tabs operations with only the tabs permission, manifest-declared content scripts, or debugger). See Declare permissions — Host permissions.

Required vs optional permissions: which to choose

Section titled “Required vs optional permissions: which to choose”

Permissions API is for optional access requested after install, when the user understands why it is needed:

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.

— Chrome, permissions

In general:

  • Required permissions — needed for core functionality; one install prompt can cover them; they are always present once accepted.
  • Optional permissions — needed only for extra features; smaller attack surface; you can explain the warning when the user turns a feature on; upgrades that add optional rather than required permissions are less likely to disable the extension for existing users.

Declare permissions and warn users adds that required permissions should be limited to what the extension needs now—not “future proofed” for features you have not built yet. Optional features should use optional_permissions or optional_host_permissions.

Permissions that cannot be declared as optional

Section titled “Permissions that cannot be declared as optional”

Most permissions can be optional, but permissions — Step 2 lists exceptions (they must be required if used), including:

Permission Why it is required-only
debugger Alternate transport for remote debugging
declarativeNetRequest Network request rules API
devtools Expands DevTools
geolocation HTML5 geolocation without a page prompt
mdns browser.mdns API
proxy Manages proxy settings
tts / ttsEngine Text-to-speech APIs
wallpaper ChromeOS wallpaper API

Manifest V2 docs also list experimental as non-optional (chrome.permissions — Step 2).

Permissions API: request, check, and remove optional access

Section titled “Permissions API: request, check, and remove optional access”

Declare optional entries in optional_permissions and optional_host_permissions, using the same string format as permissions and host_permissions. To request hosts discovered only at runtime, include a broad pattern such as https://*/* in optional_host_permissions so any origin you pass in Permissions.origins matches the scheme (permissions — Step 2).

How to request optional permissions (user gesture required)

Section titled “How to request optional permissions (user gesture required)”

Call permissions.request() from a user gesture (for example a button click):

document.querySelector('#my-button').addEventListener('click', (event) => {
chrome.permissions.request({
permissions: ['tabs'],
origins: ['https://www.google.com/']
}, (granted) => {
if (granted) {
doSomething();
} else {
doSomethingElse();
}
});
});

Chrome prompts when the new permissions would show different warning messages than the user already accepted (permissions — Step 3).

How to check and drop permissions you no longer need

Section titled “How to check and drop permissions you no longer need”

Use permissions.contains() to test for a permission or origin set, and permissions.remove() when you no longer need access. After a permission is removed, calling permissions.request() usually restores it without prompting again (permissions — Step 4 and Step 5). Removal fails if you try to drop required manifest permissions.

The Permissions object uses permissions (named strings, not hosts) and origins (host permission strings) (permissions — Properties).

tabs, host permissions, and activeTab: least access for tab data

Section titled “tabs, host permissions, and activeTab: least access for tab data”

Many Tabs API methods work with no permission (create tab, reload, navigate). Three patterns matter when you need URLs, titles, or script access:

Mechanism What it grants
"tabs" Lets tabs.query() read url, pendingUrl, title, favIconUrl on any tab—not the whole namespace by itself
host_permissions Sensitive tab fields for matching tabs, plus actions such as captureVisibleTab(), scripting.executeScript(), insertCSS(), removeCSS()
"activeTab" Temporary host access for the current tab after a user invocation; no install warning

The “activeTab” permission gives an extension temporary access to the currently active tab when the user invokes the extension, for example by clicking its action. Access to the tab lasts while the user is on that page, and is revoked when the user navigates away or closes the tab.

— Chrome, Access the active tab

While activeTab is active on a tab, the extension can run scripts (with scripting), read URL/title/favicon, and temporarily intercept main-frame requests with webRequest for that origin (The “activeTab” permission). Invocations include the action, context menu, command shortcut, and omnibox suggestion (Inject scripts into the active tab).

activeTab is an alternative to broad patterns like https://*/* for many workflows and does not show an install warning (Protect user privacy — activeTab). Access is not granted on restricted pages such as chrome:// URLs (The “activeTab” permission).

For a site-specific manager, narrow host_permissions (for example https://developer.chrome.com/*) can expose title and URL only for that site instead of the global tabs permission (Manage tabs).

Chrome Web Store troubleshooting clarifies reviewer expectations: activeTab is for temporary access after invocation, not passive access to the focused tab; tabs is only for sensitive Tab fields when you lack matching host access; many tabs methods do not require tabs at all.

Permission warnings: install prompts and extension updates

Section titled “Permission warnings: install prompts and extension updates”

Warnings describe API capabilities; some labels are easy to misread. Permission warning guidelines recommends requesting only relevant permissions, using optional grants with context, and preferring activeTab where possible.

When you add a permission that triggers a new warning, the extension may be disabled until the user accepts (Permission warning guidelines — Update permissions). The same behavior is documented for manual updates in Declare permissions and warn users — Update permissions. Adding the feature as optional avoids disabling existing installs when the update ships.

Some warnings are suppressed when combined with others—for example the tabs warning may not appear if the extension also requests <all_urls> (Permission warning guidelines). Treat warning tables as best-effort; pack and install a test build to see the live dialog (Permission warning guidelines — View warnings).

Users can restrict host access (all sites, chosen sites, or on-click), which behaves similarly to activeTab when set to on-click (User controls for host permissions). Use permissions.contains() to see whether an origin is currently allowed.

Chrome Web Store: minimum permissions and justification

Section titled “Chrome Web Store: minimum permissions and justification”

Store policy treats permissions as a security and trust issue, not only a technical declaration.

Request access to the narrowest permissions necessary to implement your Product’s features or services. If more than one permission could be used to implement a feature, you must request those with the least access to data or functionality. Don’t attempt to “future proof” your Product by requesting a permission that might benefit services or features that have not yet been implemented.

— Chrome, Use of Permissions

The minimum permission FAQ states that the rule applies to required and optional permissions, that unused or broader-than-needed permissions can drive rejection (Troubleshooting), and that the Chrome Web Store dashboard privacy fields require a justification per declared permission—remove unused entries from manifest.json before submitting.

Protect user privacy and Stay secure repeat the engineering goal: fewer manifest privileges mean fewer paths for abuse and fewer scary prompts.

Common mistakes when declaring extension permissions

Section titled “Common mistakes when declaring extension permissions”
  • Requesting tabs or <all_urls> when activeTab or narrow host_permissions would satisfy the feature (Manage tabs, activeTab).
  • Shipping required permissions for optional features instead of optional_permissions and permissions.request() (Protect user privacy — Opt for optional permissions).
  • Adding new required permissions in an update and surprising users with a disabled extension (Updating permissions).
  • Declaring permissions that no code path uses— a common rejection reason (Troubleshooting).
  • Assuming declarativeNetRequestWithHostAccess removes the need for host permissions; it changes how warnings appear relative to declarativeNetRequest (chrome.declarativeNetRequest).

When migrating from Manifest V2, move match patterns from permissions to host_permissions and drop unneeded webRequest where applicable (Replace blocking web request listeners — Update permissions).

  1. Open chrome://extensions, enable Developer mode, load your unpacked extension, and read the permission list shown at install—compare it to Permissions and your manifest.

  2. Pack the extension with a fixed .pem, add a new warned permission to manifest.json, reload the package on chrome://extensions, and confirm whether Chrome disables the extension until the user agrees (Permission warning guidelines — Update your extension manually).

  3. For optional features, trigger permissions.request() from a button and confirm permissions.contains() reflects the grant; call permissions.remove() and verify behavior matches permissions — Step 5.

  4. In the Chrome Web Store developer dashboard, check that every manifest permission has an accurate justification and that none are unused.

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact wording you are asking about, and we will correct or clarify it.