Skip to content

feat(browser): support Chrome extension side panels in the built-in browser - #42844

Merged
AmoabaKelvin merged 3 commits into
mainfrom
chrome-extensions-side-panel
Nov 17, 2026
Merged

AmoabaKelvin merged 3 commits into
mainfrom
chrome-extensions-side-panel

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Some Chrome extensions (Sider, Merlin, Claude in Chrome, Bitwarden's passkey flow, Raindrop) show their UI in a panel docked beside the web page instead of a popup. Orca's browser now has that panel. Clicking such an extension's toolbar button opens it on the right of the page, and it stays there while you browse.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​41 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​41
Prod 44 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2091 $\color{#cf222e}{\Huge{\mathbf{−}}}$​131 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1960

What Changed

Before: chrome.sidePanel did not exist in Orca. Extensions that call it at startup (for example setPanelBehavior) threw in their background script, and there was nowhere to show a side panel.

After:

  • chrome.sidePanel works:
    • setOptions and getOptions, for all tabs or for one tab, merged the way Chrome merges them.
    • setPanelBehavior and getPanelBehavior.
    • open, which needs a user click or shortcut like in Chrome, and close.
    • getLayout, plus the onOpened and onClosed events.
    • runtime.getContexts reports SIDE_PANEL contexts.
  • The panel docks on the right of the browser workspace. It sits below the toolbar, and the page area shrinks to make room. It has a header with the extension's icon, name and a close button, and can be resized by dragging or with the arrow keys on the focused divider (minimum 360 px, at most two thirds of the pane). The width is saved once per drag.
  • open({windowId}) follows Chrome: it needs usable global options, leaves a tab's own panel that is already showing (the global one waits for other tabs), and otherwise prefers the extension's own panel for the active tab.
  • A global panel stays open while you switch pages in that workspace. A panel opened for one page shows only on that page and keeps its state while you're on another page.
  • With openPanelOnActionClick set, a toolbar click or the extension's _execute_action shortcut toggles the panel. Like Chrome, this takes precedence over the popup and grants no activeTab.
  • A panel is an extension page, not a tab:
    • tabs.*, tabs.getCurrent and webNavigation don't see it.
    • Ad-block rules and extension commands still apply.
    • Orca's shortcuts typed in the panel act for the page beside it: Mod+L focuses that page's address bar, and closing a tab closes its own split.
    • Links it opens go to a new Orca tab, as from popups.

How it works:

  • Main owns panel options and open panels (src/main/browser/extensions/side-panel/).
  • Renderer hosts one <webview> per open panel in the workspace slot (extension-side-panel/). The webviews are kept in module state, so React remounts never move them. Electron destroys a webview that leaves the DOM.
  • Attach: a webview attaches through a one-use marker that main mints, the same pattern as browser page attach. Main therefore knows the guest is a panel before it loads, and main alone picks its URL.
  • Small moves to stay under the 300-line limit: canExtensionSeeTabUrl moved to permissions/; the action.openPopup request moved to actions/browser-extension-popup-request.ts; chrome inset heights got their own module; browser pane layout hydration moved to a helper.
  • Shortcut forwarding can now take a function for its page id, because a global panel acts for whichever page it sits beside.

Why

It's a user request in #34756, and side panels are how the popular AI and research extensions present themselves.

On the hosting choice:

  • Not a WebContentsView laid over the window like docked DevTools. That needs a snapshot swap whenever Orca UI covers it, and bounds IPC on every frame during resize.
  • A <webview> composites in the renderer, so menus draw over it and resizing is CSS.

On behaviour, two other browsers show what to avoid:

  • Vivaldi ignores per-tab panels and paths set at runtime, so Claude in Chrome shows a blank panel there.
  • Edge has no real per-tab panels.

Orca follows Chromium's rules instead: SidePanelService options, and ExtensionActionRunner::RunAction checking the panel before the popup.

Linked Issue

Fixes #34756

Visual Proof

After: Sider's own side panel beside a page. The window was hidden during the test, so this image is put together from the window and each surface's own frame, at their real positions.

sider-panel-crop.png

Before: N/A. Orca had no side panel, so there is nothing to show.

Testing

  • 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

On macOS, in a hidden dev build driven over CDP, with two test extensions:

  • Global panel: toolbar toggle; window.close() in the panel; the header close button; onOpened/onClosed payloads (/panel.html, windowId, tabId).
  • Per-tab panel opened Claude-in-Chrome style (setOptions({tabId}) not awaited, then open({tabId}) from action.onClicked).
  • Replacement and switching:
    • one extension's panel replaces another's;
    • a second page shows the global panel while the per-tab panel stays alive (switching back keeps its document);
    • closing a page closes its panel;
    • enabled:false closes the panel;
    • disabling the extension closes it.
  • Refusals and contexts: open() without a click is refused with Chrome's message; getContexts returns BACKGROUND plus SIDE_PANEL with the right origin.
  • Resize: dragging saves once on release; dragging past the minimum stops at 360 px.
  • Keys from a focused panel: Mod+L focuses the page's address bar; the extension's _execute_action shortcut toggles the panel.
  • Hidden workspace: a panel opened while its workspace is hidden loads once you switch back.
  • Real extension: Sider from the Web Store opens its panel and renders.

Unit test: browser-extension-side-panel-options.test.ts pins Chrome's option-merge rules (a tab's first options don't inherit the global page). The existing tests related to the changed files pass (pnpm test:changed), and pnpm check:changed passes.

Performance:

  • With no panel open, nothing is mounted. One IPC listener runs while browser slots exist.
  • An open panel runs in the extension's existing renderer process, alongside its worker. Measured: opening and closing it added or removed no process, and a small panel page added about 6 MB.
  • Closing a panel destroys it. Main pushes the panel list only when it changes, and skips per-tab option changes unless a global panel is open.

Not tested: Windows and Linux. It's a plain <webview> plus CSS, and the shortcuts go through the existing cross-platform forwarding.

Risk

The riskiest part is the webview attach path in main-window-webview-security.ts. A marker is admitted only if:

  • it is the panel's live, one-use token;
  • it comes from the main window;
  • it is in that profile's partition;
  • extensions are on.

src is dropped, and the guest gets the same hardened preferences as extension pages. Shortcut forwarding now also takes a resolver, but every existing caller passes a string and builds the same context once.

Other limits:

  • Panels exist only for local browser pages. Streamed, client-hosted and document pages, orca serve and mobile don't get them; open() rejects there.
  • The saved width is a new UI key. Older builds ignore it.
  • A revert removes everything. Extensions just lose the API again.

Known gaps, as follow-ups:

  • A message sent from a panel arrives with sender.tab set. Electron's native messaging does this for every WebContents, popups included.
  • Memory Saver discarding a page closes that page's panel. Orca reports a discard to extensions as tabs.onRemoved.
  • When a per-tab panel covers the global one, the global panel gets no onClosed/onOpened.
  • Switching to a tab that has its own options while the global panel is open doesn't switch to the tab's panel.

Level: Medium

AI Disclosure

Review

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

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

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 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

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: 27463172-6e99-4dee-8c61-65bc242da213
Commits

Reviewing files that changed from the base of the PR and between 08aca1d and 3f27fe1.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The change adds Chrome extension side-panel APIs, including configuration, opening, closing, and context listing. Main-process code manages panel state, guest attachment, and lifecycle cleanup. The browser renderer adds a dock with panel webviews and resizing. The change also adds toolbar side-panel toggling, popup request handling, and persisted panel-width settings.

Merge Risk: Minimal · previous review 08aca

This change adds Chrome extension side-panel support to the built-in browser. No unresolved merge-blocking issue was identified in the reviewed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title 'feat(browser): support Chrome extension side panels in the built-in browser' states the main change. The changeset adds side-panel support (main-process host, open/options logic, sidePanel …
Description check Passed The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #34756), Visual Proof (after image, with a before marked N/A and a reason), detailed Testin…
Linked Issues check Passed [#34756] asks for support for Chrome extension side panels in Orca's built-in browser, docked beside a page while the user browses. The whole-PR summary (merge base ab0ad6f to head 08aca1d) shows this…
Out of Scope Changes check Passed Each changed area maps to the side-panel objective or to a stated supporting need. Direct feature files: side-panel main modules, api/side-panel.ts, renderer side-panel dock and webviews, preload side…
Full details: Title check

Explanation

The title 'feat(browser): support Chrome extension side panels in the built-in browser' states the main change. The changeset adds side-panel support (main-process host, open/options logic, sidePanel API namespace, renderer dock and webviews) for Orca's built-in browser. It is specific and matches the objectives.

Full details: Description check

Explanation

The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #34756), Visual Proof (after image, with a before marked N/A and a reason), detailed Testing, Risk with level and revert guidance, and Notes and Checklist sections. The AI Disclosure section is empty, but the template marks it as applicable only to non-team contributors, so this does not block the check.

Full details: Linked Issues check

Explanation

[#34756] asks for support for Chrome extension side panels in Orca's built-in browser, docked beside a page while the user browses. The whole-PR summary (merge base ab0ad6f to head 08aca1d) shows this behavior: (1) Main process: side-panel/ modules and api/side-panel.ts implement chrome.sidePanel setOptions/getOptions, setPanelBehavior/getPanelBehavior, open/close, getLayout, and onOpened/onClosed. (2) runtime.ts adds getContexts, which returns SIDE_PANEL contexts. (3) Renderer: BrowserExtensionSidePanelDock.tsx and browser-extension-side-panel-webviews.ts host one webview per open panel beside the page, with a resize handle and close control, and the page area shrinks through the --browser-side-panel-width variable. (4) Attach uses a one-use marker admitted in main-window-webview-security.ts. The unit test browser-extension-side-panel-options.test.ts covers option-merge rules. The issue has no non-coding requirements. The assessment relies on the summary; individual source paths were not re-read in this review. Follow-up gaps listed in the PR description (sender.tab, Memory Saver discard, event omissions, tab-panel switching) are not requirements of #34756.

Full details: Out of Scope Changes check

Explanation

Each changed area maps to the side-panel objective or to a stated supporting need. Direct feature files: side-panel main modules, api/side-panel.ts, renderer side-panel dock and webviews, preload side-panel API, shared side-panel types, and IPC handlers. Supporting changes: getContexts for SIDE_PANEL contexts; popup-request module extracted so action.openPopup and the openPanelOnActionClick path share it; canExtensionSeeTabUrl moved to permissions/ and used by the tab model and discard model; tab lifecycle and session cleanup for side-panel options; shortcut forwarding accepting a resolver so panel shortcuts act for the adjacent page; chrome-inset helper and viewport change so the page shrinks beside the panel; persisted width key across ui-slice, client-ui-params, wsl-move dispositions, and persisted-ui-state-types; browser-pane layout hydration helper. The PR states that the moves were needed to stay under the 300-line limit. Each one supports panel layout, persistence, routing, or that file-size limit. No unrelated change was identified in the reviewed summary. Source files were not individually re-read, so this verdict rests on the summary.

  • 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: 2d1abc98-d4cd-4e45-9d9b-654cb7a62a70
Commits

Reviewing files that changed from the base of the PR and between d55b40a and 08aca1d.

Files selected for processing: 8

  • src/renderer/src/components/browser-pane/assemble-chrome/BrowserPaneOverlayLayer.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/ui/browser-pane-layout-hydration.ts
  • src/renderer/src/store/slices/ui/ui-slice-contract-preferences.ts
  • src/renderer/src/store/slices/ui/ui-slice-hydration-actions.ts
  • src/shared/orca-profiles/persisted-ui-state-types.ts
  • src/shared/rpc-contract/client-ui/client-ui-params.ts
  • src/shared/wsl-move/wsl-move-ui-dispositions.ts
Files skipped from review as they are similar to previous changes: 1

  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 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: 4

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: 542d83af-ca66-4822-b0a3-d51064b80d9f
Commits

Reviewing files that changed from the base of the PR and between 1ce376b and 778fba3.

Files selected for processing: 45

  • src/main/browser/extensions/actions/browser-extension-popup-request.ts
  • src/main/browser/extensions/actions/browser-extension-toolbar.ts
  • src/main/browser/extensions/api/action.ts
  • src/main/browser/extensions/api/runtime.ts
  • src/main/browser/extensions/api/side-panel.ts
  • src/main/browser/extensions/browser-extension-startup.ts
  • src/main/browser/extensions/permissions/browser-extension-tab-url-access.ts
  • src/main/browser/extensions/profile-sessions/browser-extension-session-services.ts
  • src/main/browser/extensions/profile-storage/browser-extension-profile-state-store.ts
  • src/main/browser/extensions/register-browser-extension-namespaces.ts
  • src/main/browser/extensions/side-panel/browser-extension-side-panel-attach.ts
  • src/main/browser/extensions/side-panel/browser-extension-side-panel-contexts.ts
  • src/main/browser/extensions/side-panel/browser-extension-side-panel-guests.ts
  • src/main/browser/extensions/side-panel/browser-extension-side-panel-host.ts
  • src/main/browser/extensions/side-panel/browser-extension-side-panel-open.ts
  • src/main/browser/extensions/side-panel/browser-extension-side-panel-options.test.ts
  • src/main/browser/extensions/side-panel/browser-extension-side-panel-options.ts
  • src/main/browser/extensions/tabs-and-windows/browser-extension-discarded-tab-model.ts
  • src/main/browser/extensions/tabs-and-windows/browser-extension-tab-lifecycle.ts
  • src/main/browser/extensions/tabs-and-windows/browser-extension-tab-model.ts
  • src/main/browser/guest-lifecycle/input/shortcuts/browser-guest-shortcut-forwarding.ts
  • src/main/browser/guest-lifecycle/manager/browser-manager-queries.ts
  • src/main/ipc/browser/browser-extension-side-panels.ts
  • src/main/ipc/browser/browser-extensions.ts
  • src/main/window/security/main-window-webview-security.ts
  • src/preload/api/browser/browser-api.ts
  • src/preload/api/browser/browser-bridge-extension-side-panels.ts
  • src/preload/api/browser/browser-bridge.ts
  • src/preload/api/browser/browser-extension-side-panel-api.ts
  • src/preload/browser/extensions/api/browser-extension-api-surface.ts
  • src/renderer/src/components/browser-pane/assemble-chrome/BrowserPaneOverlayLayer.tsx
  • src/renderer/src/components/browser-pane/extension-side-panel/BrowserExtensionSidePanelDock.tsx
  • src/renderer/src/components/browser-pane/extension-side-panel/browser-extension-side-panel-store.ts
  • src/renderer/src/components/browser-pane/extension-side-panel/browser-extension-side-panel-webviews.ts
  • src/renderer/src/components/browser-pane/host-guest/viewport/browser-page-chrome-inset-heights.ts
  • src/renderer/src/components/browser-pane/host-guest/viewport/browser-page-viewport.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/ui/browser-pane-layout-hydration.ts
  • src/renderer/src/store/slices/ui/ui-slice-contract-preferences.ts
  • src/renderer/src/store/slices/ui/ui-slice-hydration-actions.ts
  • src/renderer/src/store/slices/ui/ui-slice-update-actions.ts
  • src/shared/browser/extensions/browser-extension-side-panel-types.ts
  • src/shared/persisted-ui-state-types.ts
  • src/shared/rpc-contract/client-ui/client-ui-params.ts
  • src/shared/wsl-move/wsl-move-ui-dispositions.ts

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

@AmoabaKelvin
AmoabaKelvin force-pushed the chrome-extensions-side-panel branch from d55b40a to 08aca1d Compare November 17, 2026 16:28
Adds chrome.sidePanel to Orca's built-in browser. Main owns each extension's panel
options (global and per tab, merged like Chrome), the persisted openPanelOnActionClick
behavior, and the open panels; the renderer docks a webview per panel on the right of
the browser workspace, attached through a main-minted marker so main knows the guest
before it loads.

- setOptions/getOptions, setPanelBehavior/getPanelBehavior, open (user gesture),
  close, getLayout, onOpened/onClosed
- toolbar clicks and _execute_action toggle the panel when the behavior is set
- runtime.getContexts reports SIDE_PANEL contexts
- panels are not tabs: tabs.*, webNavigation and the tab model skip them; DNR,
  commands and Orca shortcuts still apply, acting for the page beside the panel
- resizable, width saved once per drag; panels run in the extension's own process
…rd-resizable panel

- open({windowId}) needs usable global options, keeps a tab's own panel that is showing
  (the global one waits for other tabs), and otherwise prefers the extension's own panel
  for the active tab, as Chrome's OpenGlobalExtensionSidePanel does
- close({tabId}) only rejects for a global panel in that tab's workspace
- the panel list drops an initial fetch from an earlier subscription
- the resize divider takes focus, resizes with the arrow keys and reports its width
@AmoabaKelvin
AmoabaKelvin force-pushed the chrome-extensions-side-panel branch from 08aca1d to 3f27fe1 Compare November 17, 2026 16:50
@AmoabaKelvin
AmoabaKelvin merged commit 1ea385f into main Nov 17, 2026
95 of 97 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]: Support Chrome extension side panels in the built-in browser

1 participant