Skip to content

feat(browser): run extensions on SSH and This-device pages - #47347

Merged
AmoabaKelvin merged 5 commits into
mainfrom
fix/browser-extensions-route-sessions
Nov 23, 2026
Merged

AmoabaKelvin merged 5 commits into
mainfrom
fix/browser-extensions-route-sessions

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

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.

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.

Linked Issue

Fixes #35178

Visual Proof

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):
this-device-before.png

After (field filled by the content script, extension button in the toolbar):
this-device-after.png

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:
ssh-after-tab.png

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)

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

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.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed 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 Passed 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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e8be1332-ffa3-4652-8089-159668862e87
Commits

Reviewing files that changed from the base of the PR and between 073b911 and b4a42bb.

Files selected for processing: 2

  • src/main/browser/extensions/side-panel/browser-extension-side-panel-open.ts
  • src/main/browser/sessions/profiles/browser-session-registry.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73bbe986-173b-4eea-888a-e56919c9a4ff
Commits

Reviewing files that changed from the base of the PR and between cd8a94d and e6f51d1.

Files selected for processing: 27

  • src/main/browser/extensions/actions/browser-extension-toolbar-pins.ts
  • src/main/browser/extensions/actions/browser-extension-toolbar.ts
  • src/main/browser/extensions/api-runtime/browser-extension-namespace-registry.ts
  • src/main/browser/extensions/browser-extension-management.ts
  • src/main/browser/extensions/browser-extension-startup.ts
  • src/main/browser/extensions/installation/browser-extension-webstore-install.ts
  • src/main/browser/extensions/permissions/browser-extension-permission-prompt.ts
  • src/main/browser/extensions/profile-sessions/browser-extension-page-start.ts
  • src/main/browser/extensions/profile-sessions/browser-extension-profile-reload.ts
  • src/main/browser/extensions/profile-sessions/browser-extension-route-profiles.ts
  • src/main/browser/extensions/profile-sessions/browser-extension-route-sessions.ts
  • src/main/browser/extensions/profile-sessions/browser-extension-session-loader.ts
  • src/main/browser/extensions/profile-sessions/browser-extension-session-services.ts
  • src/main/browser/extensions/profile-storage/browser-extension-profile-data-forget.ts
  • src/main/browser/extensions/tabs-and-windows/browser-extension-tab-model.ts
  • src/main/browser/extensions/tabs-and-windows/browser-extension-tab-target.ts
  • src/main/browser/extensions/web-store/browser-extension-webstore-bridge-host.ts
  • src/main/browser/extensions/web-store/browser-extension-webstore-service.ts
  • src/main/browser/routing/guest-authority/browser-route-guest-initialization.ts
  • src/main/browser/routing/partitions/browser-route-partition-storage-dependencies.ts
  • src/main/browser/sessions/profiles/browser-session-registry.ts
  • src/main/runtime/browser/client-pages/client-hosted-pages-settings-note.ts
  • src/main/window/security/main-window-webview-security.ts
  • src/renderer/src/components/browser-pane/assemble-chrome/client-hosted/client-hosted-browser-page-toolbar.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/extensions/browser-extension-toolbar.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/extensions/use-browser-extension-toolbar.ts
  • src/shared/browser/extensions/browser-extension-toolbar-types.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@AmoabaKelvin
AmoabaKelvin force-pushed the fix/browser-extensions-route-sessions branch from e6f51d1 to 1356402 Compare November 23, 2026 03:49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4aeffc4b-8b1d-4a34-bed0-13cf18b3fe8a
Commits

Reviewing files that changed from the base of the PR and between 1356402 and 8e75576.

Files selected for processing: 2

  • src/main/browser/extensions/installation/browser-extension-webstore-install.ts
  • src/main/runtime/browser/client-pages/client-hosted-pages-settings-note.ts
Files skipped from review as they are similar to previous changes: 1

  • src/main/runtime/browser/client-pages/client-hosted-pages-settings-note.ts

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.
…profile first

Also say on the server's extension note that only an up-to-date desktop runs its
own extensions on This-device pages.
… 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.
@AmoabaKelvin
AmoabaKelvin force-pushed the fix/browser-extensions-route-sessions branch from 073b911 to b4a42bb Compare November 23, 2026 10:23
@AmoabaKelvin
AmoabaKelvin merged commit dbe1616 into main Nov 23, 2026
59 of 60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Chrome extensions (1Password) do not reach client-hosted pages of remote-server worktrees

1 participant