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:
parent
16b0d1fbdd
commit
c428ec5cd5
1 changed files with 16 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue