Skip to content

Instantly share code, notes, and snippets.

View alexandrualin1's full-sized avatar

Alin alexandrualin1

View GitHub Profile
@alexandrualin1
alexandrualin1 / readAsBinaryStringPolyfill.js
Last active October 23, 2017 15:53 — forked from zuraruby/readAsBinaryStringPolyfill.js
readAsBinaryStringPolyfill for internet explorer
/*
This polyfil is probably incomplete, I made this just to use localforage on internet explorer.
This polyfill is tested only with this library and works well, but I don't know if it will work i other cases.
This polyfill is based on this code: https://github.com/nolanlawson/blob-util/blob/4ae6c7a14d3240d977bbdab9ae2f0bb8905ecc37/lib/index.js#L123-L141
*/
if (window.FileReader){
if(typeof FileReader.prototype.readAsBinaryString !== 'function'){
console.log("Warning: Using readAsBinaryString polyfill");
FileReader.prototype.readAsBinaryString = function(blb){