diff --git a/electron/src/electron-main.js b/electron/src/electron-main.js index 4053398c5c..b7a6ced29b 100644 --- a/electron/src/electron-main.js +++ b/electron/src/electron-main.js @@ -1,6 +1,5 @@ // @flow -const {app, BrowserWindow} = require('electron'); -const open = require('open'); +const electron = require('electron'); const url = require('url'); const PERMITTED_URL_SCHEMES = [ @@ -19,7 +18,7 @@ function onWindowOrNavigate(ev, target) { // url in a window that has node scripting access. ev.preventDefault(); - // node-open passes the target to open/start/xdg-open, + // openExternal passes the target to open/start/xdg-open, // so put fairly stringent limits on what can be opened // (for instance, open /bin/sh does indeed open a terminal // with a shell, albeit with no arguments) @@ -30,11 +29,12 @@ function onWindowOrNavigate(ev, target) { // of the input string const new_target = url.format(parsed_url); open(new_target); + electron.shell.openExternal(new_target); } } -app.on('ready', () => { - mainWindow = new BrowserWindow({ +electron.app.on('ready', () => { + mainWindow = new electron.BrowserWindow({ icon: `${__dirname}/../../vector/img/logo.png`, width: 1024, height: 768, }); @@ -57,14 +57,14 @@ app.on('ready', () => { mainWindow.webContents.on('will-navigate', onWindowOrNavigate); }); -app.on('window-all-closed', () => { +electron.app.on('window-all-closed', () => { app.quit(); }); -app.on('activate', () => { +electron.app.on('activate', () => { mainWindow.show(); }); -app.on('before-quit', () => { +electron.app.on('before-quit', () => { appQuitting = true; }); diff --git a/package.json b/package.json index 6915b3080c..8e0c55305d 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,6 @@ "matrix-js-sdk": "matrix-org/matrix-js-sdk#develop", "matrix-react-sdk": "matrix-org/matrix-react-sdk#develop", "modernizr": "^3.1.0", - "open": "0.0.5", "q": "^1.4.1", "react": "^15.2.1", "react-dnd": "^2.1.4",