From 223677e4628f547a2c4bc17f713f644a405a5763 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 25 Nov 2022 10:00:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:recycle:=20Electron=20new-window=20?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/electron/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/electron/main.js b/app/electron/main.js index d71e45a93..961b29a96 100644 --- a/app/electron/main.js +++ b/app/electron/main.js @@ -783,6 +783,11 @@ app.on('web-contents-created', (webContentsCreatedEvent, contents) => { newWindowEvent.preventDefault() shell.openExternal(url) }) + + contents.setWindowOpenHandler((details) => { + shell.openExternal(details.url) + return {action: 'deny',} + }) }) app.on('before-quit', (event) => { From b251d18f8a4bad8f976bfdfcd902b907883a04b2 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 25 Nov 2022 10:01:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?:recycle:=20Electron=20new-window=20?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/electron/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/electron/main.js b/app/electron/main.js index 961b29a96..c9ab0f8dd 100644 --- a/app/electron/main.js +++ b/app/electron/main.js @@ -786,7 +786,7 @@ app.on('web-contents-created', (webContentsCreatedEvent, contents) => { contents.setWindowOpenHandler((details) => { shell.openExternal(details.url) - return {action: 'deny',} + return {action: 'deny'} }) })