Setting Prefs for the Mozilla Rich Text Editing De

Setting Prefs for the Mozilla Rich Text Editing Demo

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 Mozilla Rich Text Editing demo page will not work. To enable these functions for purposes of the demo, you must modify your browser preferences.

For Firefox:

  1. Quit Firefox. If you have Quick Launch running (in Windows, an icon in the toolbar), quit that too.
  2. 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.)

  1. Open the user.js file from that directory in a text editor. If there's no user.js file, create one.
  2. Add these lines to user.js:

5.           user_pref("capability.policy.policynames", "allowclipboard");

6.           user_pref("capability.policy.allowclipboard.sites", "http://www.mozilla.org");

7.           user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");

user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");

*Change the url "http://www.mozilla.org" to where you want to enable this function.

  1. 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://www.mozilla.org")

is not the same as

user_pref("capability.policy.allowclipboard.sites", "https://www.mozilla.org")

(the first is http and the second is https)

If you want to allow multiple urls to access the Paste operation, separate the urls with a space. For example:

user_pref("capability.policy.allowclipboard.sites",

  "http://www.mozilla.org https://www.mozilla.org")

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值