Skip to content

A page's own dialog hides its pane's webview alone - #1858

Open
nedtwigg wants to merge 1 commit into
mainfrom
webview-dialog-own-pane
Open

nedtwigg wants to merge 1 commit into
mainfrom
webview-dialog-own-pane

Conversation

@nedtwigg

Copy link
Copy Markdown
Member

A page's alert, confirm, or prompt, and the refused-download notice, now hide only their own pane's webview. Before, each hid every pane webview in the window, as a modal does.

Why

With two webview panes side by side, a page in the pane you are not using could call alert() from a timer. Its prompt froze the page you were typing in to a still and took its keyboard until you answered, and a page could repeat that at will. The review of #1852 raised this and suggested refusing a dialog from any pane but the one in passthrough. That would silently decline a legitimate confirm from a page you started and then left for a terminal, so this takes the narrower fix.

Security rule S308

The rule exists because a native view paints above the DOM, so a page left showing over a prompt could imitate it. This prompt draws inside its own pane's body, and the only view that can sit over that is the pane's own, which the panel still hides in the same commit that mounts the prompt. docs/specs/security-local.md now says so, and docs/specs/webview-pane.md -> "Visibility" names the exception. A modal, menu, or the new-tab prompt still hides every view.

Verified

  • WebviewPanel.test.tsx: a dialog and the download notice each hide their own view and leave the shared occlusion off. Removing either condition fails a test.
  • pnpm test:checks, tsc -b, spec and markdown lints pass.
  • Not run in the app. macOS only; Windows shows the engine's own dialogs.

🤖 Generated with Claude Code

The prompt draws inside its pane's body, so no other pane's view can sit
over it. Hiding them all let a page in one pane freeze, and take the
keyboard from, the page the user was typing in.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5b20b64
Status: ✅  Deploy successful!
Preview URL: https://5a051a0e.mouseterm.pages.dev
Branch Preview URL: https://webview-dialog-own-pane.mouseterm.pages.dev

View logs

This branch has not been deployed

No deployments
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