aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Arthur Huan <c.arthurh@outlook.com>2023-10-17 17:08:02 -0600
committerLibravatar GitHub <noreply@github.com>2023-10-18 00:08:02 +0100
commitdb5c37b1147b436493a99d49051c06304b6c7956 (patch)
treec61003ff2bb5b7410786e9d5f595b0702e9072c9
parentadd nikolaykhodov as a contributor for code (#440) (diff)
downloadferdium-recipes-db5c37b1147b436493a99d49051c06304b6c7956.tar.gz
ferdium-recipes-db5c37b1147b436493a99d49051c06304b6c7956.tar.zst
ferdium-recipes-db5c37b1147b436493a99d49051c06304b6c7956.zip
Handle Discord download links within Ferdium (#436)
* Update webview.js for file downloads * Update package.json * reformat files * Fix request changes --------- Co-authored-by: AndreĢ Oliveira <oliveira.andrerodrigues95@gmail.com>
-rw-r--r--recipes/discord/package.json2
-rw-r--r--recipes/discord/webview.js6
2 files changed, 6 insertions, 2 deletions
diff --git a/recipes/discord/package.json b/recipes/discord/package.json
index aed5e15..4371c3c 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.8.0", 4 "version": "1.8.1",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "serviceURL": "https://discord.com/login", 7 "serviceURL": "https://discord.com/login",
diff --git a/recipes/discord/webview.js b/recipes/discord/webview.js
index ef56336..052ddac 100644
--- a/recipes/discord/webview.js
+++ b/recipes/discord/webview.js
@@ -52,7 +52,11 @@ module.exports = (Ferdium, settings) => {
52 event.preventDefault(); 52 event.preventDefault();
53 event.stopPropagation(); 53 event.stopPropagation();
54 54
55 if (settings.trapLinkClicks === true) { 55 if (
56 // Always open file downloads in Ferdium, rather than the external browser
57 url.includes('discordapp.com/attachments/') ||
58 settings.trapLinkClicks === true
59 ) {
56 window.location.href = url; 60 window.location.href = url;
57 } else { 61 } else {
58 Ferdium.openNewWindow(url); 62 Ferdium.openNewWindow(url);