From cc9b4dd968702b23e767af17213779b2b36da187 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 8 Mar 2021 11:49:02 -0500 Subject: [PATCH] docs: `setWindowOpenHandler` should show object return (#28035) * Should use object return * Fix lint Co-authored-by: Domenic Horner Co-authored-by: Cheng Zhao --- docs/api/window-open.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/window-open.md b/docs/api/window-open.md index 8ff7aae726..c235deea79 100644 --- a/docs/api/window-open.md +++ b/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) => {