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

Major rewrite #59

Merged
merged 2 commits into from
Aug 10, 2018
Merged

Major rewrite #59

merged 2 commits into from
Aug 10, 2018

Conversation

jimmywarting
Copy link
Contributor

@jimmywarting jimmywarting commented Aug 8, 2018

This is a major rewrite that makes fake blobs at least more useful and also do some repairing.

  • first it checks if blob construction works
  • then check if Blob constructor supports ArrayBufferViews (cuz safari have problem with it, so it fix that with a new constructor)
  • if none of those two works: It tries fix a new blob constructor (one witch use the existing Blob constructor and the other using BlobBuilder)
  • if there is still a problem creating a blob then it reimplements FileReader, Blob, File, URL, patches XHR so it sends blob as a string
  • if not not everything is reimplemented then it tries to fix the new File constructor so it works in every browser including all ie version and edge and some old safari versions. after that it also fixes IE's problem with not correctly setting the request Content-Type header to blob's type

It has been tested in all IE8 to 11, and Safari 6 to 11.1 that have problem with creating new File blobs and not being able to send blobs properly with xhr

Thanks to BrowserStack

I wrote it in plain old ES3 so no transpiling or browserify is needed.

closes #44
closes #33
maybe #53
maybe #19
maybe #45

@jimmywarting jimmywarting changed the title Update Blob.js Major rewrite Aug 8, 2018
@eligrey eligrey merged commit 3fab282 into eligrey:master Aug 10, 2018
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

Successfully merging this pull request may close these issues.

IE9 - blob.type is null or undefined Implement a FileReader?
2 participants