Skip to content

[Bug]: window.close() destroys all child BrowserView-s even if window's 'beforeunload' handler has 'e.returnValue = false' #37162

@YauheniBH-EF

Description

@YauheniBH-EF

Preflight Checklist

Electron Version

22.2.0

What operating system are you using?

Windows

Operating System Version

Windows 10

What arch are you using?

x64

Last Known Working Electron version

21.4.1

Expected Behavior

If 'beforeunload' event listener for a window has

event.returnValue = false

non of it's child Browser Views are destroyed/closed

Actual Behavior

If 'beforeunload' event listener for a window has

event.returnValue = false

all of it's child Browser Views will be detroyed

Testcase Gist URL

https://gist.github.com/YauheniBH-EF/190ea8ff42c09a15763705ed4647b02e

Additional Information

I have a feeling that it's related to #35509 this PR changes, but i'm not proficient enough in Electron/C++ to check/fix it by myself.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions