I've inherited this webpage where I work that has a non-functional Copy to Clipboard button. Basically the idea is you click this button, and a variable full of data is passed to a JavaScript function which is supposed to then copy it to the OS clipboard.

I've found a script that claims to work, and a couple minor variations thereof, but I can't get it to work. I've seen a lot of forum posts about it, but in none of the threads does anyone really give a definitive answer as to whether it's proven to work.

Below is the script. It works for IE, fails for Firefox. The URL it was basically taken from is http://www.krikkit.net/howto_javascr...clipboard.html. I'm really just looking for a final yes or no answer as to whether Firefox will do clipboard work without a user having to tweak their JavaScript security settings.
Code:
function copy_clip(meintext)
{
    
    if (window.clipboardData)
    {
       window.clipboardData.setData("Text", meintext);
    }
    else
    {
               netscape.security.PrivilegeManager.enablePrivilege  ('UniversalXPConnect');

		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');

		var str = new Object();
		var len = new Object();

		var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);   
		var copytext=meintext;   
		str.data=copytext;   
		trans.setTransferData("text/unicode",str,copytext.length*2);   
		var clipid=Components.interfaces.nsIClipboard;

		if (!clip) return false;   
		clip.setData(trans,null,clipid.kGlobalClipboard);
   )
   alert("Clipboard Copy has been succesful");
   return false;
}