Skip to content

feat(browser): Chrome extensions in Orca's browser, installed from the Chrome Web Store - #23826

Closed
Fanzzzd wants to merge 10 commits into
stablyai:mainfrom
Fanzzzd:feat/browser-extensions-pr
Closed

Fanzzzd wants to merge 10 commits into
stablyai:mainfrom
Fanzzzd:feat/browser-extensions-pr

Conversation

@Fanzzzd

@Fanzzzd Fanzzzd commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Orca's browser can now use Chrome extensions. Open the Chrome Web Store in an Orca tab, press "Add to Chrome", and the extension works like it does in Chrome: its button sits in the page toolbar, its popup opens, and it can fill forms inside pages. Password managers such as 1Password and Bitwarden were the main target.

What Changed

Before: Orca's browser had no extension support. The Web Store's "Add to Chrome" button did nothing, and a password manager could not fill logins or answer passkey requests.

After:

  • "Add to Chrome" installs the extension after a confirmation prompt. electron-chrome-web-store (MIT) handles the download and updates.
  • Each extension's button appears in the page toolbar with its badge. A click opens its popup under the button. The popup sizes itself to its page and stays inside the window and screen. A right-click shows the extension's own menu entries, "Options", and "Remove from Orca…".
  • Extension entries appear in the page's right-click menu, including inside cross-site iframes.
  • Extension keyboard shortcuts work. An Orca shortcut on the same keys wins.
  • Settings → Browser has a new "Extensions" section: turn each one on or off, open its options, or remove it.

