docs: note that new-window event is deprecated (#28549)

* docs: note that new-window event is deprecated

* Update breaking-changes.md

* Update docs/breaking-changes.md
This commit is contained in:
Jeremy Rose 2021-04-08 07:52:14 -07:00 committed by GitHub
parent 16b0d1fbdd
commit c428ec5cd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -136,6 +136,22 @@ systemPreferences.isHighContrastColorScheme()
nativeTheme.shouldUseHighContrastColors
```
### Deprecated: WebContents `new-window` event
The `new-window` event of WebContents has been deprecated. It is replaced by [`webContents.setWindowOpenHandler()`](api/web-contents.md#contentssetwindowopenhandlerhandler).
```js
// Deprecated in Electron 13
webContents.on('new-window', (event) => {
event.preventDefault()
})
// Replace with
webContents.setWindowOpenHandler((details) => {
return { action: 'deny' }
})
```
## Planned Breaking API Changes (12.0)
### Removed: Pepper Flash support