aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/discord/webview.js
diff options
context:
space:
mode:
authorLibravatar Brian Kendall <7917884+briankendall@users.noreply.github.com>2021-09-15 13:11:57 -0400
committerLibravatar GitHub <noreply@github.com>2021-09-15 22:41:57 +0530
commit76535ca9dedd5082a13d83e77d293a03fd429675 (patch)
tree51154bed79f2bb214d4b606727727a03a1dff232 /recipes/discord/webview.js
parent🚀 Add Pipefy Recipe (#711) (diff)
downloadferdium-recipes-76535ca9dedd5082a13d83e77d293a03fd429675.tar.gz
ferdium-recipes-76535ca9dedd5082a13d83e77d293a03fd429675.tar.zst
ferdium-recipes-76535ca9dedd5082a13d83e77d293a03fd429675.zip
Fix images opening in browser instead of in Discord (#712)
Diffstat (limited to 'recipes/discord/webview.js')
-rw-r--r--recipes/discord/webview.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/recipes/discord/webview.js b/recipes/discord/webview.js
index 480329d..9c96f9f 100644
--- a/recipes/discord/webview.js
+++ b/recipes/discord/webview.js
@@ -93,10 +93,10 @@ module.exports = (Ferdi, settings) => {
93 93
94 if (link || button) { 94 if (link || button) {
95 const url = link ? link.getAttribute('href') : button.getAttribute('title'); 95 const url = link ? link.getAttribute('href') : button.getAttribute('title');
96 event.preventDefault();
97 event.stopPropagation();
98 96
99 if (url.includes('views/imgpsh_fullsize_anim')) { 97 if (url.includes('views/imgpsh_fullsize_anim')) {
98 event.preventDefault();
99 event.stopPropagation();
100 let win = new Ferdi.BrowserWindow({ 100 let win = new Ferdi.BrowserWindow({
101 width: 800, 101 width: 800,
102 height: window.innerHeight, 102 height: window.innerHeight,
@@ -109,8 +109,6 @@ module.exports = (Ferdi, settings) => {
109 win.on('closed', () => { 109 win.on('closed', () => {
110 win = null; 110 win = null;
111 }); 111 });
112 } else {
113 window.open(url);
114 } 112 }
115 } 113 }
116 }, true); 114 }, true);