[Bug]: Calling preventDefault on BrowserWindow close event still destroys BrowserViews' webContents #42033
Open
3 tasks done
Labels
30-x-y
31-x-y
bug 🪲
bug/regression ↩️
A new version of Electron broke something
component/BrowserView
component/WebContentsView
has-repro-gist
Issue can be reproduced with code at https://gist.github.com/
Preflight Checklist
Electron Version
30.0.0
What operating system are you using?
macOS
Operating System Version
Sonoma 14.4.1
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
29.3.2
Expected Behavior
Calling
preventDefault
on a BrowserWindow close event should not destroy the window's BrowserViews's webContents.Actual Behavior
BrowserWindow close event destroys all BrowserViews' webContents, even when
preventDefault
is called.In the attached jist, on versions of electron < v30, I'm able to close the app window and reopen the app by clicking on the Electron app in the dock. After version 30, reopening the app shows a completely blank window.
App after reopening on Electron <30
App after reopening on Electron 30
Testcase Gist URL
https://gist.github.com/yangannyx/0f758e003426f3829cb791aa3c51ac4d
Additional Information
No response
The text was updated successfully, but these errors were encountered: