I'm trying to read the clipboardData attribute of a paste event for a plugin that I'm developing for CKEditor 4.
I've established that, in Chrome, if I listen to the document object for a paste event, then the event object I get passed in the handler will contain the clipboardData attribute. I was surprised to see the same is not true of Firefox (v20).
This is the code I'm using in my CKEditor plugin, although I don't believe this to be an question relevant only to CKEditor. In Chrome I see the clipboardData object, in Firefox I do not.
editor.document.on('paste', function(event) {
var clipboardData = event.data.$.clipboardData;
if (clipboardData) {
console.log(clipboardData);
}
});
I can't see anything on the MDN site confirming if this is yet supported, I also believe that IE10 is meant to support this, but will it work on a standard API?
Edit:
I should have made this clear from the start, but I'm trying to develop support for pasting images, so I need to read the clipboard data as a file.