Workaround Firefox 98 issue #301

This commit is contained in:
the-djmaze 2022-03-24 11:28:01 +01:00
parent 70d6d398be
commit c121a233d6

View file

@ -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();
}