How can I copy an image to the clipboard?

6

I'm using this command to capture the screen.

chrome.tabs.captureVisibleTab(null, {}, function (image) {
    // image = base64;string
});

And now I would like to copy the captured image to clipboard.

How do I do this?

    
asked by anonymous 12.12.2013 / 01:54

1 answer

6

I needed to do something like this in a recent past and also could not come up with a solution. Seemingly browsers (with the exception of IE) do not support copying anything other than text for security reasons. This thread in the original OS (and the others it references) has very useful explanations in this respect: link

Now, considering that the 'image' parameter that your callback receives contains the URL of the captured image, depending on your intent (that is, if you do not want to simply leave the image to be pasted by the user in any external application) you can save the URL in a hidden html element or something. Or you can even use a Flash bridge as some users have suggested in the thread above. :)

    
12.12.2013 / 02:59