aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/skype/webview.js
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-09-23 08:00:46 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-09-23 08:00:46 +0530
commit3a4e7792778b092038b3efb2d39ad656ce791599 (patch)
treedfc376b4742767f695efbcc609ef064adcaf4419 /recipes/skype/webview.js
parentchore: added more verifications for recipe's package.json (diff)
downloadferdium-recipes-3a4e7792778b092038b3efb2d39ad656ce791599.tar.gz
ferdium-recipes-3a4e7792778b092038b3efb2d39ad656ce791599.tar.zst
ferdium-recipes-3a4e7792778b092038b3efb2d39ad656ce791599.zip
fix: updated 'skype' and 'discord' to properly relinquish 'win' object for image overlay
Diffstat (limited to 'recipes/skype/webview.js')
-rw-r--r--recipes/skype/webview.js10
1 files changed, 7 insertions, 3 deletions
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) => {
30 Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); 30 Ferdi.injectCSS(_path.default.join(__dirname, 'service.css'));
31 Ferdi.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); 31 Ferdi.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js'));
32 32
33 // TODO: This whole block is duplicated between the 'discord' and 'skype' recipes - reuse
33 document.addEventListener('click', event => { 34 document.addEventListener('click', event => {
34 const link = event.target.closest('a[href^="http"]'); 35 const link = event.target.closest('a[href^="http"]');
35 const button = event.target.closest('button[title^="http"]'); 36 const button = event.target.closest('button[title^="http"]');
@@ -42,18 +43,21 @@ module.exports = (Ferdi, settings) => {
42 event.stopPropagation(); 43 event.stopPropagation();
43 // 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) 44 // 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)
44 // TODO: Can we change the slack recipe to add a clickHandler for screensharing/video calls? (https://github.com/getferdi/ferdi/issues/1697) 45 // TODO: Can we change the slack recipe to add a clickHandler for screensharing/video calls? (https://github.com/getferdi/ferdi/issues/1697)
45 const win = new Ferdi.BrowserWindow({ 46 let win = new Ferdi.BrowserWindow({
46 width: 800, 47 width: 800,
47 height: window.innerHeight, 48 height: window.innerHeight,
48 minWidth: 600, 49 minWidth: 600,
49 webPreferences: { 50 webPreferences: {
50 partition: `persist:service-${settings.id}`, 51 partition: `persist:service-${settings.id}`
51 // TODO: Aren't these needed here? 52 // TODO: Aren't these needed here?
52 // contextIsolation: false, 53 // contextIsolation: false,
53 // enableRemoteModule: true, 54 // enableRemoteModule: true,
54 }, 55 }
55 }); 56 });
56 win.loadURL(url); 57 win.loadURL(url);
58 win.on('closed', () => {
59 win = null;
60 });
57 } 61 }
58 } 62 }
59 }, true); 63 }, true);