Skip to content

EPIC: Web panes → WebContentsView — replace <webview>, fix browser breakage #128

Description

@kordless

Why

Web panes render with Electron's deprecated <webview> tag (lib/components/web-pane.tsx), which is the root cause of the "some pages break" reports: Cloudflare/bot walls, OAuth popup handoffs, render glitches, black-flash. Migrate to the supported WebContentsView — a native Chromium view the main process positions with setBounds().

Full, code-grounded design (every anchor is a real file:line) lives in plan/webcontentsview-migration.md.

Decisions (locked)

  • Straight replacement, no feature flag — few/no users; upgrade over dual-support.
  • Overlay occlusion = hybrid — persistent header is inset (view never covers it); transient DOM overlays (URL navigator, find bar, spinner, consent modal) use freeze-and-swap (capturePage() → still image while the overlay is up, restore on close).
  • Electron pinned 41.3.0 (WebContentsView available).
  • Reuse configureWebPaneSession() verbatim (the Chrome-UA + sec-ch-ua rewrite) — it's session-level.

Phases

  • Phase 1 — WebPaneManager foundation (create/bounds/visible/destroy, shared session, state push, window-close cleanup since WebContentsView webContents don't self-destruct). Foundation committed 955c9d92 (dormant); renderer swap next.
  • Phase 2 — Navigation + state (back/forward/reload/stop/load; push title/url/loading/canGo*; OAuth + _blank handlers on the owned webContents). Fixes Web pane opened by click/agent is not saved to the chooser URL history #98 (record opening URL on create).
  • Phase 3 — executeJavaScript surface + MCP rewire (bg-color, HTTP status, scrollbar CSS, page-read, sticky extract, ghost cursor/click; route web_pane_content/eval/mouse/click/reload straight to webContents, deleting the renderer round-trip).
  • Phase 4 — Overlays via freeze-swap (UrlNavigator, FindBar + match counts, spinner, pulse editor, consent modal / agent toasts).
  • Phase 5 — Splits + tabs + zoom + DevTools + context menu (per-tab show/hide replacing left:-9999em, live setBounds on split-drag, verify context-menu crash electron#44898, pop-out reparent). Fixes Closing a web pane reverts a sibling web pane to its first page #99 (per-pane persistent view = no remount-to-first-page) and Web pane: right-click → Inspect in a SPLIT (dock DevTools inside the pane, not a detached window) #125 (a real webContents host can dock DevTools in a split — impossible for a <webview> guest).
  • Phase 6 — Remove <webview> + webviewTag, drop @electron/remote web-pane usage + dead web-pane-*-result IPC. Full regression.

Rolled up into this epic (closed)

Related (kept open, cross-linked)

Work lands on canary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions