Skip to content

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

Closed

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.

Activity

  1. self-assigned this
    on Feb 9, 2023
  2. added
    status/confirmed
    has-repro-gist
    on Feb 9, 2023
  3. YauheniBH-EF commented on Feb 13, 2023

    @YauheniBH-EF
    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

Metadata

Metadata

Assignees

Labels

22-x-y23-x-ybug 🪲component/BrowserViewcomponent/webcontentscrash 💥has-repro-giststatus/confirmed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions