diff options
author | 2023-10-17 17:08:02 -0600 | |
---|---|---|
committer | 2023-10-18 00:08:02 +0100 | |
commit | db5c37b1147b436493a99d49051c06304b6c7956 (patch) | |
tree | c61003ff2bb5b7410786e9d5f595b0702e9072c9 /recipes/discord/webview.js | |
parent | add nikolaykhodov as a contributor for code (#440) (diff) | |
download | ferdium-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>
Diffstat (limited to 'recipes/discord/webview.js')
-rw-r--r-- | recipes/discord/webview.js | 6 |
1 files changed, 5 insertions, 1 deletions
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); |