From 39aa9e0d2a80757a9aac851057b65b2a893c50b9 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 16 Feb 2020 23:09:12 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E7=BC=96=E8=BE=91=E5=99=A8=E5=86=85?= =?UTF-8?q?=E9=98=BB=E6=AD=A2=E6=89=93=E5=BC=80=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/electron/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/electron/main.js b/app/electron/main.js index 7bd56d0..090ba48 100644 --- a/app/electron/main.js +++ b/app/electron/main.js @@ -137,11 +137,11 @@ app.on('will-quit', () => { }) // 在编辑器内打开链接的处理 -app.on('web-contents-created', function (webContentsCreatedEvent, contents) { +app.on('web-contents-created', (webContentsCreatedEvent, contents) => { if (contents.getType() === 'webview') { - contents.on('new-window', function (newWindowEvent, url) { - console.log('block'); + contents.on('new-window', (newWindowEvent, url) => { newWindowEvent.preventDefault(); + shell.openExternal(url); }); } }); \ No newline at end of file