diff --git a/main.js b/main.js index 41aaecbef..a90f8e6ca 100644 --- a/main.js +++ b/main.js @@ -8,6 +8,7 @@ const autoUpdater = require('electron-updater').autoUpdater const autoUpdaterInterval = 60 * 60 * 1000; const ipc = electron.ipcMain; const Menu = electron.Menu; +const shell = electron.shell; app.setAppUserModelId('org.whispersystems.signal-desktop') @@ -77,6 +78,14 @@ function createWindow () { mainWindow.webContents.openDevTools() } + mainWindow.webContents.on('new-window', (e, url) => { + e.preventDefault(); + const protocol = require('url').parse(url).protocol + if (protocol === 'http:' || protocol === 'https:') { + shell.openExternal(url) + } + }) + // Emitted when the window is closed. mainWindow.on('closed', function () { // Dereference the window object, usually you would store windows