Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
YauheniBH-EF opened this issue Feb 7, 2023 · 1 comment · Fixed by #37205
Assignees
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

Comments

@YauheniBH-EF
Copy link

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.

@codebytere codebytere self-assigned this Feb 9, 2023
@codebytere codebytere added crash 💥 component/BrowserView component/webcontents 22-x-y 23-x-y status/confirmed A maintainer reproduced the bug or agreed with the feature has-repro-gist Issue can be reproduced with code at https://gist.github.com/ labels Feb 9, 2023
@YauheniBH-EF
Copy link
Author

@codebytere thank you very much for looking into the issue and potentially fixing it so fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants