Blob.js implements the W3C Blob
, File, FileReader and a subset of URL interface in browsers that do
not natively support it.
- Adds the new reading methods
blob.text()
A promise resolving into textblob.arrayBuffer()
A promise resolving toArrayBuffer
blob.stream()
returns a ReadableStream (Made of ReadableStream ornew Response(blob).body
- It monkey patches
XMLHttpRequest.prototype.send
to support sending blobs while making sure Content-Type is set in old IE that didn't send blob's type - It override existing File implementation if they are not constructable (Old Safari & IE mainly)
URL
get unprefixedURL.createObjectURL
creates a base64 data url if it's a "fake" Blob
ArrayBuffer, Promise and the Stream api's are not added, We recommened you to include polyfills for those if you plan to use them.
readAsArrayBuffer
and arrayBuffer()
: returns a regular array if typed arrays are not supported.
Blob.js shares the same supported browsers as FileSaver.js.