I use a few sites that add a handy tool that copys text to my clipboard
This is the script they use:
I am using Firefox 1.0 and IE 6.0 (XP SP2) and this function does not work on both. I think it may have something to do w/ sp2 because this is a pretty fresh install (1.5months)PHP Code:function toclip(cmd) {
if (window.clipboardData) {
window.clipboardData.setData('Text', cmd);
} else if (window.netscape) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
if (!str)
return;
str.data = cmd;
var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
if (!clip)
return;
var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
if (!trans)
return;
trans.addDataFlavor('text/unicode');
trans.setTransferData('text/unicode',str,cmd.length*2);
var clipid = Components.interfaces.nsIClipboard;
clip.setData(trans,null,clipid.kGlobalClipboard);
}
return false;
}
I didnt, just notice it... it has been hapening for a while... just been too lazy to do anything about it.
Any ideas?





Reply With Quote