mirror of
https://github.com/electron/electron.git
synced 2026-01-10 16:08:06 -05:00
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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user