Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox -- "FileReader is not defined" only when called from Web Worker

In Firefox, the following code works correctly when run in the main browser thread as normal--

var fr = new FileReader();

..but when run from a web worker, the following error is thrown:

FileReader is not defined

The same code works fine in Chrome and Safari.

Any suggestions for supporting FileReader in a web worker in Firefox?

like image 746
Stu Blair Avatar asked Mar 30 '14 07:03

Stu Blair


1 Answers

As adeneo pointed out, it seems that FileReader is simply not supported by Firefox in Web Workers. I was able to use FileReaderSync instead to accomplish what I needed.

like image 149
Stu Blair Avatar answered Oct 24 '22 22:10

Stu Blair