Skip to content
AnswerWell geo Documentation

Research · 6 min read · Answerwell

Extension API Promise Returns and Manifest V3 Async

When browser extension APIs return Promises, how Manifest V3 and the browser namespace differ from callbacks, and how common methods resolve.

This page summarises Chrome for Developers documentation on asynchronous extension APIs: which calls return Promise values, the Manifest V3 (MV3) requirement for promise support, the browser.* namespace introduced alongside chrome.*, and what several widely used methods actually resolve or reject.

Promise returns: what extension APIs return today

Section titled “Promise returns: what extension APIs return today”

Most Chrome extension APIs that perform I/O or touch browser state now document a return type of Promise<void>, Promise<boolean>, or another promised value instead of relying only on a trailing callback. The browsingData reference is representative: each removal operation states that it returns Promise<void> and resolves when the corresponding data has been cleared—for example when websites’ IndexedDB data has been cleared, when the browser’s cache has been cleared, or when cookies and server-bound certificates have been cleared.

That pattern repeats across namespaces in this documentation set, including history, storage, identity, offscreen, and runtime. In practice, you await the call (or chain .then()) and treat resolution as “the browser finished this operation,” subject to each method’s own error rules.

Across the MV2-era reference pages in the cluster, the same constraint appears next to promise return documentation:

Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

— Chrome, alarms

The chrome.browsingData pages add the same note and tie resolution to completion of deletion (for example, “Resolves when deletion has completed”). Common conclusion: treat promise-based calling as the MV3+ path in Chrome; extensions still on Manifest V2 or targeting environments without promise support must keep using the documented callback parameter where the reference still exposes it (as with chrome.identity.clearAllCachedAuthTokens( callback? ) on the MV2 identity page).

chrome.* vs browser.*: namespaces and versions

Section titled “chrome.* vs browser.*: namespaces and versions”

Newer reference material uses the browser.* prefix and often notes a minimum Chrome version. Examples from the cluster:

Area browser.* example Version note in cluster
Browsing data browser.browsingData browser.* since Chrome 148
Extension settings browser.extension isAllowedFileSchemeAccess(), isAllowedIncognitoAccess()
Offscreen documents browser.offscreen hasDocument() Chrome 150+
Identity browser.identity clearAllCachedAuthTokens() Chrome 87+

The browser.* and chrome.* surfaces often describe the same capabilities; promise return types and resolve wording are aligned between chrome.browsingData and browser.browsingData. Prefer the namespace and URL that match your extension’s manifest generation and the table on the specific method you call.

browser.extension: permission state as Promise<boolean>

Section titled “browser.extension: permission state as Promise<boolean>”

User-controlled settings map to queryable promises on browser.extension:

Retrieves the state of the extension’s access to the ‘file://’ scheme. This corresponds to the user-controlled per-extension ‘Allow access to File URLs’ setting accessible via the chrome://extensions page.

— Chrome, extension API

A parallel method covers Incognito (“Allowed in Incognito”). Use these before assuming file:// or incognito access in content scripts or background logic.

browser.browsingData / chrome.browsingData: awaitable clearing

Section titled “browser.browsingData / chrome.browsingData: awaitable clearing”

Clearing operations are granular: App Cache, HTTP cache, CacheStorage, cookies, downloads list, file systems, form data, history, IndexedDB, localStorage, passwords, plugin data, service workers, and WebSQL each document their own Promise<void> that resolves when that slice is cleared. Plan separate awaits (or Promise.all only when the docs guarantee independence) and surface rejections to the user when a privacy wipe fails partway through.

browser.identity.clearAllCachedAuthTokens(): full auth reset

Section titled “browser.identity.clearAllCachedAuthTokens(): full auth reset”

Resets the state of the Identity API:

Removes all OAuth2 access tokens from the token cache
Removes user’s account preferences
De-authorizes the user from all auth flows

— Chrome, browser.identity

The MV2 entry documents the same behavior with an optional callback and Promise<void> from Chrome 87+. This is a hard logout-style reset, not a single-token revoke; pair it with UI that warns users they must sign in again.

browser.runtime.openOptionsPage() and setUninstallURL()

Section titled “browser.runtime.openOptionsPage() and setUninstallURL()”

openOptionsPage() returns Promise<void> and may open or focus the options UI in different hosts (tab, chrome://extensions, etc.); it will not reload the caller page. If no options page exists, expect lastError semantics as described on that page.

setUninstallURL() accepts up to 1023 characters and resolves when the uninstall URL is set; the MV2 runtime page notes the promise rejects if the URL is invalid.

closeDocument() resolves when the offscreen document has closed; hasDocument() (Chrome 150+) resolves with a boolean for whether an active offscreen document exists—useful to avoid duplicate creation in service workers.

Removes all items from storage.

— Chrome, StorageArea

The MV2 StorageArea page documents clear() as resolving on success and rejecting on failure. Related: setAccessLevel() on MV2 storage documents default trust boundaries (session storage restricted to trusted contexts; local, sync, and managed wider)—relevant if promises run from content scripts.

browser.webRequest.handlerBehaviorChanged()

Section titled “browser.webRequest.handlerBehaviorChanged()”

Needs to be called when the behavior of the webRequest handlers has changed to prevent incorrect handling due to caching. This function call is expensive. Don’t call it often.

— Chrome, webRequest

Returns Promise<void>; batch handler registration changes instead of calling this after every small edit.

Legacy Chrome Apps references (chrome.socket, chrome.bluetooth, etc.) in the cluster mostly repeat the MV3 promise note; they are not the focus of modern extension service-worker architecture and are omitted here unless you still ship a Chrome App.

  1. Using await on MV2 without promise support — confirm manifest version and the “Promises are only supported for Manifest V3 and later” note on the method’s page.
  2. Assuming all promises mean “success” — many APIs resolve with no value on failure paths documented elsewhere; some reject (debugger attach/detach, invalid uninstall URL, storage failures).
  3. Calling handlerBehaviorChanged() in a tight loop — documentation explicitly marks it expensive.
  4. Ignoring platform-specific boolean semantics — e.g. tts.isSpeaking() on macOS reflects system-wide speech.
  5. Mixing chrome.* and browser.* without checking — version gates such as browser.* since Chrome 148 and hasDocument() Chrome 150+ matter for support matrices.
Section titled “Related material outside the core promise topic”

The cluster includes Custom Tabs Engagement Signals (isEngagementSignalsApiAvailable() may change at runtime), DevTools console.createTask (Async Stack Tagging for linked stack traces), and file handling on Chrome OS (API usable in service workers, popups, side panels, content scripts). Those are separate from MV3 promise returns on extension reference APIs.

  1. Confirm the extension uses Manifest V3 in manifest.json and reload the unpacked extension on a current Chrome channel.

  2. In the service worker (or other context listed on the API page), call a documented promise method—for example await chrome.storage.local.clear() per storage—and log success or caught rejections.

  3. For user-gated features, await chrome.extension.isAllowedIncognitoAccess() or the file-URL equivalent from extension and branch before accessing those contexts.

  4. After changing webRequest listeners, call handlerBehaviorChanged() once and verify network behavior in DevTools, per webRequest.

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

If something on this page disagrees with the linked Chrome documentation, email yimasynthetic@gmail.com with the page URL and the exact sentence you believe is wrong so it can be corrected or clarified.