Now that Firefox supports content editable divs I have recently been interested in implementing a cross browser WYSIWYG editor based on content editable divs allowing in context editing in both IE and Firefox. Unfortunatley, by default Firefox will not allow Javascript to access the clipboard which actually makes sense for security purposes. However, access can be enabled by following theinstructions below:
For 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>.
- Open the
user.js file from that directory in a text editor.
If there's no user.js file, create one.
-
Add these lines to user.js:
user_pref("capability.policy.policynames", "allowclipboard");
user_pref("capability.policy.allowclipboard.sites","http://www.inflecto.co.uk");
user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");
user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");
*Change the url "http://www.inflecto.co.uk" to where you want to
enable this function.
- Save the file, and restart Firefox. The Clipboard buttons should now
function.
If you want to allow multiple urls to access the Paste operation, separate
the urls with a space.