Browse Source

docs: `setWindowOpenHandler` should show object return (#28015)

* Should use object return

* Fix lint

Co-authored-by: Cheng Zhao <[email protected]>
Domenic Horner 4 years ago
parent
commit
46cfb347d7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      docs/api/window-open.md

+ 2 - 2
docs/api/window-open.md

@@ -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) => {