diff options
author | Vijay A <avijayr@protonmail.com> | 2021-09-23 08:00:46 +0530 |
---|---|---|
committer | Vijay A <avijayr@protonmail.com> | 2021-09-23 08:00:46 +0530 |
commit | 3a4e7792778b092038b3efb2d39ad656ce791599 (patch) | |
tree | dfc376b4742767f695efbcc609ef064adcaf4419 /recipes/discord/webview.js | |
parent | chore: added more verifications for recipe's package.json (diff) | |
download | ferdium-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/discord/webview.js')
-rw-r--r-- | recipes/discord/webview.js | 6 |
1 files changed, 6 insertions, 0 deletions
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) => { | |||
29 | 29 | ||
30 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | 30 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); |
31 | 31 | ||
32 | // TODO: This whole block is duplicated between the 'discord' and 'skype' recipes - reuse | ||
32 | document.addEventListener('click', event => { | 33 | document.addEventListener('click', event => { |
33 | const link = event.target.closest('a[href^="http"]'); | 34 | const link = event.target.closest('a[href^="http"]'); |
34 | const button = event.target.closest('button[title^="http"]'); | 35 | const button = event.target.closest('button[title^="http"]'); |
@@ -39,12 +40,17 @@ module.exports = (Ferdi, settings) => { | |||
39 | if (url.includes('views/imgpsh_fullsize_anim')) { | 40 | if (url.includes('views/imgpsh_fullsize_anim')) { |
40 | event.preventDefault(); | 41 | event.preventDefault(); |
41 | event.stopPropagation(); | 42 | 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 change the slack recipe to add a clickHandler for screensharing/video calls? (https://github.com/getferdi/ferdi/issues/1697) | ||
42 | let win = new Ferdi.BrowserWindow({ | 45 | let win = new Ferdi.BrowserWindow({ |
43 | width: 800, | 46 | width: 800, |
44 | height: window.innerHeight, | 47 | height: window.innerHeight, |
45 | minWidth: 600, | 48 | minWidth: 600, |
46 | webPreferences: { | 49 | webPreferences: { |
47 | partition: `persist:service-${settings.id}` | 50 | partition: `persist:service-${settings.id}` |
51 | // TODO: Aren't these needed here? | ||
52 | // contextIsolation: false, | ||
53 | // enableRemoteModule: true, | ||
48 | } | 54 | } |
49 | }); | 55 | }); |
50 | win.loadURL(url); | 56 | win.loadURL(url); |