Setup Clipboard actions for FF
To protect users' private information, unprivileged scripts cannot invoke the Cut, Copy, and Paste commands in the Mozilla rich text editor, so the corresponding buttons on the dijit Editor widget will not work. To enable these functions for purposes of the demo, you must modify your browser preferences.
Configure Firefox
- Quit Firefox. If you have Quick Launch running (in Windows, an icon in the toolbar), quit that too.
- Find your Firefox profile directory. On Windows, this is often located in
C:\Documents and Settings\<Windows login>\Application
Data\Mozilla\Firefox\Profiles\<one folder>.(See also editing configuration files for more info on locating your profile folder.)
- Open the
user.js
file from that directory in a text editor. If there's nouser.js
file, create one. - Add these lines to
user.js
:
user_pref("capability.policy.policynames", "allowclipboard"); user_pref("capability.policy.allowclipboard.sites", "http://localhost file:// http://dojotoolkit.org"); user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess"); user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");
*Change the value of capability.policy.allowclipboard.sites to where you want to enable this function. In the example above, this function is enabled for localhost, accessing local files directly (in your own hard drive, without a http server) and dojo website.
- Save the file, and restart Firefox. The Clipboard buttons should now function.
Note: The preference is site as well as protocol specific. For example
user_pref("capability.policy.allowclipboard.sites", "http://dojotoolkit.org")
is not the same as
user_pref("capability.policy.allowclipboard.sites", "https://dojotoolkit.org")
(the first is http and the second is https)
For more information about security policies, see http://www.mozilla.org/projects/security/components/ConfigPolicy.html.
This page is modified from Setting Prefs for the Mozilla Rich Text Editing Demo.
- Printer-friendly version
- Login or register to post comments
- Subscribe post
Firefox copy/paste via Flash
Not sure if this is something you guys have considered, but you can use a hidden flash component as a proxy for copy/paste actions in FireFox. We do this on our site to allow user's to click images to copy some text to their clipboard.