Last active
July 2, 2021 22:28
-
-
Save arronmabrey/38a2b0691447ec7093d8a515cab69611 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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