From 3a4e7792778b092038b3efb2d39ad656ce791599 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Thu, 23 Sep 2021 08:00:46 +0530 Subject: fix: updated 'skype' and 'discord' to properly relinquish 'win' object for image overlay --- recipes/discord/package.json | 2 +- recipes/discord/webview.js | 6 ++++++ recipes/skype/package.json | 2 +- recipes/skype/webview.js | 10 +++++++--- 4 files changed, 15 insertions(+), 5 deletions(-) (limited to 'recipes') diff --git a/recipes/discord/package.json b/recipes/discord/package.json index ae1ba0c..a9fe8dd 100644 --- a/recipes/discord/package.json +++ b/recipes/discord/package.json @@ -1,7 +1,7 @@ { "id": "discord", "name": "Discord", - "version": "1.4.3", + "version": "1.4.4", "license": "MIT", "config": { "serviceURL": "https://discordapp.com/login", diff --git a/recipes/discord/webview.js b/recipes/discord/webview.js index 5a9f55a..2687948 100644 --- a/recipes/discord/webview.js +++ b/recipes/discord/webview.js @@ -29,6 +29,7 @@ module.exports = (Ferdi, settings) => { Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); + // TODO: This whole block is duplicated between the 'discord' and 'skype' recipes - reuse document.addEventListener('click', event => { const link = event.target.closest('a[href^="http"]'); const button = event.target.closest('button[title^="http"]'); @@ -39,12 +40,17 @@ module.exports = (Ferdi, settings) => { if (url.includes('views/imgpsh_fullsize_anim')) { event.preventDefault(); event.stopPropagation(); + // TODO: Can we send an ipc event 'open-browser-window' to open the child window? (see the slack recipe for how to send an ipc message) + // TODO: Can we change the slack recipe to add a clickHandler for screensharing/video calls? (https://github.com/getferdi/ferdi/issues/1697) let win = new Ferdi.BrowserWindow({ width: 800, height: window.innerHeight, minWidth: 600, webPreferences: { partition: `persist:service-${settings.id}` + // TODO: Aren't these needed here? + // contextIsolation: false, + // enableRemoteModule: true, } }); win.loadURL(url); diff --git a/recipes/skype/package.json b/recipes/skype/package.json index d824a57..9aa8686 100644 --- a/recipes/skype/package.json +++ b/recipes/skype/package.json @@ -1,7 +1,7 @@ { "id": "skype", "name": "Skype", - "version": "3.2.1", + "version": "3.2.2", "license": "MIT", "config": { "serviceURL": "https://web.skype.com/", diff --git a/recipes/skype/webview.js b/recipes/skype/webview.js index 18b63a5..d9775dd 100644 --- a/recipes/skype/webview.js +++ b/recipes/skype/webview.js @@ -30,6 +30,7 @@ module.exports = (Ferdi, settings) => { Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); Ferdi.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); + // TODO: This whole block is duplicated between the 'discord' and 'skype' recipes - reuse document.addEventListener('click', event => { const link = event.target.closest('a[href^="http"]'); const button = event.target.closest('button[title^="http"]'); @@ -42,18 +43,21 @@ module.exports = (Ferdi, settings) => { event.stopPropagation(); // TODO: Can we send an ipc event 'open-browser-window' to open the child window? (see the slack recipe for how to send an ipc message) // TODO: Can we change the slack recipe to add a clickHandler for screensharing/video calls? (https://github.com/getferdi/ferdi/issues/1697) - const win = new Ferdi.BrowserWindow({ + let win = new Ferdi.BrowserWindow({ width: 800, height: window.innerHeight, minWidth: 600, webPreferences: { - partition: `persist:service-${settings.id}`, + partition: `persist:service-${settings.id}` // TODO: Aren't these needed here? // contextIsolation: false, // enableRemoteModule: true, - }, + } }); win.loadURL(url); + win.on('closed', () => { + win = null; + }); } } }, true); -- cgit v1.2.3-54-g00ecf