Mechanism. Electron can load extensions but implements only part of the chrome.* API. The rest is what extensions need to know about tabs and to draw their UI. This PR adds those APIs in src/main/browser/extensions/:

  • A preload that runs only in extension contexts (pages and service workers) adds the missing namespaces to chrome and browser. Each call goes over one IPC channel to main. Main answers from Orca's own tab model and sends events back.
  • Main implements tabs, windows, action, contextMenus, commands, webNavigation, cookies, downloads, notifications, permissions, management and privacy. Tab and URL data follow Chrome's permission rules: an extension sees a page's URL only with the tabs permission or a matching host permission.
  • Native messaging (runtime.connectNative / sendNativeMessage) is implemented here because Electron disables it. Orca reads host manifests from its own folder and from Chrome's and Chromium's folders, or from the registry on Windows. It checks allowed_origins and spawns the host through spawnProcess. This lets desktop companions (1Password's app) connect.
  • Every browser session shares one install folder. Installs, updates and on/off changes are mirrored across sessions.
  • Offscreen pages (feat/offscreen-browser-pages) receive keys over CDP, which skips before-input-event. runExtensionShortcut is exported so their key path can run extension shortcuts. The integration is on Fanzzzd:feat/offscreen-browser-pages-extensions with its own e2e.

Why

The ready-made option, electron-chrome-extensions, is GPL-3.0 and has no permissive edition, so Orca can't ship it. The APIs extensions actually call are a bounded set, so this PR implements them directly against Orca's tab model. That also removes an adapter layer: the library kept its own tab list, which Orca then had to keep in sync.

Linked Issue

Fixes #20558

Related: #20088 (password-manager autofill works through extensions). #15064 (macOS keychain passkeys) is not solved here, see Notes.

Visual Proof

Before: Orca's browser had no toolbar buttons, popups or settings for extensions.

After, the toolbar button with a badge set through chrome.action.setBadgeText:

Browser page toolbar with an extension button showing a red badge 3

Its popup, sized to its page:

Extension popup listing saved logins

Settings → Browser → Extensions:

Extensions settings section with an on/off switch, Options and Remove

(Captured from a background e2e run with a demo extension.)

Testing

  • I manually tested these changes locally. On macOS I used 1Password (unlock, fill, inline menu, passkeys) on an earlier revision that still used the GPL library. This revision has not been manually tested yet: it is covered by the e2e specs below, and I will re-test it by hand and update this box.
  • Automated tests added/updated

Automated:

  • Re-run on 2026-10-09 after rebasing onto current main (7704615eaf): both e2e specs below pass headless on macOS.
  • tests/e2e/browser-extensions.spec.ts: the worker gets the added APIs under both chrome and browser, tabs.query finds the sender's tab, the toolbar shows the badge, and a click opens the popup at its page's size.
  • tests/e2e/browser-extensions-in-page.spec.ts: a password-manager style extension injects an inline menu iframe, fills the page from a click in it, answers a passkey request, adds context-menu entries in the main frame and in a cross-site frame, and runs its keyboard shortcut.
  • Unit tests for match patterns, shortcuts, the native messaging wire format, host manifest lookup, the install folder, and badge colors.
  • pnpm tc passes, and so does the changed-code quality gate. Browser, IPC, preload and settings unit tests pass, except two that fail on main too on my machine (browser-route-tcp-egress.electron, pty-runtime-hidden-at-spawn-mark).

Help wanted: testing on Windows and Linux. I only have macOS. Useful checks:

  1. Install 1Password or Bitwarden from the Web Store in an Orca tab. Unlock it from the toolbar popup and fill a login.
  2. On Windows: native messaging to the desktop app, which reads the host manifest path from the registry.
  3. An extension shortcut such as 1Password's Ctrl+Shift+X.
  4. Settings → Browser → Extensions: turn one off and on, and remove one.

AI Disclosure

Written with Claude Code (Claude Opus 5.5): design, implementation, tests and this description. I directed the work, set the requirements, and reviewed the changes.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security. The API preload runs only when the context is chrome-extension: or a service worker, so web pages never see the bridge. Main identifies the caller from the frame URL or the worker scope, never from the message. Host manifests are looked up only by names matching Chrome's rule, which blocks path traversal. A host starts only if it lists the extension in allowed_origins. Extension windows are hidden and never focused in ORCA_BACKGROUND_LAUNCH runs.
  • Cross-platform. Host manifest folders are set per platform, with the registry used on Windows. Shortcuts follow Chrome's rule: "Ctrl" means ⌘ on macOS, and "MacCtrl" means the Control key.
  • SSH / remote. Extensions run where the browser page renders, on the desktop. A web client gets no-op stubs.
  • Not included.
    • Touch ID passkeys through app.configureWebAuthn ([Feature]: Support macOS native keychain passkey #15064). They need the keychain-access-groups entitlement, and on macOS that requires an embedded provisioning profile. Without the profile, a Developer ID app gets killed at launch. So this change belongs to whoever owns the Apple signing setup. Passkeys stored in a password manager extension already work.
    • permissions.request grants optional permissions the manifest declares without a prompt. Electron does not gate APIs on them, so a grant only reports what the extension can already do.
  • The browser-extension-api-preload is built with main's standalone webview preloads. It imports nothing main imports, and it loads electron with a plain require, so Rollup emits no shared chunk. A sandboxed preload cannot load a chunk.

Checklist

  • This PR is small and focused (it is not small: the API surface extensions need is wide)
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • 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). Typecheck, the quality gate and the affected tests pass locally. CI covers the rest.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

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

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.

  • Last reviewed commit: 2746f99663ce91d95ed259198e7a5a1ca4ee8c1e
  • Latest commit, not reviewed: 89a81a6

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
📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes add Chrome extension support to the embedded browser. They add extension session setup, preload and IPC bridges, extension APIs, tab and window integration, toolbar actions, context menus, native messaging, and extension management. Browser settings can list, enable, disable, remove, and open options for installed extensions. The browser toolbar can open the Chrome Web Store when permitted. Localized strings, unit tests, and end-to-end tests are included.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🟡 Moderate · up to 2746f

Extensions can capture visible page screenshots with only a narrow site permission, which is broader access than Chrome allows. Extensions that rely on the user-invoked activeTab grant are refused instead. Align the capture permission check with Chrome's rules before merging.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 46.01% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 163 functions across 53 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: Chrome Web Store extensions in Orca's browser. It is concise and specific.
Description check Passed The description covers all required sections, including user impact, implementation, rationale, linked issue, visual proof, testing, AI disclosure, security, cross-platform behavior, and checklist sta…
Linked Issues check Passed [#20558] requires extension installation, management, and action popups in embedded browser tabs. The PR implements Web Store installation with confirmation, shared-session loading, enable/disable/rem…
Out of Scope Changes check Passed The changes support [#20558]. The extension API bridge, native messaging, Web Store packaging, tab and window integration, toolbar and context-menu UI, Settings management, profile propagation, locali…
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@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: 5

🧹 Nitpick comments (1)
src/main/ipc/browser-extension-ipc.ts (1)

113-113: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Guard args before reading args.index.

Line 113 reads args.index without optional chaining. If a trusted renderer sends undefined, guestFor returns null first, so the read is short-circuited. The handler is safe today, but the other handlers use args?.. Use args?.index for consistency.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 77f248bc-cfd6-4010-ac34-59a8396d8737
📥 Commits

Reviewing files that changed from the base of the PR and between e4cd14d and 7704615eaf22c646954989429c399ba30ed72e4f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (83)
  • config/packaged-runtime-node-modules.cjs
  • electron.vite.config.ts
  • package.json
  • src/main/browser/browser-guest-context-menu.ts
  • src/main/browser/browser-guest-shortcut-forwarding.test.ts
  • src/main/browser/browser-manager-final.ts
  • src/main/browser/browser-manager-grab.ts
  • src/main/browser/browser-manager-registration.ts
  • src/main/browser/browser-session-partition-policies.ts
  • src/main/browser/extensions/extension-action-menu.ts
  • src/main/browser/extensions/extension-action-state.test.ts
  • src/main/browser/extensions/extension-action-state.ts
  • src/main/browser/extensions/extension-action.ts
  • src/main/browser/extensions/extension-api-args.ts
  • src/main/browser/extensions/extension-api-host.ts
  • src/main/browser/extensions/extension-commands.test.ts
  • src/main/browser/extensions/extension-commands.ts
  • src/main/browser/extensions/extension-context-menus.ts
  • src/main/browser/extensions/extension-cookies-api.ts
  • src/main/browser/extensions/extension-downloads-api.ts
  • src/main/browser/extensions/extension-install-folder.test.ts
  • src/main/browser/extensions/extension-install-folder.ts
  • src/main/browser/extensions/extension-installed-list.ts
  • src/main/browser/extensions/extension-manifest-api.ts
  • src/main/browser/extensions/extension-match-pattern.test.ts
  • src/main/browser/extensions/extension-match-pattern.ts
  • src/main/browser/extensions/extension-native-messaging.ts
  • src/main/browser/extensions/extension-notifications.ts
  • src/main/browser/extensions/extension-privacy-api.ts
  • src/main/browser/extensions/extension-session-enabler.ts
  • src/main/browser/extensions/extension-sessions.ts
  • src/main/browser/extensions/extension-tab-details.ts
  • src/main/browser/extensions/extension-tab-registry.ts
  • src/main/browser/extensions/extension-tabs-api.ts
  • src/main/browser/extensions/extension-web-navigation.ts
  • src/main/browser/extensions/native-message-codec.test.ts
  • src/main/browser/extensions/native-message-codec.ts
  • src/main/browser/extensions/native-messaging-host-manifest.test.ts
  • src/main/browser/extensions/native-messaging-host-manifest.ts
  • src/main/index.ts
  • src/main/ipc/browser-extension-ipc.ts
  • src/main/ipc/browser-preview-tool-authorization.test.ts
  • src/main/ipc/browser.ts
  • src/preload/api/browser-api.ts
  • src/preload/api/browser-bridge-extensions.ts
  • src/preload/api/browser-bridge-page-interaction-and-sessions.ts
  • src/preload/api/browser-bridge.ts
  • src/preload/api/browser-extensions-api.ts
  • src/preload/browser-extension-api-install.ts
  • src/preload/browser-extension-api-spec.test.ts
  • src/preload/browser-extension-api-spec.ts
  • src/preload/browser-extension-api.ts
  • src/renderer/src/components/browser-cookie-import-google-disclosure.test.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/BrowserToolbarMenu.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/browser-chrome-toolbar.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/browser-extension-actions.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/browser-extension-menu-items.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/browser-page-context-menu.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/browser-page-toolbar.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/browser-toolbar-menu-dropdown.tsx
  • src/renderer/src/components/browser-pane/describe-page/browser-page-types.ts
  • src/renderer/src/components/settings/BrowserExtensionsSetting.tsx
  • src/renderer/src/components/settings/BrowserPane.search-catalog.test.tsx
  • src/renderer/src/components/settings/BrowserPane.tsx
  • src/renderer/src/components/settings/browser-extensions-search.ts
  • src/renderer/src/components/settings/browser-search.test.ts
  • src/renderer/src/components/settings/browser-search.ts
  • src/renderer/src/hooks/ipc-events/browser-state-ipc-bridge.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/browser-open-link-beside-page.ts
  • src/renderer/src/web/preload-api/web-browser-api.ts
  • src/shared/browser-extension-channels.ts
  • src/shared/browser-guest-events.ts
  • src/shared/browser-url.test.ts
  • src/shared/browser-url.ts
  • tests/e2e/browser-extensions-in-page.spec.ts
  • tests/e2e/browser-extensions.spec.ts
  • tests/e2e/helpers/browser-extension-fixture.ts

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

Comment thread src/main/ipc/browser.ts Resolved
Comment thread src/shared/browser-url.ts Resolved
@Fanzzzd

Fanzzzd commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Addressed all five review comments and the args.index nitpick in ddeb86aa32.

@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: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ee02dfa9-e273-4d34-a76b-c0503326ec15
📥 Commits

Reviewing files that changed from the base of the PR and between 7704615eaf22c646954989429c399ba30ed72e4f and ddeb86aa3262796321283de33054cfe8e3506311.

📒 Files selected for processing (9)
  • src/main/browser/extensions/extension-cookies-api.ts
  • src/main/browser/extensions/extension-match-pattern.test.ts
  • src/main/browser/extensions/extension-match-pattern.ts
  • src/main/browser/extensions/extension-native-messaging.ts
  • src/main/browser/extensions/extension-web-navigation.ts
  • src/main/ipc/browser-extension-ipc.ts
  • src/main/ipc/browser.ts
  • src/shared/browser-url.test.ts
  • src/shared/browser-url.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/shared/browser-url.test.ts
  • src/main/ipc/browser.ts
  • src/main/browser/extensions/extension-native-messaging.ts

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


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 02396191-7be3-41c4-8f20-9a3d9c59d171
📥 Commits

Reviewing files that changed from the base of the PR and between d3d08009022118e19890c1537c394864e00b4dc3 and 2746f99663ce91d95ed259198e7a5a1ca4ee8c1e.

📒 Files selected for processing (5)
  • src/main/browser/extensions/extension-sessions.ts
  • src/main/browser/extensions/extension-tabs-api.ts
  • src/preload/browser-extension-api-install.ts
  • src/preload/browser-extension-api-spec.ts
  • tests/e2e/browser-extensions.spec.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.

@Fanzzzd
Fanzzzd force-pushed the feat/browser-extensions-pr branch from 3c34379 to 8377c0d Compare October 13, 2026 02:13
…e Chrome Web Store

Orca's browser can now run Chrome extensions such as 1Password and Bitwarden.
Choosing "Add to Chrome" on chromewebstore.google.com in an Orca tab installs
one (electron-chrome-web-store, MIT), after a confirmation prompt.

Electron runs extensions but lacks most chrome.* APIs they rely on, so Orca
implements them itself: tabs, windows, action (toolbar button, badge, popup),
contextMenus, commands, webNavigation, cookies, downloads, notifications,
permissions, management and privacy. One preload bridges extension pages and
service workers to main, which answers from Orca's own tab model. Native
messaging (runtime.connectNative / sendNativeMessage) spawns hosts registered
for Chrome, so desktop companions like 1Password's can connect.

The page toolbar shows each extension's button with its badge; clicking opens
its popup under the button, right-click offers its menu, options and removal.
Browser settings list installed extensions with on/off, options and remove.
Extension windows stay hidden and never take focus in background runs.
…page

untrackExtensionTab runs on the page's 'destroyed' event, where reading
tab.session or the window's id throws 'Object has been destroyed'. The
uncaught exception raises Electron's blocking error dialog in the main
process. Closing an offscreen page's host window hit it every time.
The tab's session and ids are now copied when the tab is tracked.
emitPerExtension sends one event to each extension with arguments shaped
for what that extension may see. It lived in the tab registry, which only
calls it; it now sits beside emitExtensionEvent in the event host. The
webNavigation events reuse it instead of their own loop, and the registry
is back under the line limit.
…dupe frame events

- cookies.* now needs the "cookies" permission plus a host permission, as in
  Chrome; "tabs" alone no longer grants cookie access.
- nativePort.post/disconnect only act on a port the calling extension opened,
  since port ids are sequential.
- webNavigation.onDOMContentLoaded fires once for the main frame, and a reused
  frame object keeps a single listener.
- browser:activeTabChanged validates browserPageId before using it.
- chrome-extension:// URLs stay in Orca instead of going to the OS browser.

Claude-Session: https://claude.ai/code/session_01DvNJ16LEPYmdEkpQWtDL7n
…d cookies on both schemes

Chrome ignores the path of a host permission, and a non-Secure cookie is sent
over https as well as http, so checking it only against an http URL hid it from
extensions that hold an https host permission.

Claude-Session: https://claude.ai/code/session_01DvNJ16LEPYmdEkpQWtDL7n
… worker starts

1Password 8.12.44 registers webNavigation.onCreatedNavigationTarget during startup.
The event was missing, so addListener threw and the worker stopped before it
connected to the desktop app or answered page requests such as passkey sign-in.

Claude-Session: https://claude.ai/code/session_01DvNJ16LEPYmdEkpQWtDL7n
…Orca provides

An extension worker that registers a listener on an event Orca left out throws
during startup and stops initializing, which is how 1Password's broke. Every
Chrome event of tabs, windows, action, notifications, downloads and management
is now declared, fired or not.

Also adds tabs.captureVisibleTab, which 1Password uses to scan QR codes, and
management.setEnabled for disabling another extension, and stops a native port
that never opened from raising unhandled rejections on postMessage.

Claude-Session: https://claude.ai/code/session_01DvNJ16LEPYmdEkpQWtDL7n
Chrome allows tabs.captureVisibleTab with <all_urls> or an activeTab grant from
the user invoking the extension. A host permission that merely matched the page
let a narrower extension capture it; Orca grants no activeTab, so <all_urls> is
the only way in.

Claude-Session: https://claude.ai/code/session_01DvNJ16LEPYmdEkpQWtDL7n
@nwparker

nwparker commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded — the linked issue (#20558) has been resolved on main by #30940 (917ef9c737). Thanks for the contribution!

@nwparker nwparker closed this Nov 5, 2026
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 extensions in the embedded browser

2 participants