Using the following in Firefox or IE (works in Chrome and Opera):
xhr = new XMLHttpRequest();
xhr.open( "GET", imgUrl + ".png", true );
xhr.responseType = "arraybuffer";
var arrayBufferView = new Uint8Array( xhr.response );
var blob = new Blob( [ arrayBufferView ], { type: "image/png" } );
I get:
uncaught exception: Input must be formatted properly as a base64 encoded DataURI of type image/webp
How can I go from blob to base64 encoded DataURI of type image/webp? I am not very experienced with web JavaScript so apologies is this a simple fix.