docs: setWindowOpenHandler should show object return (#28015)

* Should use object return

* Fix lint

Co-authored-by: Cheng Zhao <github@zcbenz.com>
This commit is contained in:
Domenic Horner
2021-03-08 08:56:07 +08:00
committed by GitHub
parent f4e1a343b9
commit 46cfb347d7

View File

@@ -83,9 +83,9 @@ const mainWindow = new BrowserWindow()
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
if (url.startsWith('https://github.com/')) {
return true
return { action: 'allow' }
}
return false
return { action: 'deny' }
})
mainWindow.webContents.on('did-create-window', (childWindow) => {