Skip to content

Instantly share code, notes, and snippets.

@arronmabrey
Last active July 2, 2021 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arronmabrey/38a2b0691447ec7093d8a515cab69611 to your computer and use it in GitHub Desktop.
Save arronmabrey/38a2b0691447ec7093d8a515cab69611 to your computer and use it in GitHub Desktop.
var go = function(og) {
console.log("go")
var reader = new FileReader();
reader.addEventListener("load", function () {
console.log("reader load", reader.result)
completion(reader.result)
}, false);
fetch(og.src).then(function(req) {
console.log("fetch", req)
req.blob().then(function(data) {
console.log("blob")
blob = new Blob([data], {type: 'image/gif'})
reader.readAsDataURL(blob)
})
})
}
var main = function() {
console.log("main")
var og = document.querySelector('.image_frame img');
console.log("og", og)
if (og) {
go(og)
} else {
setTimeout(main, 400)
}
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment