javascript – How to access clipboard image through browser?


Does anyone have any idea how to access the image that is on the clipboard when we print a screen on some screen? What I need is to access the image by ctrl + v in the browser, exactly how this application works:

the code I got for the event is this one, and it works, however how to access the image from this point?

$(document).bind('paste', function (evt) {
   alert('ctrl + V funciona');

Detail: browser : Google Chrome


I found this plugin

it worked perfectly for my purpose, for copying text and images.

just include the .js file and use the code below.

paste = $.paste().appendTo('body');
paste.on('pasteImage', function (ev, data){
console.log("dataURL: " + data.dataURL)
paste.on('pasteText', function (ev, data){
console.log("text: " + data.text)
paste.focus(); // it's actually a hidden div element

// ... when you don't need it anymore

examples and more information at the link.

Scroll to Top