mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-02 21:12:02 +08:00
Workaround Firefox 98 issue #301
This commit is contained in:
parent
70d6d398be
commit
c121a233d6
1 changed files with 8 additions and 6 deletions
|
@ -24,14 +24,16 @@ dropdownsDetectVisibility = (() =>
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
download = (link, name = "") => {
|
download = (link, name = "") => {
|
||||||
if (ThemeStore.isMobile()) {
|
// Firefox 98 issue https://github.com/the-djmaze/snappymail/issues/301
|
||||||
open(link, '_self');
|
if (ThemeStore.isMobile() || /firefox/i.test(navigator.userAgent)) {
|
||||||
|
open(link, '_blank');
|
||||||
focus();
|
focus();
|
||||||
} else {
|
} else {
|
||||||
const oLink = createElement('a');
|
const oLink = createElement('a', {
|
||||||
oLink.href = link;
|
href: link,
|
||||||
oLink.target = '_blank';
|
target: '_blank',
|
||||||
oLink.download = name;
|
download: name
|
||||||
|
});
|
||||||
doc.body.appendChild(oLink).click();
|
doc.body.appendChild(oLink).click();
|
||||||
oLink.remove();
|
oLink.remove();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue