Hello all,

today, after installing the newest version der Mozilla 2.14 we have problem with Clipboard-Function (Javascript)
Pls. help us, how we can up to date the Javascript. (see old script below)

Many thanks

Screenshot about error:





>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Our old intact Script:

*function copyToClipboard(s)**
**{**
**
** // Mozilla **
** if( window.clipboardData && clipboardData.setData )**
** {**
**  clipboardData.setData("Text", s);**
** }**
** else**
** {**
**  /***
** You have to sign the code to enable this or allow the action in about:config by changing**
**  user_pref("signed.applets.codebase_principal_support", true);**
**   */**
**netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');**
** var clip= Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);**
**  if (!clip) return;**
**
**  // create a transferable**
** var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);**
**  if (!trans) return;**
**
**  // specify the data we wish to handle. Plaintext in this case.**
**  trans.addDataFlavor('text/unicode');**
**
**  // To get the data from the transferable we need two new objects**
**  var str = new Object();**
**  var len = new Object();**
**
** var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);**
**
**  var copytext= s; **
**  str.data=copytext;**
** trans.setTransferData("text/unicode",str,copytext.length * 2 ) ; // [[[[2]]]]);**
**  var clipid=Components.interfaces.nsIClipboard;**
**  if (!clip) return false;**
**  clip.setData(trans,null,clipid.kGlobalClipboard); **
** }**
**} // end function*
_______________________________________________
support-seamonkey mailing list
[email protected]
https://lists.mozilla.org/listinfo/support-seamonkey

Reply via email to