mirror of
https://github.com/nexu-io/open-design.git
synced 2026-06-01 03:14:35 +07:00
fix(desktop): allow about:blank popup for PDF export fallback (#1081)
The renderer's PDF export fallback uses window.open('', '_blank')
to open a blank window that is then navigated to a Blob URL.
Electron's setWindowOpenHandler only allowed blob: and od: protocols,
so about:blank was denied and the user saw a "Popup blocked" alert.
Fix: add about:blank to the allowed child window URL whitelist.
Co-authored-by: Ken <hitken@users.noreply.github.com>
This commit is contained in:
parent
9079c51ba3
commit
13005f4fea
1 changed files with 9 additions and 1 deletions
|
|
@ -584,7 +584,15 @@ export function isAllowedChildWindowUrl(url: string): boolean {
|
|||
// its links resolve to `http://127.0.0.1:.../...`, which is gated
|
||||
// by the separate `isHttpUrl` branch and continues to open in the
|
||||
// user's external browser via `shell.openExternal`.
|
||||
return parsed.protocol === "blob:" || parsed.protocol === "od:";
|
||||
// `about:blank` is used by the renderer's PDF export fallback path:
|
||||
// `window.open('', '_blank')` opens a blank window that is then
|
||||
// navigated to a Blob URL. Without this, the empty URL is denied
|
||||
// and the user sees a "Popup blocked" alert.
|
||||
return (
|
||||
parsed.protocol === "blob:" ||
|
||||
parsed.protocol === "od:" ||
|
||||
(parsed.protocol === "about:" && parsed.pathname === "blank")
|
||||
);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue