eligrey / FileSaver.js

An HTML5 saveAs() FileSaver implementation
https://eligrey.com/blog/saving-generated-files-on-the-client-side/
Other
21.39k stars 4.38k forks source link

Console log an error when saveAs is called from a web worker #779

Open TheBatmanofButler opened 1 year ago

TheBatmanofButler commented 1 year ago

Currently if you try to run saveAs from a web worker, it fails silently. Instead we should send an error to the console to communicate that saveAs can only be called from the main thread.

Fixes https://github.com/eligrey/FileSaver.js/issues/778.