Fix example code
This commit is contained in:
parent
197ad915b7
commit
035d9df29b
1 changed files with 2 additions and 2 deletions
|
@ -163,11 +163,11 @@ new `BrowserWindow`. If you call `event.preventDefault()` and manually create a
|
|||
instance, failing to do so may result in unexpected behavior. For example:
|
||||
|
||||
```javascript
|
||||
myBrowserWindow.webContents.on('new-window', event => {
|
||||
myBrowserWindow.webContents.on('new-window', (event, url) => {
|
||||
event.preventDefault()
|
||||
const win = new BrowserWindow({ show: false })
|
||||
win.once('ready-to-show', () => win.show())
|
||||
win.loadURL(event.url)
|
||||
win.loadURL(url)
|
||||
event.newGuest = win
|
||||
});
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue