-
Notifications
You must be signed in to change notification settings - Fork 17k
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
22.3.0
What operating system are you using?
Windows
Operating System Version
Windows 10 version 21H2
What arch are you using?
x64
Last Known Working Electron version
22.2.1
Expected Behavior
I've created a custom BrowserView, added it to my main BrowserWindow via addBrowserView(), and navigated its webContents to a file. Upon receiving a message from the renderer process, I attach a handler to the webContents' 'destroyed' event, then close the contents via webContents.close(). Since I'm omitting the 'waitForBeforeUnload' option in my close() call, I expect the 'destroyed' event to be emitted, and my attached handler to run.
Actual Behavior
The 'destroyed' event is not emitted, and my attached handler never run, until my main BrowserWindow is closed.
Testcase Gist URL
https://gist.github.com/mgalla10/cdff38e750ae49d01500445b019493ca
Additional Information
To repro, run the attached gist with v22.2.1 and click the "Close" button. After dismissing a message box saying "Closing page 2", that page will disappear and another "Page 2 closed" message box will appear. Run the gist again with v22.3.0 and notice that after dismissing the first message box, the page doesn't seem to disappear, and the second message box never appears.