User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36
Steps to reproduce:
In a web worker, trying to instantiate or even reference the FileReader variable throws a ReferenceError:
var worker = new FileReader();
FileReaderSync may be easier to use, but is there really any reason to force developers to use the synchronous file reader in a web worker? Other browsers (like Chrome) allow use of FileReader in web workers.
More importantly, FileReaderSync performance is drastically worse than FileReader when chunking large files:
Though those results were measured in Chrome, similar performance issues were observed in Firefox, though the exact numbers were slightly different.
Between poor performance with FileReaderSync in Chrome/Firefox and the unavailability of FileReader in Firefox, scripts are forced to branch more wildly to use one or the other; for example, see this commit which has to handle using both FileReader and FileReaderSync: https://github.com/mholt/PapaParse/commit/553f5d7e396dd39f155007e9889ff6ba2e3b321a
In any case, FileReader should be exposed in web workers to prevent significant slowdown when reading large files and also to make the API more consistent for developers.
ReferenceError: FileReader is not defined
FileReader should be available in web workers.
Good news, we're almost finished implementing this.
*** This bug has been marked as a duplicate of bug 901097 ***