You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(browser): run extensions on SSH and This-device pages - #47347
Browser extensions like 1Password only worked in tabs of local workspaces. A page of an SSH workspace, or a server page shown on "This device", draws in the same desktop browser but had no extension buttons, no fill menu and a greyed-out "Add to Chrome" on the Web Store. Now those pages run the desktop's extensions too.
Files
Added
Deleted
Net
Test
0
0
0
0
Prod
28
$\color{#1a7f37}{\Huge{\mathbf{+}}}$403
$\color{#cf222e}{\Huge{\mathbf{−}}}$80
$\color{#1a7f37}{\Huge{\mathbf{+}}}$323
What Changed
Before: extensions loaded only into a local browser profile's own session. SSH-routed pages and This-device pages use their own "route" session (so their traffic goes through the remote host), and nothing ever loaded extensions there. No toolbar button, no content scripts, no Web Store install.
After: each route session runs its local profile's extensions as its own instance:
An SSH page runs the extensions of the local profile it was opened with. A This-device page of the server's Default profile runs this desktop's Default profile extensions. That is the same mapping saved passwords already use (localBrowserProfileIdForSession). Pages of a server's other profiles stay without extensions.
The instance starts with the page's first tab and stops when its last page closes, the same lazy start and idle stop local profiles have. A This-device page's first load waits (bounded, 3 s) for content scripts, as a local tab's does.
The instance has its own loader id (route-<partition hash>), so its badges, grants and sync storage don't mix with the local tab's instance. Its enabled list and pins come from the local profile in browser-session-registry. Turning an extension on or off, reloading or updating it, or installing it from the Web Store on one of these pages reaches every running instance, and the setting is saved on the local profile.
The This-device toolbar now mounts the same extension buttons and ⋯ › Extensions menu as the local toolbar. SSH pages already used the local toolbar; main now answers for them.
Tabs an SSH page's extension opens (tabs.create, options pages) open in that SSH workspace, so they share the instance's session. This-device instances can't open tabs yet and say so with a clear error.
When a route partition's storage is wiped, its instance is stopped first and the state Orca keeps for it is forgotten. Extension popups and windows in a server route session get the proxied-only WebRTC fence that its pages have.
The server CLI note on extension list and extension reload now says This-device pages run the desktop's extensions, not the host's.
Why
The page already renders in the desktop's Chromium and the extension's native-messaging companion lives on the desktop, so this is the local feature reaching sessions it skipped. The fix goes in the owner (the registry and the extension loader), not in each consumer. The alternative of sharing one instance across the local and route sessions isn't possible: Electron extensions are per session, and the route session must keep its own proxy and cookies.
This-device page of a paired server, with an unpacked MV3 fixture extension that fills #user and has an action button:
Before (no button, field untouched):
After (field filled by the content script, extension button in the toolbar):
SSH page of a managed SSH workspace: the extension's chrome.tabs.create opened its page as a tab in the same SSH workspace, with its pinned button (blue icon) in the toolbar:
Testing
Real remote runtimes on macOS, hidden builds (ORCA_BACKGROUND_LAUNCH=1, mock keychain, scratch HOME). The fixture extension and both scratch specs were not committed.
This-device: a headless orca serve paired to the desktop build. Load the fixture unpacked into Default, then orca tab create on the server. On main, the guest session has no extensions, the content script doesn't run and toolbarState is null. With this branch the content script runs, the worker answers, the field is filled, toolbarState lists the action (browserProfileId: default) and the pinned button is visible.
SSH: a userland loopback sshd and a managed SSH workspace (orcad template from this branch), with the desktop tab created in that workspace. The content script and worker run and the field is filled. toolbarState and the pinned button work. chrome.tabs.create opens chrome-extension://…/popup.html as a webview in the same session, in the SSH workspace.
pnpm tc:node, pnpm tc:web, changed-file oxlint, the code-quality import-cycle lint and pnpm check:changed.
Not opened live: the action popup window. On a background launch it would still appear on screen. Its code path is unchanged and keyed by the page's session.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
No committed test: this is wiring across the session registry, loader, will-attach and the toolbar. It was proven with real SSH and This-device runs instead, per the repo's test policy.
Performance
None for local tabs: the only new step is a map lookup when a route page attaches. A remote page whose profile has extensions turned on now starts one extension instance per route session (per profile and host) while it has pages. It stops 60 s after the last one closes, the same cost as a local profile's tabs.
Risk
The riskiest part is reach. Desktop extensions now run in pages a paired server's agents can drive, so values an extension fills (a 1Password login) sit in a page those agents can read. Saved-password fill already works there. Server agents can't list, open or drive the desktop's extensions. Local profiles behave as before. The one shared hook change: the uninstall sweep now reports which extensions it turned off, and a remote page's session never edits its local profile's lists.
Mixed versions: nothing new goes over the wire. An older desktop with a newer server keeps "no extensions" on This-device pages, and the server's note then overstates. A newer desktop with an older server works, since everything happens on the desktop.
Back out with a plain revert. Per-instance saved state (route-* folders under the extension profile data) stays on disk until its route partition is wiped.
Level: Medium
AI Disclosure
Review
One review round (Codex and a Claude reviewer). Fixed:
uninstall sweep of a new remote session turning a reinstalled extension off in the local profile;
chrome.management.setEnabled from a remote page;
Disable racing an enable fan-out;
agent tab placement being ignored;
route storage wipe leaving state, or queuing the partition into retired-profile storage;
WebRTC fence for extension windows in server route sessions;
extension-page admission before the first link.
CodeRabbit (Minor), fixed: a Web Store install on a remote page now starts the local profile first so a pending removal can't undo the enable; the server note is qualified for older desktops. Declined: holding marker-attached first loads (pre-existing for local tabs too, separate PR).
Release-blocker scan (P1), fixed: a side-panel extension with openPanelOnActionClick made the toolbar button do nothing on SSH and This-device pages. Those pages now have no side-panel workspace, so the click falls back to the extension's popup or action.onClicked (verified on a This-device page with a fixture: onClicked fired).
Follow-ups, not in this PR: extension side panels on SSH and This-device pages (the dock and attach are keyed to local profiles), and tabs.create from This-device pages (needs a server-side page for chrome-extension:// URLs).
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Security: same reach as saved-password fill on This-device pages; WebRTC fenced on new extension windows.
Cross-platform: no platform branches.
SSH: covered by this PR.
Mobile: unaffected; streamed pages unchanged.
Folder workspaces: not git-specific.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
The change adds route-specific extension profiles linked to local source profiles. Route and SSH sessions can resolve to those profiles for extension attachment, loading, reloading, and management. Profile cleanup uses a shared data-forgetting function. Toolbar state distinguishes the extension profile from the browser profile, and client-hosted pages render extension controls when state is available.
Severity of issue fixed: Medium
Merge Risk: Minimal · up to b4a42
This change runs desktop-installed extensions on SSH and This-device pages. No unresolved defects were found, and earlier review threads were addressed. The author's live testing used uncommitted fixtures, so there is no committed regression coverage, but no concrete merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(browser): run extensions on SSH and This-device pages" names the main change: desktop browser extensions now run in SSH-routed and This-device pages. It is specific, concise, and match…
Linked Issues check
Issue #35178 is the only active directly linked issue, so its coding requirements apply. Requirements: (1) installed extensions load on client-hosted (This-device) pages of remote-server worktrees; (2…
Out of Scope Changes check
Changed areas support the route-session extension feature or the controls it requires. Route-profile linking, loader, registry, toolbar, pins, enabled-state, and Web Store install changes implement th…
Description check
The description follows the template well. It has an ELI5, a detailed What Changed section, a Why section with alternatives considered, a linked issue (Fixes #35178), visual proof before and after, de…
Full details: Title check
Explanation
The title "feat(browser): run extensions on SSH and This-device pages" names the main change: desktop browser extensions now run in SSH-routed and This-device pages. It is specific, concise, and matches the changeset and linked issue #35178 objectives. It is a conventional-commit style title with a scope, which is acceptable.
Full details: Linked Issues check
Explanation
Issue #35178 is the only active directly linked issue, so its coding requirements apply. Requirements: (1) installed extensions load on client-hosted (This-device) pages of remote-server worktrees; (2) toolbar buttons and in-page fill work there; (3) Chrome Web Store install works there, with no disabled 'Add to Chrome'; (4) an explanatory note is optional. Evidence from the whole-PR summary (merge base cb9039f to head b4a42bb): [#35178] browser-extension-route-profiles.ts and browser-extension-route-sessions.ts start a per-route-session extension instance (loader id route-<partition hash>) linked to the local profile. [#35178] browser-session-registry.ts resolves enabled and pinned lists through the source profile. [#35178] client-hosted-browser-page-toolbar.tsx mounts BrowserExtensionToolbar and the overflow Extensions submenu. [#35178] browser-extension-webstore-install.ts and the webstore service route Web Store installs to the source profile and running route instances. [#35178] clientHostedPagesSettingsNote now documents the behavior. The PR reports a live This-device run in which a fixture content script filled a field and toolbarState listed the action. No concrete unmet coding requirement was found. Limits: streamed pages stay out of scope (allowed by the issue); This-device tabs.create is a stated follow-up, not an issue requirement. No committed automated test covers the new behavior; the issue does not request one. Uncertainty: the verdict rests on the whole-PR summary and the PR's reported live runs. Source files were not read in this review, and the prior assessment cited a different merge base.
Full details: Out of Scope Changes check
Explanation
Changed areas support the route-session extension feature or the controls it requires. Route-profile linking, loader, registry, toolbar, pins, enabled-state, and Web Store install changes implement the requested behavior for [#35178]. The uninstall-sweep change (browser-extension-session-services.ts, browser-extension-session-loader.ts) and route-profile retirement on partition wipe (browser-route-partition-storage-dependencies.ts) prevent state from leaking between the local profile and route instances. The WebRTC fence (browser-extension-route-sessions.ts) and webview admission change (main-window-webview-security.ts) are security controls for the new page reach. Tab placement (browser-extension-tab-target.ts) supports tabs.create in route instances. The side-panel guard (browser-extension-side-panel-open.ts) keeps side panels from attaching to route pages. SSH-page support goes beyond the wording of [#35178], but it uses the same route-session mechanism and cannot be separated from it, so it is related, not unrelated. Comment-only and documentation changes describe the new behavior. No demonstrated unrelated change was found. Uncertainty: source files were not read; the assessment uses the whole-PR summary.
Full details: Description check
Explanation
The description follows the template well. It has an ELI5, a detailed What Changed section, a Why section with alternatives considered, a linked issue (Fixes #35178), visual proof before and after, detailed testing steps across platforms and SSH, a Performance line, a Risk section with level and back-out plan, and checklist items. The AI Disclosure section is empty, which the template only requires for non-StablyAI contributors, so it is not a gap for this author. The Review and Notes sections are filled in. Minor gaps: the automated-test checkbox is ticked but no tests were committed, and the author explains why. The lint/typecheck/test/build checklist item is unchecked, and the author does not say whether those passed locally, only that CI will cover them.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
…pages
SSH-routed pages and This-device pages of a server's Default profile render in this
desktop's Chromium but in their own route session, which never loaded extensions. Each
such session now runs its local profile's extensions as its own instance: content
scripts, toolbar buttons and popups, Web Store installs and, on SSH pages, tabs the
extension opens. Enablement and pins stay the local profile's.
A reinstall still loads on a remote page and never turns off in its local profile;
chrome.management and Web Store enables save before starting remote instances so a
Disable meanwhile wins; agent tab placement is kept; a wiped route partition always
forgets its instance's saved state without reopening the session; extension windows
in a server route session get the proxied-only WebRTC fence.
… back to their popup or onClicked
The side panel dock shows only local profiles' panels, so a toolbar click that would
open one on a remote page did nothing. Those pages now have no side panel workspace,
which leaves the click to the extension's popup or action.onClicked.
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
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.
ELI5
Browser extensions like 1Password only worked in tabs of local workspaces. A page of an SSH workspace, or a server page shown on "This device", draws in the same desktop browser but had no extension buttons, no fill menu and a greyed-out "Add to Chrome" on the Web Store. Now those pages run the desktop's extensions too.
What Changed
Before: extensions loaded only into a local browser profile's own session. SSH-routed pages and This-device pages use their own "route" session (so their traffic goes through the remote host), and nothing ever loaded extensions there. No toolbar button, no content scripts, no Web Store install.
After: each route session runs its local profile's extensions as its own instance:
localBrowserProfileIdForSession). Pages of a server's other profiles stay without extensions.route-<partition hash>), so its badges, grants and sync storage don't mix with the local tab's instance. Its enabled list and pins come from the local profile inbrowser-session-registry. Turning an extension on or off, reloading or updating it, or installing it from the Web Store on one of these pages reaches every running instance, and the setting is saved on the local profile.tabs.create, options pages) open in that SSH workspace, so they share the instance's session. This-device instances can't open tabs yet and say so with a clear error.extension listandextension reloadnow says This-device pages run the desktop's extensions, not the host's.Why
The page already renders in the desktop's Chromium and the extension's native-messaging companion lives on the desktop, so this is the local feature reaching sessions it skipped. The fix goes in the owner (the registry and the extension loader), not in each consumer. The alternative of sharing one instance across the local and route sessions isn't possible: Electron extensions are per session, and the route session must keep its own proxy and cookies.
Linked Issue
Fixes #35178
Visual Proof
This-device page of a paired server, with an unpacked MV3 fixture extension that fills
#userand has an action button:Before (no button, field untouched):

After (field filled by the content script, extension button in the toolbar):

SSH page of a managed SSH workspace: the extension's

chrome.tabs.createopened its page as a tab in the same SSH workspace, with its pinned button (blue icon) in the toolbar:Testing
Real remote runtimes on macOS, hidden builds (
ORCA_BACKGROUND_LAUNCH=1, mock keychain, scratch HOME). The fixture extension and both scratch specs were not committed.This-device: a headless
orca servepaired to the desktop build. Load the fixture unpacked into Default, thenorca tab createon the server. On main, the guest session has no extensions, the content script doesn't run andtoolbarStateis null. With this branch the content script runs, the worker answers, the field is filled,toolbarStatelists the action (browserProfileId: default) and the pinned button is visible.SSH: a userland loopback sshd and a managed SSH workspace (orcad template from this branch), with the desktop tab created in that workspace. The content script and worker run and the field is filled.
toolbarStateand the pinned button work.chrome.tabs.createopenschrome-extension://…/popup.htmlas a webview in the same session, in the SSH workspace.pnpm tc:node,pnpm tc:web, changed-file oxlint, the code-quality import-cycle lint andpnpm check:changed.Not opened live: the action popup window. On a background launch it would still appear on screen. Its code path is unchanged and keyed by the page's session.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
No committed test: this is wiring across the session registry, loader, will-attach and the toolbar. It was proven with real SSH and This-device runs instead, per the repo's test policy.
Performance
None for local tabs: the only new step is a map lookup when a route page attaches. A remote page whose profile has extensions turned on now starts one extension instance per route session (per profile and host) while it has pages. It stops 60 s after the last one closes, the same cost as a local profile's tabs.
Risk
The riskiest part is reach. Desktop extensions now run in pages a paired server's agents can drive, so values an extension fills (a 1Password login) sit in a page those agents can read. Saved-password fill already works there. Server agents can't list, open or drive the desktop's extensions. Local profiles behave as before. The one shared hook change: the uninstall sweep now reports which extensions it turned off, and a remote page's session never edits its local profile's lists.
Mixed versions: nothing new goes over the wire. An older desktop with a newer server keeps "no extensions" on This-device pages, and the server's note then overstates. A newer desktop with an older server works, since everything happens on the desktop.
Back out with a plain revert. Per-instance saved state (
route-*folders under the extension profile data) stays on disk until its route partition is wiped.Level: Medium
AI Disclosure
Review
One review round (Codex and a Claude reviewer). Fixed:
chrome.management.setEnabledfrom a remote page;CodeRabbit (Minor), fixed: a Web Store install on a remote page now starts the local profile first so a pending removal can't undo the enable; the server note is qualified for older desktops. Declined: holding marker-attached first loads (pre-existing for local tabs too, separate PR).
Release-blocker scan (P1), fixed: a side-panel extension with
openPanelOnActionClickmade the toolbar button do nothing on SSH and This-device pages. Those pages now have no side-panel workspace, so the click falls back to the extension's popup oraction.onClicked(verified on a This-device page with a fixture:onClickedfired).Follow-ups, not in this PR: extension side panels on SSH and This-device pages (the dock and attach are keyed to local profiles), and
tabs.createfrom This-device pages (needs a server-side page forchrome-extension://URLs).Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)