Repository navigation
feat(browser): install Chrome extensions from the Web Store into Orca's browser - #30940
Conversation
a8c38a9 to
46a007b
Compare
Ad blockers now block (46a007b)uBlock Origin Lite, AdGuard and Ghostery used to install and show their popups, but nothing got blocked. Chrome-store ad blockers hand the browser a list of rules ( How it works
Checked against Chromium itself. Electron still contains Chromium's own matcher behind
Regex rules (under 1% of rules) are translated to JS regexes rather than run through a copy of Chrome's regex engine, so Live check (hidden dev build):
Pages render normally, each blocker's popup works, Bitwarden and Dark Reader keep working alongside, and with the blockers switched off nothing is blocked. Not done yet
|
Performance: one slowdown fixed, and no regression from blockingI measured Orca's browser before and after this work, on a hidden production build, running the old and new builds back to back on the same machine. Real-site numbers only mean something that way; on a different day the server response time alone doubled. A slowdown in this PR, now fixed. Passing requests on to extensions ( 300-resource local test page, first load (production build):
Main-process time per request (development build):
Extensions off, real sites, alternating old/new/old/new (median load): Wikipedia 2132 / 2100 / 2131 / 2128 ms, YouTube 3168 / 3209 / 3005 / 3262 ms, GitHub 7554 / 3451 / 5009 / 3310 ms. No difference beyond noise. Matching cost per request:
Memory and startup: with uBlock Lite installed, main-process memory goes up about 23MB for its rule index (measured with macOS Unrelated find, left for a separate change: the camera/microphone permission check costs 28–40ms of main-process time per CNN load, on main as well. |
46a007b to
2ea59d2
Compare
Extensions switch on and off without a restart (eb5b41a, 2ea59d2)The experimental "Browser extensions" setting used to apply only after restarting Orca. It now applies right away:
Two bugs found along the way:
Checked in a hidden dev build with Dark Reader and uBlock Origin Lite:
The extensions menu (puzzle button) also gets Visit Chrome Web Store, which opens the store in a new tab in the same browser profile. |
0da0251 to
3ac9fba
Compare
cf98f3b to
587f35a
Compare
|
+1 for this its a necessary update |
c024240 to
eda0092
Compare
…e Chrome Web Store
Behind the experimental "Browser extensions" setting. Extensions install from the
store page ("Add to Orca") or Settings, run per browser profile, and get the Chrome
APIs Electron leaves out (tabs, windows, action/popups, context menus, storage.sync,
native messaging and more) through Orca's own MIT implementation.
Electron accepts declarativeNetRequest rules but never applies them, so Orca now matches them itself inside its existing request handlers.
Removing an extension also unregisters its worker in Chromium, so a reload now waits for the worker to register again before firing lifecycle events.
Extensions could see or act on other browser profiles' tabs and windows, read data from another Orca profile, load more access than the install prompt showed, or keep running after being turned off during startup. Content-blocking regex rules could also stall the main process.
…the second review Loads that finished after extensions were turned off could still land, a case-variant backup manifest could carry unapproved permissions, and turning extensions on after a launch with them off left tab and window APIs without a main window.
…saveAs
Extensions that call chrome.downloads.download({ saveAs: true }) now get the system save
dialog first and download to the chosen path, instead of an error.
…ew-three gaps A website could stall main before the worker API authenticated it, and a case variant of a listed file could expose the worker token. activeTab, webRequest and stale menu clicks now grant only what Chrome grants.
A sandboxed extension page keeps its chrome-extension:// URL but runs with an opaque origin and, in Chrome, no extension APIs. Orca trusted the URL and handed it the full bridge.
c5b9a03 to
f18659d
Compare

ELI5
Orca's browser can now run Chrome extensions. You add them from the Chrome Web Store with an "Add to Orca" button, and password managers like Bitwarden and 1Password fill logins and passkeys inside Orca's browser. It is off by default behind the experimental "Browser extensions" setting.
What Changed
Before, Orca's browser had no extensions, so no password manager, no dark mode, no dev tools. Now:
storage.sync(Electron disables it; Orca keeps it on this machine, like Chrome when signed out),runtime.onInstalled/onStartup, and native messaging so extensions can talk to desktop apps such as Bitwarden and KeePassXC.storage.onChanged, so Bitwarden's popup hung after sign-in;use_dynamic_urlresources can't load, so Bitwarden's in-field menu stayed invisible; content scripts and extension iframes were missing APIs Chrome gives them.Extensions run in local browser profiles only. Remote, SSH and streamed pages are unchanged.
Why
electron-chrome-extensions(GPL-3, Orca is MIT).electron-chrome-web-store(MIT) only downloads and updates packages. Its own store-page bridge isn't used, because it checks the store origin with a prefix match that a look-alike host passes.V8MetricsRecorderwhile preload code runs), with no fix in Electron.This rebuilds what community PR #23826 set out to do.
Known gaps:
declarativeNetRequestrules aren't enforced, so ad blockers install but don't block; nouserScripts(Tampermonkey), side panel, new-tab override (Momentum) or tab/screen capture (Loom); activeTab doesn't grant script access because Electron 43 checks only manifest host permissions; native messaging isn't tested on Windows yet.Linked Issue
Fixes #20558
Fixes #30200
Fixes #20088
Fixes #17709
Visual Proof
Testing
Turn on Settings › Experimental › Browser extensions, restart, open https://chromewebstore.google.com in an Orca browser tab and click "Add to Orca" on Bitwarden.
Live-checked on macOS: Bitwarden sign-in, autofill, in-field menu, passkey register and sign-in on webauthn.io; 1Password; Dark Reader; Refined GitHub; native messaging against a test host. A one-off run over 31 popular extensions ended with 17 working, 11 partly working and 3 broken (Tampermonkey, Loom, Momentum, for the gaps above).
AI Disclosure
Review
Worth a close look:
main-window-webview-security.ts(extension pages admitted at attach,nodeIntegrationInSubFramesfor extension-enabled profiles), the store bridge host (exact origin, top frame, approval tied to the frame), and native host launching (spawnProcess, Chrome's manifest rules, process cleanup).Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)