You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(browser): support Chrome extension proxy settings - #43097
ZeroOmega can install in Orca but cannot apply its proxy settings. This adds the extension
proxy API so browser pages can use fixed proxies and PAC-based automatic switching.
What Changed
Implement permission-checked chrome.proxy.settings.get/set/clear, settings.onChange,
and request-level onProxyError through the existing page/worker bridge.
Support direct, system, automatic discovery, fixed proxy rules and PAC configurations.
Persist overrides per browser profile, resolve extension precedence, and restore the
latest underlying app policy when an override is cleared or its extension is disabled.
Serialize writes with the existing proxy queue, restore the previous configuration on
failure, and keep recovery API calls available when network requests must be blocked.
Recheck both native and extension proxy readiness after request rules settle and after
waiting for proxy updates, including failed rule decisions.
Read native proxy failover lists and whitespace around protocol assignments, and normalize
native bypass separators so a representable setting can be read and reapplied.
Preserve native candidate order across repeated protocol assignments, ignore unsupported
protocol assignments, and follow native single-proxy/per-protocol parsing precedence.
Report all-direct native rules as direct mode. Reject DIRECT-first lists with proxy
fallbacks and mixed explicit DIRECT/proxy rules that cannot be represented safely.
Match native extension callbacks' global receiver, fixing ZeroOmega's _proxyChangeWatchers startup error.
Why
Electron does not expose this API to extensions. Reusing Orca's extension bridge and proxy
queue keeps permission checks and network policy ownership in their existing layers.
Before: ZeroOmega installs, but chrome.proxy.settings is unavailable and proxy profiles
cannot be applied.
After: the actual ZeroOmega UI applies a fixed proxy and a PAC profile. Local HTTP listeners
identify which endpoint received each request. With the same PAC selected, a matching host
reaches the proxy listener and the direct URL reaches the origin listener.
1. Before: failure on the baseline build
Read-only diagnostics run inside an unmodified Orca build of the issue's baseline commit, 5ff527c30b7f, show that chrome.proxy.settings is absent and record ZeroOmega's actual
"Your browser does not support proxy settings!" startup error.
2. PAC match: the request reaches PROXY-A
3. Same PAC, direct branch: the request reaches DIRECT
Testing
Tested on macOS arm64 with ZeroOmega 3.5.2: fixed proxy, both PAC branches,
disable/re-enable, and restoration after restarting Orca.
Regression coverage exercises actual routing, profile isolation, persistence,
unload races, rollback, and callback compatibility in the real extension worker.
Focused request/proxy/persistence checks: 3 files / 14 tests passed. Coverage includes
native SOCKS URI/default syntax and proxy failure during asynchronous request decisions.
Native readback regression: verified protocol whitespace roundtrips, explicit DIRECT
rules and WebSocket routing in real Electron; a readback error still permits setting an
override and clearing it to restore the original native routes. Proxy/persistence checks
passed. The expanded native comparison matrix also covers DIRECT-first fallbacks,
repeated assignments, ignored protocols and mixed single/per-protocol precedence.
Final head e8d2aa24ff: pnpm check:changed --base=upstream/main --timeout=30
passed all 25 checks, including the complete related-test selection, in 523.0 seconds.
Built and ad-hoc-signed a local macOS arm64 app for UI verification. Windows/Linux UI and
native popup positioning/focus have not been tested. The official popup page was exercised
as an Orca browser tab.
Reproduce the routing and restart checks:
ORCA_BACKGROUND_LAUNCH=1 pnpm test \
src/main/browser/extensions/proxy/browser-extension-proxy.electron.test.ts \
src/main/browser/extensions/profile-storage/browser-extension-persistence.electron.test.ts \
--maxWorkers=2
Risk
Level: Medium
The main risk is overriding or incorrectly restoring a profile's existing proxy policy.
Shared serialization, rollback, lifecycle cancellation and recovery guards address this.
Changing the effective configuration closes pooled connections and may interrupt downloads
or persistent connections.
Electron 43.8.7 forces mandatory PAC mode: PAC failures block requests even when callers
omit mandatory or pass false. The effective setting reports true; ZeroOmega 3.5.2
already requests this mode. Proxy authentication and complete PAC diagnostics are outside scope.
Chrome's settings model exposes one server per scheme: native failover lists are reported
using their first server. The complete underlying native policy remains intact and is
restored when the extension override is cleared. Native DIRECT-first lists with proxy fallbacks, and rules mixing explicit per-scheme DIRECT
entries with proxy entries, cannot be represented by Chrome's fixed-server model.
For these rules, settings.get returns a descriptive error instead of a setting that changes
routing when reapplied. Reading does not modify the native policy, and settings.set and settings.clear remain available. All-direct native rules report mode: "direct".
A revert removes the API; older code ignores the optional saved proxy field. No dependency,
version or data migration changes are included.
AI Disclosure
OpenAI Codex (GPT-6) assisted implementation and testing. The contributor also manually
tested the local build.
Review
Self-reviewed permission enforcement, cancellation and policy restoration. The implementation
uses cross-platform Electron/Node APIs; local validation is limited to macOS. Only local
browser profiles attach the API; SSH/remote routing retains its existing ownership. No mobile
RPC changes are included. Unchanged effective configurations avoid connection cleanup.
Agent skill upstream boundary
Not applicable; no upstream skill source was copied or translated.
Notes
This targets Orca's Electron desktop browser on macOS, Windows and Linux. Mobile and ordinary
web clients are outside scope. Screenshots and local build artifacts are not committed.
Checklist
Focused on extension proxy support; split into callback compatibility, network
override support, and extension API/lifecycle commits.
Explained behavior, mechanism, risk and rollback; linked the issue.
Self-reviewed cross-platform, SSH/remote, mobile, security and performance impact.
Captured baseline failure evidence from the unmodified source baseline.
Three selected screenshots uploaded as GitHub attachments.
Test expectations use explicit values and exercise the behavior-owning layer;
regression failures were reproduced before the fixes. CI covers remaining platforms.
Serialize overrides with application proxy policy, restore the latest baseline on release, and keep recovery requests available when proxy application fails.
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.
No actionable comments were generated in the recent review.
Walkthrough
The change adds the proxy extension namespace with settings methods and events, validates and converts proxy configurations, and manages extension proxy settings per Electron session. It connects proxy readiness to extension loading and HTTP, HTTPS, and WebSocket requests. It also adds persistence validation, proxy lifecycle and routing fixtures, and callback receiver checks.
Merge Risk: Minimal · up to e8d2a
Extension proxy settings now read back and reject native proxy configurations that cannot be represented, rather than reporting a route that differs from what Chromium uses. Spaced native assignments such as http = host:port are parsed correctly. No unresolved merge-blocking issues remain, apart from the author-reported gaps in Windows/Linux and native popup testing.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(browser): support Chrome extension proxy settings" matches the main change: the PR adds the chrome.proxy.settings get/set/clear API, settings.onChange, and onProxyError for browser ext…
Linked Issues check
Only #43075 is an active direct link. No parent or contextual targets apply, so its coding requirements govern this assessment. The whole-PR summary at head e8d2aa2 (merge base 2e71fad) maps…
Out of Scope Changes check
Each changed area supports #43075 or its stated proxy scope:
- browser-extension-main-world.ts: invokes callbacks and listeners with globalThis. The PR states this fixes the ZeroOmega _proxyChangeWat…
Description check
The description follows the repository template closely. It has an ELI5, a detailed What Changed list, Why, a linked issue (Fixes #43075), Visual Proof with before/after evidence, Testing with checkbo…
Full details: Title check
Explanation
The title "feat(browser): support Chrome extension proxy settings" matches the main change: the PR adds the chrome.proxy.settings get/set/clear API, settings.onChange, and onProxyError for browser extensions in Orca's Electron browser. It is specific and follows conventional-commit style, so it summarizes the primary change clearly.
Full details: Linked Issues check
Explanation
Only #43075 is an active direct link. No parent or contextual targets apply, so its coding requirements govern this assessment. The whole-PR summary at head e8d2aa2 (merge base 2e71fad) maps to each requirement:
[#43075] Permission-checked chrome.proxy.settings.get/set/clear: registerProxyNamespace in api/proxy.ts; namespace registered in register-browser-extension-namespaces.ts; permission wired in permissions.ts; API surface in browser-extension-api-surface.ts.
[#43075] settings.onChange and onProxyError: declared in proxy.ts and the API surface; error forwarding in browser-extension-web-request-observer.ts.
[#43075] Fixed-proxy and PAC configurations: browser-extension-proxy-config.ts (fixed servers, per-protocol rules, PAC data or URL, bypass validation, Electron conversion).
[#43075] Profile-scoped persistence, precedence, and lifecycle cleanup: browser-extension-profile-state-store.ts and browser-extension-proxy-session.ts (install-time priority, unload reconciliation, pending-update cancellation in the Electron fixture).
[#43075] Restoration of underlying policy on clear or disable: proxy-settings.ts (override apply/restore, rollback, AggregateError on failed rollback) and session-proxy-application.ts.
[#43075] Other profiles and SSH/remote routes unaffected: per-session state in session-proxy-application.ts; PR description states that only local browser profiles attach the API.
[#43075] Automated tests: Electron fixtures and tests in browser-extension-proxy.electron.test.ts, browser-extension-proxy-readback-electron-fixture.ts, persistence tests, and session-services request-decision tests.
The issue asks that Electron's mandatory PAC behavior be documented. The PR description Risk section documents it. This is documentation, not a code requirement, and is non-blocking. Windows and Linux manual checks are non-coding.
No concrete unmet coding requirement was found. This relies on the summary and PR description; implementation hunks were not read in this review.
Full details: Out of Scope Changes check
Explanation
Each changed area supports #43075 or its stated proxy scope:
browser-extension-main-world.ts: invokes callbacks and listeners with globalThis. The PR states this fixes the ZeroOmega _proxyChangeWatchers startup error, which blocks proxy API use by the target extension.
browser-certificate-request-guard.ts: gates proxy readiness only for http, https, ws, and wss. This supports the requirement that recovery API calls stay available.
browser-extension-session-services.ts and its test: applies proxy readiness to DNR request decisions. This enforces proxy policy on network requests.
permissions.ts and register-browser-extension-namespaces.ts: wire the proxy permission and namespace.
proxy-settings.ts, session-proxy-application.ts, proxy-policy-resolution.ts, electron-default-proxy-session.ts: implement override, serialization, rollback, and policy keys required for restoration.
browser-extension-proxy-readback-electron-fixture.ts and related config code: native readback whitespace, failover, and DIRECT handling. These support reading and reapplying native policy during restoration, which the issue requires.
No demonstrated unrelated change was found. This relies on the summary; implementation hunks were not read in this review.
Full details: Description check
Explanation
The description follows the repository template closely. It has an ELI5, a detailed What Changed list, Why, a linked issue (Fixes #43075), Visual Proof with before/after evidence, Testing with checkboxes and commands, a Risk section with level Medium and a rollback path, AI Disclosure, Review, the upstream boundary checkbox, Notes, and a completed checklist. The Visual Proof section is complete for a UI-facing change. Minor gaps: the Testing checkbox for "Every added test fails without this change" is not explicitly confirmed, and the PR states Windows/Linux UI was not tested. The description also gives a head commit that differs from the objectives text (e8d2aa2 versus cf57d57), which a reviewer should reconcile.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (2)
Minor · Preserve explicit direct rules when reporting a… · browser-extension-proxy-config.ts:103-104
src/main/browser/extensions/proxy/browser-extension-proxy-config.ts:103-104 Minor · Data Integrity & Integration · Heavy lift
Preserve explicit direct rules when reporting a baseline.
For http=direct://;socks=socks://proxy:1080, this removes the HTTP rule but retains fallbackProxy. Chromium treats the explicit HTTP rule as direct; the returned settings instead describe HTTP traffic as using the fallback proxy. An extension that reapplies these settings changes the route. (raw.githubusercontent.com)
Handle this configuration without returning a misleading rule set.
Minor · Trim the protocol name before matching it. · browser-extension-proxy-config.ts:119-121
src/main/browser/extensions/proxy/browser-extension-proxy-config.ts:119-121 Minor · Functional Correctness · Quick win
Trim the protocol name before matching it.
Chromium accepts http = proxy.example:8080 by trimming the protocol name. This expression does not match it, so server() passes the entire assignment to new URL, which throws. The baseline settings.get call then fails for this valid proxy switch. (raw.githubusercontent.com)
Trim the assignment name before matching it.
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: 936e3402-3427-4b15-bd10-4a4a8fe66405
Commits
Reviewing files that changed from the base of the PR and between 7c391c4 and a58ad9e.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
ZeroOmega can install in Orca but cannot apply its proxy settings. This adds the extension
proxy API so browser pages can use fixed proxies and PAC-based automatic switching.
What Changed
chrome.proxy.settings.get/set/clear,settings.onChange,and request-level
onProxyErrorthrough the existing page/worker bridge.latest underlying app policy when an override is cleared or its extension is disabled.
failure, and keep recovery API calls available when network requests must be blocked.
waiting for proxy updates, including failed rule decisions.
native bypass separators so a representable setting can be read and reapplied.
protocol assignments, and follow native single-proxy/per-protocol parsing precedence.
fallbacks and mixed explicit DIRECT/proxy rules that cannot be represented safely.
_proxyChangeWatchersstartup error.Why
Electron does not expose this API to extensions. Reusing Orca's extension bridge and proxy
queue keeps permission checks and network policy ownership in their existing layers.
Linked Issue
Fixes #43075
Visual Proof
Before: ZeroOmega installs, but
chrome.proxy.settingsis unavailable and proxy profilescannot be applied.
After: the actual ZeroOmega UI applies a fixed proxy and a PAC profile. Local HTTP listeners
identify which endpoint received each request. With the same PAC selected, a matching host
reaches the proxy listener and the direct URL reaches the origin listener.
1. Before: failure on the baseline build
Read-only diagnostics run inside an unmodified Orca build of the issue's baseline commit,
5ff527c30b7f, show thatchrome.proxy.settingsis absent and record ZeroOmega's actual"Your browser does not support proxy settings!" startup error.
2. PAC match: the request reaches PROXY-A
3. Same PAC, direct branch: the request reaches DIRECT
Testing
Tested on macOS arm64 with ZeroOmega 3.5.2: fixed proxy, both PAC branches,
disable/re-enable, and restoration after restarting Orca.
Regression coverage exercises actual routing, profile isolation, persistence,
unload races, rollback, and callback compatibility in the real extension worker.
Focused request/proxy/persistence checks: 3 files / 14 tests passed. Coverage includes
native SOCKS URI/default syntax and proxy failure during asynchronous request decisions.
Native readback regression: verified protocol whitespace roundtrips, explicit DIRECT
rules and WebSocket routing in real Electron; a readback error still permits setting an
override and clearing it to restore the original native routes. Proxy/persistence checks
passed. The expanded native comparison matrix also covers DIRECT-first fallbacks,
repeated assignments, ignored protocols and mixed single/per-protocol precedence.
Final head
e8d2aa24ff:pnpm check:changed --base=upstream/main --timeout=30passed all 25 checks, including the complete related-test selection, in 523.0 seconds.
Built and ad-hoc-signed a local macOS arm64 app for UI verification. Windows/Linux UI and
native popup positioning/focus have not been tested. The official popup page was exercised
as an Orca browser tab.
Reproduce the routing and restart checks:
ORCA_BACKGROUND_LAUNCH=1 pnpm test \ src/main/browser/extensions/proxy/browser-extension-proxy.electron.test.ts \ src/main/browser/extensions/profile-storage/browser-extension-persistence.electron.test.ts \ --maxWorkers=2Risk
Level: Medium
The main risk is overriding or incorrectly restoring a profile's existing proxy policy.
Shared serialization, rollback, lifecycle cancellation and recovery guards address this.
Changing the effective configuration closes pooled connections and may interrupt downloads
or persistent connections.
Electron 43.8.7 forces mandatory PAC mode: PAC failures block requests even when callers
omit
mandatoryor passfalse. The effective setting reportstrue; ZeroOmega 3.5.2already requests this mode. Proxy authentication and complete PAC diagnostics are outside scope.
Chrome's settings model exposes one server per scheme: native failover lists are reported
using their first server. The complete underlying native policy remains intact and is
restored when the extension override is cleared. Native DIRECT-first lists with proxy fallbacks, and rules mixing explicit per-scheme DIRECT
entries with proxy entries, cannot be represented by Chrome's fixed-server model.
For these rules,
settings.getreturns a descriptive error instead of a setting that changesrouting when reapplied. Reading does not modify the native policy, and
settings.setandsettings.clearremain available. All-direct native rules reportmode: "direct".A revert removes the API; older code ignores the optional saved proxy field. No dependency,
version or data migration changes are included.
AI Disclosure
OpenAI Codex (GPT-6) assisted implementation and testing. The contributor also manually
tested the local build.
Review
Self-reviewed permission enforcement, cancellation and policy restoration. The implementation
uses cross-platform Electron/Node APIs; local validation is limited to macOS. Only local
browser profiles attach the API; SSH/remote routing retains its existing ownership. No mobile
RPC changes are included. Unchanged effective configurations avoid connection cleanup.
Agent skill upstream boundary
Notes
This targets Orca's Electron desktop browser on macOS, Windows and Linux. Mobile and ordinary
web clients are outside scope. Screenshots and local build artifacts are not committed.
Checklist
override support, and extension API/lifecycle commits.
regression failures were reproduced before the fixes. CI covers remaining platforms.