Last active
December 23, 2015 16:12
-
-
Save jimbuck/29732633ec9a4068e8ce to your computer and use it in GitHub Desktop.
Converts the current image to the base64 equivalent.
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
javascript: !function(){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var e=new FileReader;e.onloadend=function(){window.open(e.result,"_blank")},e.readAsDataURL(n.response)},n.open("GET",window.location.href),n.send()}(); |
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
function make64(){ | |
var xhr = new XMLHttpRequest(); | |
xhr.responseType = 'blob'; | |
xhr.onload = function() { | |
var reader = new FileReader(); | |
reader.onloadend = function () { | |
window.open(reader.result, "_blank"); | |
} | |
reader.readAsDataURL(xhr.response); | |
}; | |
xhr.open('GET', window.location.href); | |
xhr.send(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment