3/18/2023 0 Comments Firefox copy text clipboardPre.setAttribute('id', 'pcryptcopytext') var pre = document.getElementById('pcryptcopytext') Tried this code and it does not copy anything to the OS clipboard - but do not generate any errors btw. This only leave document.execCommand("copy", false, null) in the field as a stand alone solution. One option is to make an add-on that will execute in privileged code area and send the text that shall be copied to this add-on for it to handle the copy to the OS clipboard (nice new possible project). tTransferData("text/unicode", str, cliptext.length*2) Ĭlip.setData(trans, null, clipid.kGlobalClipboard) // No return valueĬomponents.classes is undefined in unprivileged code (not add-on etc) so I do not believe any solution with this will work any more. My old solution was like this: var clip = trans = str = new Object() The solution below need the user to press CTRL+C and I need a solution where the text shall copy based on the press of a button (many on a single page). Like to do it and post it here but need a working solution first.Īccording to the web there are 2 solutions for copy to clipboard document.execCommand("copy", false, null)Īnd var gClipboardHelper = me on the clipboard, please.") īoth generate a failure with my first try. Hopefully also a guide that can be used by the novice user. a simple guide about how to enable javascript access to the clipboard. User_pref("", " user_pref(".cutcopy", "allAccess") īut how shall I do it? Have made some test without great success and think there is no guide on the web that explain how it shall be done in a generic way. It looks as if it is still possible according to this article:īelieve it is still necessary to enable the possibility in the user.js file like this user_pref("", "allowclipboard") Had it working in the past but now the is protected as far as I can figure out (since ver. Because of different reasons I am unable to use the flash solution! Know it is easy in IE and not possible in Chrome and Opera unless flash is used. I really need a way to copy some text to the OS clipboard in Firefox.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |