Repository navigation
Conversation
4cc2205 to
7704615
Compare
|
Important Review skippedWe 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 You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt 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
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
src/main/ipc/browser-extension-ipc.ts (1)
113-113: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueGuard
argsbefore readingargs.index.Line 113 reads
args.indexwithout optional chaining. If a trusted renderer sendsundefined,guestForreturns null first, so the read is short-circuited. The handler is safe today, but the other handlers useargs?.. Useargs?.indexfor 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.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (83)
config/packaged-runtime-node-modules.cjselectron.vite.config.tspackage.jsonsrc/main/browser/browser-guest-context-menu.tssrc/main/browser/browser-guest-shortcut-forwarding.test.tssrc/main/browser/browser-manager-final.tssrc/main/browser/browser-manager-grab.tssrc/main/browser/browser-manager-registration.tssrc/main/browser/browser-session-partition-policies.tssrc/main/browser/extensions/extension-action-menu.tssrc/main/browser/extensions/extension-action-state.test.tssrc/main/browser/extensions/extension-action-state.tssrc/main/browser/extensions/extension-action.tssrc/main/browser/extensions/extension-api-args.tssrc/main/browser/extensions/extension-api-host.tssrc/main/browser/extensions/extension-commands.test.tssrc/main/browser/extensions/extension-commands.tssrc/main/browser/extensions/extension-context-menus.tssrc/main/browser/extensions/extension-cookies-api.tssrc/main/browser/extensions/extension-downloads-api.tssrc/main/browser/extensions/extension-install-folder.test.tssrc/main/browser/extensions/extension-install-folder.tssrc/main/browser/extensions/extension-installed-list.tssrc/main/browser/extensions/extension-manifest-api.tssrc/main/browser/extensions/extension-match-pattern.test.tssrc/main/browser/extensions/extension-match-pattern.tssrc/main/browser/extensions/extension-native-messaging.tssrc/main/browser/extensions/extension-notifications.tssrc/main/browser/extensions/extension-privacy-api.tssrc/main/browser/extensions/extension-session-enabler.tssrc/main/browser/extensions/extension-sessions.tssrc/main/browser/extensions/extension-tab-details.tssrc/main/browser/extensions/extension-tab-registry.tssrc/main/browser/extensions/extension-tabs-api.tssrc/main/browser/extensions/extension-web-navigation.tssrc/main/browser/extensions/native-message-codec.test.tssrc/main/browser/extensions/native-message-codec.tssrc/main/browser/extensions/native-messaging-host-manifest.test.tssrc/main/browser/extensions/native-messaging-host-manifest.tssrc/main/index.tssrc/main/ipc/browser-extension-ipc.tssrc/main/ipc/browser-preview-tool-authorization.test.tssrc/main/ipc/browser.tssrc/preload/api/browser-api.tssrc/preload/api/browser-bridge-extensions.tssrc/preload/api/browser-bridge-page-interaction-and-sessions.tssrc/preload/api/browser-bridge.tssrc/preload/api/browser-extensions-api.tssrc/preload/browser-extension-api-install.tssrc/preload/browser-extension-api-spec.test.tssrc/preload/browser-extension-api-spec.tssrc/preload/browser-extension-api.tssrc/renderer/src/components/browser-cookie-import-google-disclosure.test.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/BrowserToolbarMenu.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/browser-chrome-toolbar.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/browser-extension-actions.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/browser-extension-menu-items.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/browser-page-context-menu.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/browser-page-toolbar.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/browser-toolbar-menu-dropdown.tsxsrc/renderer/src/components/browser-pane/describe-page/browser-page-types.tssrc/renderer/src/components/settings/BrowserExtensionsSetting.tsxsrc/renderer/src/components/settings/BrowserPane.search-catalog.test.tsxsrc/renderer/src/components/settings/BrowserPane.tsxsrc/renderer/src/components/settings/browser-extensions-search.tssrc/renderer/src/components/settings/browser-search.test.tssrc/renderer/src/components/settings/browser-search.tssrc/renderer/src/hooks/ipc-events/browser-state-ipc-bridge.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/browser-open-link-beside-page.tssrc/renderer/src/web/preload-api/web-browser-api.tssrc/shared/browser-extension-channels.tssrc/shared/browser-guest-events.tssrc/shared/browser-url.test.tssrc/shared/browser-url.tstests/e2e/browser-extensions-in-page.spec.tstests/e2e/browser-extensions.spec.tstests/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.
|
Addressed all five review comments and the |
There was a problem hiding this comment.
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.tssrc/main/browser/extensions/extension-match-pattern.test.tssrc/main/browser/extensions/extension-match-pattern.tssrc/main/browser/extensions/extension-native-messaging.tssrc/main/browser/extensions/extension-web-navigation.tssrc/main/ipc/browser-extension-ipc.tssrc/main/ipc/browser.tssrc/shared/browser-url.test.tssrc/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.
There was a problem hiding this comment.
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.tssrc/main/browser/extensions/extension-tabs-api.tssrc/preload/browser-extension-api-install.tssrc/preload/browser-extension-api-spec.tstests/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.
3c34379 to
8377c0d
Compare
…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
8377c0d to
89a81a6
Compare
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:
electron-chrome-web-store(MIT) handles the download and updates.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 insrc/main/browser/extensions/:chromeandbrowser. Each call goes over one IPC channel to main. Main answers from Orca's own tab model and sends events back.tabs,windows,action,contextMenus,commands,webNavigation,cookies,downloads,notifications,permissions,managementandprivacy. Tab and URL data follow Chrome's permission rules: an extension sees a page's URL only with thetabspermission or a matching host permission.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 checksallowed_originsand spawns the host throughspawnProcess. This lets desktop companions (1Password's app) connect.feat/offscreen-browser-pages) receive keys over CDP, which skipsbefore-input-event.runExtensionShortcutis exported so their key path can run extension shortcuts. The integration is onFanzzzd:feat/offscreen-browser-pages-extensionswith 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:Its popup, sized to its page:
Settings → Browser → Extensions:
(Captured from a background e2e run with a demo extension.)
Testing
Automated:
main(7704615eaf): both e2e specs below pass headless on macOS.tests/e2e/browser-extensions.spec.ts: the worker gets the added APIs under bothchromeandbrowser,tabs.queryfinds 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.pnpm tcpasses, and so does the changed-code quality gate. Browser, IPC, preload and settings unit tests pass, except two that fail onmaintoo 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:
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
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
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 inallowed_origins. Extension windows are hidden and never focused inORCA_BACKGROUND_LAUNCHruns.app.configureWebAuthn([Feature]: Support macOS native keychain passkey #15064). They need thekeychain-access-groupsentitlement, 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.requestgrants 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.browser-extension-api-preloadis built with main's standalone webview preloads. It imports nothing main imports, and it loadselectronwith a plainrequire, so Rollup emits no shared chunk. A sandboxed preload cannot load a chunk.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred). Typecheck, the quality gate and the affected tests pass locally. CI covers the rest.