eligrey / Blob.js

An HTML5 Blob implementation
Other
1.15k stars 605 forks source link

Fix blob for mozilla 10.0.4 esr #9

Closed chrisalexander closed 11 years ago

chrisalexander commented 11 years ago

On Mozilla 10.0.4 esr (and potentially other versions of Firefox that aren't recent) the syntax used in Blob.js causes a required global object to become undefined.

Despite the code not being executed (it is inside the if statement which does not return true in Firefox) just loading this file in the FF version mentioned causes window.URL to become undefined - this is assumed to be present by the library hence the problem when you go to use it.

The fix for this is in this pull request. The workaround in the meantime is to put the following line of code on your page before you load blob.js:

webkitURL = window.hasOwnProperty("webkitURL") ? webkitURL : URL;

Download the firefox version from here: https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/10.0.4esr/

Thanks

chrisalexander commented 11 years ago

Thank you :-)