Skip to content

Commit

Permalink
Replacing BlobBuilder with blob
Browse files Browse the repository at this point in the history
  • Loading branch information
robnyman committed Feb 8, 2013
1 parent a162207 commit 53b0570
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions html5demos/localstorage/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
else {
// Create XHR, BlobBuilder and FileReader objects
var xhr = new XMLHttpRequest(),
blobBuilder = new (window.BlobBuilder || window.MozBlobBuilder || window.WebKitBlobBuilder || window.OBlobBuilder || window.msBlobBuilder),
blob,
fileReader = new FileReader();

Expand All @@ -63,10 +62,8 @@

xhr.addEventListener("load", function () {
if (xhr.status === 200) {
// Append the response to the BlobBuilder
blobBuilder.append(xhr.response);
// Create a blob with the desired MIME type
blob = blobBuilder.getBlob("image/png");
// Create a blob from the response
blob = new Blob([xhr.response], {type: "image/png"});

// onload needed since Google Chrome doesn't support addEventListener for FileReader
fileReader.onload = function (evt) {
Expand Down

0 comments on commit 53b0570

Please sign in to comment.