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

* docs: note that new-window event is deprecated

* Update breaking-changes.md

* Update docs/breaking-changes.md

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
This commit is contained in:
trop[bot]
2021-04-08 12:12:45 -04:00
committed by GitHub
parent 32e321cec1
commit a58b5ec3f0

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