diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/index.js | 14 | ||||
-rw-r--r-- | src/models/Service.js | 14 |
2 files changed, 12 insertions, 16 deletions
diff --git a/src/index.js b/src/index.js index 018bdc059..21cf61c0c 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -438,14 +438,12 @@ ipcMain.on('feature-basic-auth-credentials', (e, { user, password }) => { | |||
438 | authCallback = noop; | 438 | authCallback = noop; |
439 | }); | 439 | }); |
440 | 440 | ||
441 | ipcMain.on('open-browser-window', (e, { disposition, url, serviceId }) => { | 441 | ipcMain.on('open-browser-window', (e, { url, serviceId }) => { |
442 | if (disposition === 'foreground-tab') { | 442 | const serviceSession = session.fromPartition(`persist:service-${serviceId}`); |
443 | const serviceSession = session.fromPartition(`persist:service-${serviceId}`); | 443 | const child = new BrowserWindow({ parent: mainWindow, webPreferences: { session: serviceSession } }); |
444 | const child = new BrowserWindow({ parent: mainWindow, webPreferences: { session: serviceSession } }); | 444 | child.show(); |
445 | child.show(); | 445 | child.loadURL(url); |
446 | child.loadURL(url); | 446 | debug('Received open-browser-window', url); |
447 | } | ||
448 | debug('Received open-browser-window', disposition, url); | ||
449 | }); | 447 | }); |
450 | 448 | ||
451 | ipcMain.on('modifyRequestHeaders', (e, { modifiedRequestHeaders, serviceId }) => { | 449 | ipcMain.on('modifyRequestHeaders', (e, { modifiedRequestHeaders, serviceId }) => { |
diff --git a/src/models/Service.js b/src/models/Service.js index e7efbe30e..b01881beb 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -291,23 +291,21 @@ export default class Service { | |||
291 | if (!isValidExternalURL(event.url)) { | 291 | if (!isValidExternalURL(event.url)) { |
292 | return; | 292 | return; |
293 | } | 293 | } |
294 | if (event.disposition === 'foreground-tab') { | 294 | if (event.disposition === 'foreground-tab' || event.disposition === 'background-tab') { |
295 | ipcRenderer.send('open-browser-window', { | ||
296 | disposition: event.disposition, | ||
297 | url: event.url, | ||
298 | serviceId: this.id, | ||
299 | }); | ||
300 | } else { | ||
301 | openWindow({ | 295 | openWindow({ |
302 | event, | 296 | event, |
303 | url, | 297 | url, |
304 | frameName, | 298 | frameName, |
305 | options, | 299 | options, |
306 | }); | 300 | }); |
301 | } else { | ||
302 | ipcRenderer.send('open-browser-window', { | ||
303 | url: event.url, | ||
304 | serviceId: this.id, | ||
305 | }); | ||
307 | } | 306 | } |
308 | }); | 307 | }); |
309 | 308 | ||
310 | |||
311 | this.webview.addEventListener('will-navigate', event => handleUserAgent(event.url, true)); | 309 | this.webview.addEventListener('will-navigate', event => handleUserAgent(event.url, true)); |
312 | 310 | ||
313 | this.webview.addEventListener('did-start-loading', (event) => { | 311 | this.webview.addEventListener('did-start-loading', (event) => { |