Repository navigation
Add an extension messaging transport and a chrome-mv3 New Tab Page build - #3256
Merged
Merged
Conversation
4 of 12 tasks
Contributor
[Beta] Generated file diffTime updated: Thu, 26 Nov 2026 21:10:12 GMT Android
File has changed Apple
File has changed Chrome-mv3File has changed FirefoxFile has changed Integration
File has changed Windows
File has changed New Files
❌ File only exists in new changeset |
Adds ExtensionMessagingConfig and ExtensionMessagingTransport for extension pages. Notifications and requests go to the extension's background service worker over a chrome.runtime.Port, which answers requests on the same port. Subscription events arrive as runtime.onMessage events, so the background can push without holding a port open. The port closes whenever the service worker stops, and the next message reconnects. Messages are sent once: a request whose port closes before the reply is rejected, not re-sent. A reply with a falsy result resolves; only an error rejects. Special pages built for chrome-mv3 use it over the `specialPages` port. The New Tab Page gets a chrome-mv3 build target, and a color-scheme meta tag so its first paint follows the browser's light or dark theme. Asana: https://app.asana.com/0/0/1220753232884750/f/ Co-Authored-By: Shane Osbourne <shane.osbourne8@gmail.com>
BogdanLykhosherstov
force-pushed
the
bogdan/extension-messaging-transport
branch
from
November 26, 2026 20:50
0f91a12 to
1f3ac66
Compare
Contributor
Build Branch
Static preview entry points
QR codes (mobile preview)
Integration commandsnpm (Android / Extension): Swift Package Manager (Apple): .package(url: "https://github.com/duckduckgo/content-scope-scripts.git", branch: "pr-releases/bogdan/extension-messaging-transport")git submodule (Windows): git -C submodules/content-scope-scripts fetch origin pr-releases/bogdan/extension-messaging-transport
git -C submodules/content-scope-scripts checkout origin/pr-releases/bogdan/extension-messaging-transportPin to exact commitnpm (Android / Extension): Swift Package Manager (Apple): .package(url: "https://github.com/duckduckgo/content-scope-scripts.git", revision: "e6d65383e3be92f4bfed7e097f887da2e1ce7165")git submodule (Windows): git -C submodules/content-scope-scripts fetch origin pr-releases/bogdan/extension-messaging-transport
git -C submodules/content-scope-scripts checkout e6d65383e3be92f4bfed7e097f887da2e1ce7165 |
BogdanLykhosherstov
marked this pull request as ready for review
November 26, 2026 21:07
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
shakyShane
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Asana Task/Github Issue: https://app.asana.com/0/0/1220753232884750/f/
Description
Adds a messaging transport for extension pages,
ExtensionMessagingConfig/ExtensionMessagingTransportinmessaging/lib/extension.js, and achrome-mv3build of the New Tab Page that uses it. The embedded extension serves this build as its new tab page, replacing a shim that emulated the Windows transport (duckduckgo/duckduckgo-privacy-extension#3825).chrome.runtime.Port(here namedspecialPages) to the extension's background service worker, which answers requests on the same port.runtime.onMessageevents, so the background pushes without holding a port open.result(null,false,0, none) resolves; only anerrorrejects.new-tab/public/index.htmlgains<meta name="color-scheme" content="light dark">. This is shared by every platform's New Tab Page.Split out of #3219 (messaging transport and the New Tab Page target only).
Known limitation: if the service worker stops while a request is outstanding, that request is rejected. A New Tab Page whose
initialSetupis lost this way stays blank until it is reloaded.Testing Steps
npm run test-unit -w injected: theExtensionblock ininjected/unit-test/messaging.jscovers notify, request (reply matched by id, feature and context; falsy results; error reply; abort; disconnect), subscribe and reconnecting.npm run buildand checkbuild/chrome-mv3/pages/new-tabexists.chromium-embedded, side-load it into DDG-Chromium and open a new tab (steps in that PR).Checklist
Please tick all that apply: