aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/discord
diff options
context:
space:
mode:
authorLibravatar André Oliveira <37463445+SpecialAro@users.noreply.github.com>2022-05-31 16:07:41 +0100
committerLibravatar GitHub <noreply@github.com>2022-05-31 16:07:41 +0100
commit804aafb265e93c50abcb4d2c28e0ddfab16a36bb (patch)
treed11dd6abab6c98b19b617c3c4de1815122fe2888 /recipes/discord
parentChange of Proton Service URL (#36) (diff)
downloadferdium-recipes-804aafb265e93c50abcb4d2c28e0ddfab16a36bb.tar.gz
ferdium-recipes-804aafb265e93c50abcb4d2c28e0ddfab16a36bb.tar.zst
ferdium-recipes-804aafb265e93c50abcb4d2c28e0ddfab16a36bb.zip
Fix open image in app or externally (instead of popup) (#37)
Fix #195 on Ferdium-app which causes a problem when opening images inside the discord (and possibly zoom).
Diffstat (limited to 'recipes/discord')
-rw-r--r--recipes/discord/package.json2
-rw-r--r--recipes/discord/webview.js19
2 files changed, 11 insertions, 10 deletions
diff --git a/recipes/discord/package.json b/recipes/discord/package.json
index e0c35aa..f5549d7 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.7.3", 4 "version": "1.7.4",
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 cadafb1..1255675 100644
--- a/recipes/discord/webview.js
+++ b/recipes/discord/webview.js
@@ -5,7 +5,6 @@ function _interopRequireDefault(obj) {
5} 5}
6 6
7module.exports = (Ferdium, settings) => { 7module.exports = (Ferdium, settings) => {
8 console.log('settings', settings);
9 const getMessages = () => { 8 const getMessages = () => {
10 let directCount = 0; 9 let directCount = 0;
11 const directCountPerServer = document.querySelectorAll( 10 const directCountPerServer = document.querySelectorAll(
@@ -34,14 +33,16 @@ module.exports = (Ferdium, settings) => {
34 33
35 if (link || button) { 34 if (link || button) {
36 const url = link ? link.getAttribute('href') : button.getAttribute('title'); 35 const url = link ? link.getAttribute('href') : button.getAttribute('title');
37 36
38 event.preventDefault(); 37 if (!Ferdium.isImage(url)) {
39 event.stopPropagation(); 38 event.preventDefault();
40 39 event.stopPropagation();
41 if (settings.trapLinkClicks === true) { 40
42 window.location.href = url; 41 if (settings.trapLinkClicks === true) {
43 } else { 42 window.location.href = url;
44 Ferdium.openNewWindow(url); 43 } else {
44 Ferdium.openNewWindow(url);
45 }
45 } 46 }
46 } 47 }
47 }, true); 48 }, true);