From 261e3fb410f70231106e2fcf7347a7bbc1ac5676 Mon Sep 17 00:00:00 2001 From: Baltazar Gomez Date: Wed, 1 Aug 2018 14:44:01 -0600 Subject: [PATCH] fix auxclick event (middle click) #1843 --- src/main/createWindow.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/createWindow.js b/src/main/createWindow.js index 976e8352b..5d4beff05 100644 --- a/src/main/createWindow.js +++ b/src/main/createWindow.js @@ -1,4 +1,4 @@ -import { app, BrowserWindow, dialog, screen } from 'electron'; +import { app, BrowserWindow, dialog, shell, screen } from 'electron'; import isDev from 'electron-is-dev'; import windowStateKeeper from 'electron-window-state'; @@ -123,6 +123,11 @@ export default appState => { window.webContents.on('crashed', () => { window = null; }); + + window.webContents.on('new-window', (event, url) => { + event.preventDefault(); + shell.openExternal(url); + }); return window; };