Add spec for closing from will-navigate listener
This commit is contained in:
parent
1308f790ad
commit
abea1196de
2 changed files with 19 additions and 0 deletions
|
@ -221,3 +221,12 @@ ipcMain.on('set-client-certificate-option', function (event, skip) {
|
|||
})
|
||||
event.returnValue = 'done'
|
||||
})
|
||||
|
||||
ipcMain.on('close-on-will-navigate', (event, id) => {
|
||||
const contents = event.sender
|
||||
const window = BrowserWindow.fromId(id)
|
||||
window.webContents.once('will-navigate', (event, input) => {
|
||||
window.close()
|
||||
contents.send('closed-on-will-navigate')
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue