lundi 12 janvier 2015

Storing clipboard data into a variable with JavaScript and the Google Chrome API

I am wondering if it is possible to store the contents of the clipboard in a string variable.


The following source states that this is not possible using pure JS, but I was thinking hoping that the chrome API would make it possible. (I am developing a chrome extension).



There is a clipboardRead permission, which would lead you to believe that it is possible, but it's description is just:



Required if the extension or app uses document.execCommand('paste'). source



To clarify: I am not trying to copy data to the clipboard or paste data from it. I would like to store the contents of the clipboard into a variable without mutating the clipboard contents in any way.


To further clarify, I can not assume that the clipboard data happens to be sitting in info.selectionText at the time of the operation.


If it is not possible, than I will just have to live with it I suppose, but it seems like something that would be possible to do with an extension.


Aucun commentaire:

Enregistrer un commentaire