Created
February 5, 2013 21:21
-
-
Save mikeycooper/4717763 to your computer and use it in GitHub Desktop.
Fix for blobBuilder issue in localstorage demo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 0bd1bea593f4122da1d1e987e385d9c6696a4003 Mon Sep 17 00:00:00 2001 | |
From: Mikey Cooper <mikey@bluey.com> | |
Date: Tue, 5 Feb 2013 16:12:24 -0500 | |
Subject: [PATCH] Switch from BlobBuilder to Blob constructor. | |
--- | |
html5demos/localstorage/js/base.js | 8 +++----- | |
1 file changed, 3 insertions(+), 5 deletions(-) | |
diff --git a/html5demos/localstorage/js/base.js b/html5demos/localstorage/js/base.js | |
index b081466..1b2fb06 100644 | |
--- a/html5demos/localstorage/js/base.js | |
+++ b/html5demos/localstorage/js/base.js | |
@@ -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(); | |
@@ -63,11 +62,10 @@ | |
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"); | |
- | |
+ var fileparts = [xhr.response]; | |
+ blob = new Blob(fileparts, { type: "image/png" }); | |
+ | |
// onload needed since Google Chrome doesn't support addEventListener for FileReader | |
fileReader.onload = function (evt) { | |
// Read out file contents as a Data URL | |
-- | |
1.8.0.msysgit.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment