mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: beforeunload and unload firing in BrowserViews (#28382)
* fix: beforeunload and unload firing in BrowserViews * Ensure UserGesture is sent for BV webContents * spec: add tests * refactor: clean up logic * spec: fixup specs * docs: document event behavior for BrowserViews
This commit is contained in:
@@ -375,6 +375,8 @@ win.webContents.on('will-prevent-unload', (event) => {
|
||||
})
|
||||
```
|
||||
|
||||
**Note:** This will be emitted for `BrowserViews` but will _not_ be respected - this is because we have chosen not to tie the `BrowserView` lifecycle to its owning BrowserWindow should one exist per the [specification](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event).
|
||||
|
||||
#### Event: 'crashed' _Deprecated_
|
||||
|
||||
Returns:
|
||||
|
||||
Reference in New Issue
Block a user