Created
January 17, 2014 22:05
-
-
Save cmilfont/8482600 to your computer and use it in GitHub Desktop.
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
document.onpaste = function(event){ | |
var items = (event.clipboardData || event.originalEvent.clipboardData).items; | |
console.log(JSON.stringify(items)); // will give you the mime types | |
var blob = items[0].getAsFile(); | |
var reader = new FileReader(); | |
reader.onload = function(event){ | |
console.log(event.target.result)}; // data url! | |
reader.readAsDataURL(blob); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment