[Bug]: window.close() destroys all child BrowserView-s even if window's 'beforeunload' handler has 'e.returnValue = false' #37162
Labels
22-x-y
23-x-y
bug 🪲
component/BrowserView
component/webcontents
crash 💥
has-repro-gist
Issue can be reproduced with code at https://gist.github.com/
status/confirmed
A maintainer reproduced the bug or agreed with the feature
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.
The text was updated successfully, but these errors were encountered: