Extension Manifest V3 Migration, Message Passing, and Platform APIs
How to migrate extension code to Manifest V3: resolved platform gaps, promise-based APIs, runtime messaging errors, and silent Web Push.
This page summarizes Chrome Extensions documentation on Manifest V3: what migration blockers were closed on the platform, how asynchronous APIs and message passing behave today, and when silent Web Push is available. It is aimed at developers moving from Manifest V2 or debugging runtime.sendMessage() failures after a Chrome update.
Manifest V3 migration: known platform gaps and fixes
Section titled “Manifest V3 migration: known platform gaps and fixes”Manifest V3 replaces persistent background pages with extension service workers and shifts network control toward Declarative Net Request (DNR). The Known issues when migrating to Manifest V3 page tracks gaps that blocked migration; many have been addressed in recent Chrome releases.
The following capabilities were added to address common migration blockers:
Support for File handling on ChromeOS as a replacement for chrome.fileBrowserHandler (Chrome 120). User Script support: Allow registering content scripts with arbitrary code with the new userScripts API (Chrome 120). Additional strong service worker keepalives for certain operations taking longer than five minutes.
Other items on the same page matter for everyday MV3 apps: keepalives for long permissions.request(), desktopCapture.chooseDesktopMedia(), identity.launchWebAuthFlow(), and management.uninstall() (Chrome 116+); chrome.debugger keepalives (Chrome 118); higher DNR static ruleset limits (enabled rulesets 10→50, total static 50→100 in Chrome 120); offscreen documents including GEOLOCATION (Chrome 116); tabCapture from service workers and offscreen documents; and WebSocket-linked service worker lifetime extensions (Chrome 116).
When planning a migration, treat Known issues when migrating to Manifest V3 as the authoritative list of “was broken / now fixed” versus still open, rather than inferring parity from an older blog post. Broader release notes live on What’s new in Chrome extensions; use that for incremental API additions (for example DNR response header matching or storage.session quota) that are not repeated here.
userScripts and ChromeOS file handling after Chrome 120
Section titled “userScripts and ChromeOS file handling after Chrome 120”userScripts closes a common Manifest V2 pattern: registering content scripts with arbitrary code without listing every script in manifest.json. File handling on ChromeOS replaces chrome.fileBrowserHandler for apps that opened files from the OS file UI. If your extension depended on either API, confirm minimum Chrome versions in your store listing and runtime checks.
Manifest V3 API calls: promises instead of callbacks
Section titled “Manifest V3 API calls: promises instead of callbacks”In Manifest V3, many chrome.* methods return Promises. The Update your code migration page is the reference for converting call sites.
In Manifest V3, many extension API methods return promises. A Promise is a proxy or placeholder for a value returned by an asynchronous method.
For backward compatibility, many methods continue to support callbacks after promise support is added. Be aware that you cannot use both on the same function call. If you pass a callback, the function will not return a promise and if you want a promise returned do not pass a callback.
— Chrome, Update your code
Promise support for asynchronous extension APIs was completed across the surface area (see What’s new in Chrome extensions, Chrome 122 note); a few methods such as desktopCapture.chooseDesktopMedia() remain callback-only because their shapes do not map cleanly to promises.
How to tell if an API method supports promises
Section titled “How to tell if an API method supports promises”Check the method’s API reference for a Promise label, as described in Update your code. Event listeners (for example runtime.onMessage) still use callbacks; only the calling APIs move to async/await style.
Typical conversion pattern from the same page:
const newPerms = { permissions: ['topSites'] };const granted = await browser.permissions.request(newPerms);Message passing: sendMessage() errors and listener rules
Section titled “Message passing: sendMessage() errors and listener rules”Extension parts communicate with runtime.sendMessage, tabs.sendMessage, and ports. Error semantics for promise-based sendMessage() changed in Chrome 146; details are in Message passing.
From Chrome 146, if an onMessage listener throws an error (either synchronously, or asynchronously by returning a promise that rejects), the promise returned by sendMessage() in the sender will reject with the error’s message. This update is rolling out gradually, so you may find this change is not yet effective in all users’ browsers. You should make sure your extension can handle whether this change is enabled or not.
— Chrome, Message passing
Serialization failures and non-Error rejections
Section titled “Serialization failures and non-Error rejections”If a listener returns a response that cannot be serialized and does not catch the resulting TypeError, the sender’s sendMessage() promise is treated as a listener error. Rejecting with a non-Error value (for example null) yields a generic error message on the sender side; reject with new Error('…') when you need a specific message.
Multiple onMessage listeners
Section titled “Multiple onMessage listeners”Only the first listener to respond, reject, or throw affects the sender; other listeners still run, but their results are ignored. If one listener calls sendResponse('OK') before another throws, sendMessage() succeeds—a common source of flaky tests when listeners are registered in different files.
DevTools extensions exception
Section titled “DevTools extensions exception”This stricter error propagation is not enabled in extension script contexts when the extension extends DevTools with a devtools page, even when the change is enabled elsewhere (Message passing).
Optional future improvement: What’s new in Chrome extensions notes structured clone opt-in for message serialization (Chrome 148); that is separate from the Chrome 146 error-handling behavior.
Web Push: silent push in Manifest V3 extensions
Section titled “Web Push: silent push in Manifest V3 extensions”Manifest V3 extensions could use Web Push from Chrome 88 onward, but early requirements forced a user-visible notification. From Chrome 121, extensions may subscribe with userVisibleOnly: false for silent, non-user-facing pushes—useful for background command or data sync without spamming notifications. See Use Web Push.
As of Chrome 121, extensions are able to set userVisibleOnly to false. You can now send silent, non user facing push notifications to your users. In order to use this, set userVisibleOnly to false when you call pushManager.subscribe.
— Chrome, Use Web Push
let subscription = await self.registration.pushManager.subscribe({ userVisibleOnly: false, applicationServerKey});Silent push still must comply with Chrome Web Store policies and user expectations; the platform change only removes the mandatory visible notification for each push.
Service workers, offscreen documents, and long tasks
Section titled “Service workers, offscreen documents, and long tasks”Manifest V3 service workers idle out quickly compared with Manifest V2 background pages. Platform keepalives (listed in Known issues when migrating to Manifest V3) extend lifetime for specific API calls and WebSockets. For DOM APIs, audio playback, or getDisplayMedia() flows that do not fit a bare worker, offscreen documents remain the supported pattern; additional reason enums and multi-reason offscreen.createDocument() calls are documented in What’s new in Chrome extensions.
When debugging “message port closed” after back navigation, note Chrome 123+ bfcache behavior: open extension ports are closed when a page is stored in bfcache, so listeners should handle onDisconnect and reconnect (What’s new in Chrome extensions).
Common mistakes when updating Manifest V3 extensions
Section titled “Common mistakes when updating Manifest V3 extensions”| Mistake | Why it breaks | What to do |
|---|---|---|
| Mixing callback and promise on one API call | No promise returned; race with async code |
Use only promises or only callbacks per Update your code |
Assuming all listeners see sendMessage() errors |
Only the first responding listener wins | Consolidate critical logic or order listeners deliberately (Message passing) |
Rejecting with non-Error in onMessage |
Sender gets a generic rejection message | Promise.reject(new Error('reason')) |
Sending non-serializable values via sendResponse |
sendMessage() rejects with serialize error |
Send JSON-safe data only |
| Ignoring gradual Chrome 146 rollout | Production users may differ in error behavior | Handle both success paths and rejection; test on Canary and Stable |
| Requiring visible notification for every push | Blocks silent data updates pre-121 | Gate on Chrome 121+ and userVisibleOnly: false (Use Web Push) |
How to check this on your site
Section titled “How to check this on your site”-
Load the unpacked extension on
chrome://extensions, confirm Manifest V3, and note the minimum Chrome version your features require (see Known issues when migrating to Manifest V3). -
Exercise critical
chrome.*calls without callbacks; confirm each method shows Promise support in its API reference per Update your code. -
In the service worker and any content scripts, send test messages through
runtime.sendMessage()/tabs.sendMessage(); verify rejections useErrorinstances and that multiple listeners behave as documented in Message passing. -
If you use push, test
pushManager.subscribe({ userVisibleOnly: false, … })on Chrome 121+ following Use Web Push. -
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page does not match your experience or the official docs, email yimasynthetic@gmail.com with the page URL and the exact sentence you believe is wrong so it can be corrected.