Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use FileReaderSync instead of FileReader in Firefox / when FileReader is not available #16

Open
D8207 opened this issue Mar 8, 2015 · 5 comments

Comments

@D8207
Copy link

D8207 commented Mar 8, 2015

As suggested in http://stackoverflow.com/questions/22741478/firefox-filereader-is-not-defined-only-when-called-from-web-worker , FileReader is not available in Web Workers in Firefox, making my browserify'ed web worker script using filestream not work.

@DamonOehlman
Copy link
Owner

@D8207 I've made a patch in the filereadersync branch. Would you mind modifying your package.json to include this branch and see if it fixes your issue?

This should be possible by adding something like the following to your package.json:

{
 ...
  "dependencies": {
    ...
    "filestream": "DamonOehlman/filestream#filereadersync"
  }
  ...
}

@D8207
Copy link
Author

D8207 commented Mar 9, 2015

I'm not sure how to do this; browserify just looks at require() calls and includes specified files into the bundled JavaScript from my node_modules...

@DamonOehlman
Copy link
Owner

OK, if you haven't yet included filestream into your package.json then just try something like this in the directory:

npm install DamonOehlman/filestream#filereadersync --save

@D8207
Copy link
Author

D8207 commented Mar 9, 2015

No luck. This version dismisses the error message, but doesn't work either.

It appears FileReaderSync has a different interface than FileReader: its read* methods return values directly, and no events are triggered. Simply replacing FileReader with FileReaderSync won't work.

@DamonOehlman
Copy link
Owner

OK - I'll have a bit more of a look at the FileReaderSync docs when I get a chance...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants