From c121a233d610514777187835d37f1737d5882b28 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Thu, 24 Mar 2022 11:28:01 +0100 Subject: [PATCH] Workaround Firefox 98 issue #301 --- dev/Common/UtilsUser.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dev/Common/UtilsUser.js b/dev/Common/UtilsUser.js index 19a433375..23566440b 100644 --- a/dev/Common/UtilsUser.js +++ b/dev/Common/UtilsUser.js @@ -24,14 +24,16 @@ dropdownsDetectVisibility = (() => * @returns {boolean} */ download = (link, name = "") => { - if (ThemeStore.isMobile()) { - open(link, '_self'); + // Firefox 98 issue https://github.com/the-djmaze/snappymail/issues/301 + if (ThemeStore.isMobile() || /firefox/i.test(navigator.userAgent)) { + open(link, '_blank'); focus(); } else { - const oLink = createElement('a'); - oLink.href = link; - oLink.target = '_blank'; - oLink.download = name; + const oLink = createElement('a', { + href: link, + target: '_blank', + download: name + }); doc.body.appendChild(oLink).click(); oLink.remove(); }