From db5c37b1147b436493a99d49051c06304b6c7956 Mon Sep 17 00:00:00 2001 From: Arthur Huan Date: Tue, 17 Oct 2023 17:08:02 -0600 Subject: Handle Discord download links within Ferdium (#436) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update webview.js for file downloads * Update package.json * reformat files * Fix request changes --------- Co-authored-by: AndreĢ Oliveira --- recipes/discord/package.json | 2 +- recipes/discord/webview.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'recipes') 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 @@ { "id": "discord", "name": "Discord", - "version": "1.8.0", + "version": "1.8.1", "license": "MIT", "config": { "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) => { event.preventDefault(); event.stopPropagation(); - if (settings.trapLinkClicks === true) { + if ( + // Always open file downloads in Ferdium, rather than the external browser + url.includes('discordapp.com/attachments/') || + settings.trapLinkClicks === true + ) { window.location.href = url; } else { Ferdium.openNewWindow(url); -- cgit v1.2.3-54-g00ecf