I'm trying to create a read from clipboard javascript function, and it's generally working, but I can't seem to extract the actual string from the object I create with the out parameter (Components.interfaces.nsITransferable). In case you're wondering, this is for a local intranet, and I have enabled clipboard access.
This is the part of the code where I create objects for the out parameters, and then set them. I know it's basically working, because if I return obj_length.value it gives me the right length (*2 for unicode). However, obj.value only gives me an object of type [xpconnect wrapped nsISupports]. I need the string with the clipboard contents!
var obj = {};
var obj_length = {};
b.getTransferData("text/unicode", obj, obj_length);
return obj.value;
Can anyone please help me figure out how to extract the clipboard contents? I'm so close!