diff options
author | 2021-05-31 23:13:01 +0530 | |
---|---|---|
committer | 2021-06-01 13:55:17 +0530 | |
commit | bf549e0fd86f742a2ce1986ec5fdb3acd6235a6f (patch) | |
tree | 78c7ed0d1ae8b022beca3de854bea81e4f234364 | |
parent | Re-generated 'package-lock.json' (diff) | |
download | ferdium-app-bf549e0fd86f742a2ce1986ec5fdb3acd6235a6f.tar.gz ferdium-app-bf549e0fd86f742a2ce1986ec5fdb3acd6235a6f.tar.zst ferdium-app-bf549e0fd86f742a2ce1986ec5fdb3acd6235a6f.zip |
ipc messages will allow only JS objects, replacing browser event with neeeded attrs
-rw-r--r-- | src/index.js | 2 | ||||
-rw-r--r-- | src/models/Service.js | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/index.js b/src/index.js index 2586d7799..018bdc059 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -438,7 +438,7 @@ 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, { disposition, url, serviceId }) => { |
442 | if (disposition === 'foreground-tab') { | 442 | if (disposition === 'foreground-tab') { |
443 | const serviceSession = session.fromPartition(`persist:service-${serviceId}`); | 443 | const serviceSession = session.fromPartition(`persist:service-${serviceId}`); |
444 | const child = new BrowserWindow({ parent: mainWindow, webPreferences: { session: serviceSession } }); | 444 | const child = new BrowserWindow({ parent: mainWindow, webPreferences: { session: serviceSession } }); |
diff --git a/src/models/Service.js b/src/models/Service.js index b76e92a53..796734e41 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -288,7 +288,11 @@ export default class Service { | |||
288 | this.webview.addEventListener('new-window', (event, url, frameName, options) => { | 288 | this.webview.addEventListener('new-window', (event, url, frameName, options) => { |
289 | debug('new-window', event, url, frameName, options); | 289 | debug('new-window', event, url, frameName, options); |
290 | if (event.disposition === 'foreground-tab') { | 290 | if (event.disposition === 'foreground-tab') { |
291 | ipcRenderer.send('open-browser-window', event, this.id); | 291 | ipcRenderer.send('open-browser-window', { |
292 | disposition: event.disposition, | ||
293 | url: event.url, | ||
294 | serviceId: this.id, | ||
295 | }); | ||
292 | } else { | 296 | } else { |
293 | openWindow({ | 297 | openWindow({ |
294 | event, | 298 | event, |