Browse Source

Fixed problem related with Auth0 windows

The problem was related with "start_minimized" option. If the user had
in "true", Auth0 windows will not work.
pull/884/head
Ramiro Saenz 8 years ago
parent
commit
fee8cb7544
  1. 14
      electron/main.js

14
electron/main.js

@ -162,12 +162,24 @@ function createWindow () {
// Open links in default browser // Open links in default browser
mainWindow.webContents.on('new-window', function(e, url, frameName, disposition, options) { mainWindow.webContents.on('new-window', function(e, url, frameName, disposition, options) {
if ( disposition !== 'foreground-tab' ) return;
const protocol = require('url').parse(url).protocol; const protocol = require('url').parse(url).protocol;
switch ( disposition ) {
case 'new-window':
e.preventDefault();
const win = new BrowserWindow(options);
win.once('ready-to-show', () => win.show());
win.loadURL(url);
e.newGuest = win;
break;
case 'foreground-tab':
if (protocol === 'http:' || protocol === 'https:' || protocol === 'mailto:') { if (protocol === 'http:' || protocol === 'https:' || protocol === 'mailto:') {
e.preventDefault(); e.preventDefault();
shell.openExternal(url); shell.openExternal(url);
} }
break;
default:
break;
}
}); });
mainWindow.webContents.on('will-navigate', function(event, url) { mainWindow.webContents.on('will-navigate', function(event, url) {

Loading…
Cancel
Save