fix: window.open popups are always resizable (#47540)

fix: window.open popups are always resizable

Closes https://github.com/electron/electron/issues/43591.

Per current WHATWG spec, the `window.open` API should always
create a resizable popup window. This change updates the
`parseFeaturesString` function to ensure that windows opened
with `window.open` are always resizable, regardless of the
`resizable` feature string.
This commit is contained in:
Shelley Vohr 2025-07-02 15:02:59 +02:00 committed by GitHub
commit 655037fbdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 0 deletions

View file

@ -91,6 +91,12 @@ export function parseFeatures (features: string) {
delete parsed[key];
}
// Per spec - https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-open-dev
// windows are always resizable.
if (parsed.resizable !== undefined) {
delete parsed.resizable;
}
if (parsed.left !== undefined) parsed.x = parsed.left;
if (parsed.top !== undefined) parsed.y = parsed.top;