You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// window.addEventListener('paste', ... ordocument.onpaste=function(event){// use event.originalEvent.clipboard for newer chrome versionsvaritems=(event.clipboardData||event.originalEvent.clipboardData).items;console.log(JSON.stringify(items));// will give you the mime types// find pasted image among pasted itemsvarblob=null;for(vari=0;i<items.length;i++){if(items[i].type.indexOf("image")===0){blob=items[i].getAsFile();}}// load image if there is a pasted imageif(blob!==null){varreader=newFileReader();reader.onload=function(event){console.log(event.target.result);// data url!};reader.readAsDataURL(blob);}}
The text was updated successfully, but these errors were encountered:
can you please add support for pasting image directly?
Something like this: https://stackoverflow.com/questions/6333814/how-does-the-paste-image-from-clipboard-functionality-work-in-gmail-and-google-c
The text was updated successfully, but these errors were encountered: