aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Prasanna <mail.prasanna.v@gmail.com>2021-05-31 23:13:01 +0530
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-06-01 13:55:17 +0530
commitbf549e0fd86f742a2ce1986ec5fdb3acd6235a6f (patch)
tree78c7ed0d1ae8b022beca3de854bea81e4f234364
parentRe-generated 'package-lock.json' (diff)
downloadferdi-bf549e0fd86f742a2ce1986ec5fdb3acd6235a6f.tar.gz
ferdi-bf549e0fd86f742a2ce1986ec5fdb3acd6235a6f.tar.zst
ferdi-bf549e0fd86f742a2ce1986ec5fdb3acd6235a6f.zip
ipc messages will allow only JS objects, replacing browser event with neeeded attrs
-rw-r--r--src/index.js2
-rw-r--r--src/models/Service.js6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/index.js b/src/index.js
index 2586d779..018bdc05 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
441ipcMain.on('open-browser-window', (e, { disposition, url }, serviceId) => { 441ipcMain.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 b76e92a5..796734e4 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,