From fe40a4bcfe653234ed676d8ca2b69f2d355b5356 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 15 Mar 2018 16:34:02 +0700 Subject: [PATCH] Don't open external links in the Electron context --- .../components/dashboard/support/support.js | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/react/src/components/dashboard/support/support.js b/react/src/components/dashboard/support/support.js index e01f339..bbf9942 100644 --- a/react/src/components/dashboard/support/support.js +++ b/react/src/components/dashboard/support/support.js @@ -1,5 +1,6 @@ import React from 'react'; import { translate } from '../../../translate/translate'; +import electron from 'electron'; class Support extends React.Component { constructor() { @@ -7,22 +8,7 @@ class Support extends React.Component { } openExternalWindow(url) { - const remote = window.require('electron').remote; - const BrowserWindow = remote.BrowserWindow; - - const externalWindow = new BrowserWindow({ - width: 1280, - height: 800, - title: `${translate('INDEX.LOADING')}...`, - icon: remote.getCurrentWindow().iguanaIcon, - }); - - externalWindow.loadURL(url); - externalWindow.webContents.on('did-finish-load', () => { - setTimeout(() => { - externalWindow.show(); - }, 40); - }); + return electron.shell.openExternal(url); } render() { @@ -94,4 +80,4 @@ class Support extends React.Component { } } -export default Support; \ No newline at end of file +export default Support;