diff options
author | Brian Kendall <7917884+briankendall@users.noreply.github.com> | 2021-09-15 13:11:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-15 22:41:57 +0530 |
commit | 76535ca9dedd5082a13d83e77d293a03fd429675 (patch) | |
tree | 51154bed79f2bb214d4b606727727a03a1dff232 | |
parent | 🚀 Add Pipefy Recipe (#711) (diff) | |
download | ferdium-recipes-76535ca9dedd5082a13d83e77d293a03fd429675.tar.gz ferdium-recipes-76535ca9dedd5082a13d83e77d293a03fd429675.tar.zst ferdium-recipes-76535ca9dedd5082a13d83e77d293a03fd429675.zip |
Fix images opening in browser instead of in Discord (#712)
-rw-r--r-- | all.json | 2 | ||||
-rw-r--r-- | recipes/discord/package.json | 2 | ||||
-rw-r--r-- | recipes/discord/webview.js | 6 |
3 files changed, 4 insertions, 6 deletions
@@ -297,7 +297,7 @@ | |||
297 | "featured": true, | 297 | "featured": true, |
298 | "id": "discord", | 298 | "id": "discord", |
299 | "name": "Discord", | 299 | "name": "Discord", |
300 | "version": "1.4.0", | 300 | "version": "1.4.1", |
301 | "icons": { | 301 | "icons": { |
302 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/discord/icon.svg" | 302 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/discord/icon.svg" |
303 | } | 303 | } |
diff --git a/recipes/discord/package.json b/recipes/discord/package.json index 73a859c..c644d66 100644 --- a/recipes/discord/package.json +++ b/recipes/discord/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "discord", | 2 | "id": "discord", |
3 | "name": "Discord", | 3 | "name": "Discord", |
4 | "version": "1.4.0", | 4 | "version": "1.4.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://discordapp.com/login", | 7 | "serviceURL": "https://discordapp.com/login", |
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); |