Skip to content

Commit f4b032a

Browse files
pjh4993claude
andcommitted
fix(webview): gate real popups on window features, not disposition alone
Electron's setWindowOpenHandler reports disposition "new-window" not only for scripted window.open(...) popups but also for shift+clicked links. Keying the allow case on disposition alone meant a shift-clicked link in a web block opened an unmanaged BrowserWindow instead of a Wave web block. OAuth/SSO popups always pass a window-features string (width/height); plain links carry none, so also require a non-empty details.features to allow a real popup. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 50f295f commit f4b032a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

emain/emain-tabview.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,9 @@ export async function getOrCreateWebViewForTab(waveWindowId: string, tabId: stri
325325
// Opener-Policy browsing context. Rerouting them into a new web block breaks both
326326
// (results in ERR_BLOCKED_BY_RESPONSE). Allow a genuine popup window for these; it
327327
// shares wc's session so any auth cookies/tokens remain visible to the webview.
328-
if (details.disposition === "new-window") {
328+
// Gate on a non-empty features string: a shift+click on a plain link also reports
329+
// disposition "new-window" but carries no features, and must keep routing to a web block.
330+
if (details.disposition === "new-window" && details.features !== "") {
329331
return {
330332
action: "allow",
331333
overrideBrowserWindowOptions: { width: 600, height: 700, autoHideMenuBar: true },

0 commit comments

Comments
 (0)