Skip to content

feat(browser): quarantine client-hosted WebContents before navigation - #14517

Closed
Jinwoo-H wants to merge 1 commit into
sta-4150-browser-route-partitionsfrom
sta-4150-browser-webcontents-binding
Closed

Jinwoo-H wants to merge 1 commit into
sta-4150-browser-route-partitionsfrom
sta-4150-browser-webcontents-binding

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​373 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​373
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​451 $\color{#cf222e}{\Huge{\mathbf{−}}}$​19 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​432

Summary

Adds the next inert STA-4150 layer on top of #14516:

  • recognizes prepared and recently released route Sessions at WebContents attachment
  • installs blank-only navigation and popup quarantine before route-guest validation or closure
  • registers the exact guest, owning renderer, partition, page, and page-host generation
  • binds registration to an opaque per-prepare authority token so tuple reuse cannot revive stale guests
  • requires a separate navigation grant and rechecks live authority on every later navigation
  • bounds retained guest/page mappings and cleans exact destroyed mappings without stale-callback damage

Causal evidence

The first candidate had three deterministic failure modes found during fresh review: a page release between will-attach and did-attach could leave the generic HTTP(S)/popup policy active; delayed or throwing admission closure could leave a rejected guest usable; and re-preparing the same logical tuple could revive a stale grant. Focused tests now pin all three cases plus mutable-input, inspection-race, page-conflict, attachment-cap, and destroyed-listener cleanup behavior.

Validation

  • 3 focused files / 113 tests
  • 56 main-browser files / 754 tests
  • full typecheck
  • native and type-aware code-quality audits
  • changed-code, reliability-manifest, max-lines, formatting, and diff checks
  • fresh correctness and security/performance rereviews: no publication blockers

Compatibility and rollout

No exchanged field, RPC, capability advertisement, persisted schema, renderer IPC, or production page-preparation/registration/grant caller changes in this PR. Existing local/server/offscreen browsers, older clients, SSH/WSL routes, folder workspaces, and git worktrees retain current placement and behavior. Normal browser Sessions do one bounded lookup and remain on the existing policy path.

This PR must remain inert. Activation still requires exact release/crash teardown, authenticated main-owned registration, real Electron ordering and traffic proof, persisted-worker and network-service recovery, UDP/QUIC/DoH/WebRTC containment, headed/headless/browserless journeys, and physical macOS/Linux/Windows coverage.

Linear: https://linear.app/stably/issue/STA-4150/refactor-remote-browser-to-client-hosted-electron-webviews

Stack: #14471
Parent: #14516

@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-binding branch from 2216c11 to d22339a Compare August 14, 2026 20:02
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-binding branch from d22339a to b17a697 Compare August 14, 2026 20:14
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-binding branch 3 times, most recently from d1e50e1 to ad96515 Compare August 15, 2026 00:44
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-binding branch from ad96515 to 5d7390a Compare August 15, 2026 00:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-binding branch from 5d7390a to d5af2ac Compare August 15, 2026 02:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-binding branch from d5af2ac to 8aba095 Compare August 15, 2026 03:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-binding branch 3 times, most recently from bef7d0d to 6d59260 Compare August 15, 2026 11:34
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-webcontents-binding branch from 6d59260 to 2609608 Compare August 15, 2026 12:30
@OrcaWin

OrcaWin commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Closing because this route WebContents quarantine stage is already implemented on main (a93e31a9339). I reviewed the proposed production patch, body, discussion, and added regression intent against the current modules.

Main retains exact Session recognition, deny-before-admission guest quarantine, blank registration, copied page/renderer/partition identity, opaque authority tokens, separate navigation grant, repeated authority checks, 256-guest bound, and exact destroyed cleanup in the route guest/session registries and extracted lifecycle/registration modules. All 16 introduced test names remain in the current suites.

The later bounded route-popup controller supersedes unconditional popup refusal only for specifically authorized popups; quarantined/rejected guests and stale authorities retain the denial behavior and original regression coverage.

Validation: the six current partition/session/WebContents/main-window suites passed 106 tests with ORCA_BACKGROUND_LAUNCH=1 and two workers. This establishes supersession of this stage; it does not assert all of STA-4150’s original cross-platform activation criteria are complete.

@OrcaWin OrcaWin closed this Oct 26, 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.

2 participants