eligrey / eligrey/FileSaver.js

Can't save multiple files in Safari

Open
#729 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
22k
Forks
4.3k
PR merge metrics
No merged PRs in 30d

Description

Running this code only saves `file2.txt` and not `file1.txt` in Safari (but works both in Chrome ans Firefox):
```js
saveAs(
new Blob(['File one'], { type: 'text/plain;charset=utf-8' }),
'file1.txt'
);
saveAs(
new Blob(['File two'], { type: 'text/plain;charset=utf-8' }),
'file2.txt'
);
```

Is it known/expected or some bug? Works with setTimeout:
```js
saveAs(
new Blob(['File one'], { type: 'text/plain;charset=utf-8' }),
'file1.txt'
);
setTimeout(() => {
saveAs(
new Blob(['File two'], { type: 'text/plain;charset=utf-8' }),
'file2.txt'
);
}, 0);
```

OS: Mac 11.5.2
Safari: Version 15.0 (16612.1.29.41.4, 16612)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.