Midas editor module security preferences

翻译不完整。 请帮助我们翻译这篇文章!

Note: If you've reached this page from a message box in Firefox or another Mozilla product, try using keyboard shortcuts for the Cut, Copy, and Paste commands:


  • Copy: Ctrl+C or Ctrl+Insert (command+C on Mac)
  • 复制:Ctrl+C 或者 Ctrl+Insert (命令+C在Mac系统)
  • Paste: Ctrl+V or Shift+Insert (command+V on Mac)
  • 黏贴:Ctrl+V 或者 Shift+Insert (命令+V 在Mac系统)
  • Cut: Ctrl+X or Shift+Delete (command+X on Mac)
  • 剪切:Ctrl+X 或者 Shift+Delete (命令+X 在Mac系统)

The information on the rest of this page is for Web developers and advanced users. Please do not try to modify this page.



To protect users' private information, unprivileged scripts cannot invoke the Cut, Copy, and Paste commands in Midas, which is Mozilla's rich text editor component.

在Midas中为了保护用户的私有信息,没有权限的脚本 不能调用剪切,复制和黏贴命令,那个是火狐强大的文本编辑组件。

This means that the corresponding buttons on the Mozilla Rich Text Editing demo page will not work. To enable these functions, you must modify your browser preferences.


Warning: Changing these preferences can leave your browser insecure, especially if you grant permission to untrusted sites.


Only change these settings as needed to try the demo above and to test your own add-on or Firefox-internal code, and be sure to restore the default settings when you're done!


Changing the preferences in Firefox


  1. Quit Firefox. If you have Quick Launch running (on Windows, this is an icon in the toolbar), quit that too.
  2. 退出火狐。如果你有快速的开始运行(在windows,这是一个图标在那个工具池里),也退出。
  3. Find your Firefox profile directory.
  4. 找到你的火狐资料目录
  5. Open the user.js file from that directory in a text editor. If there's no user.js file, create one.
  6. 打开那个user.js文件从在文本编辑器的目录。如果没有user.js文件,创建一个。
  7. Add these lines to user.js:
  8. 在user.js中添加下面这些行。
  9. user_pref("capability.policy.policynames", "allowclipboard");
    user_pref("capability.policy.allowclipboard.sites", "https://www-archive.mozilla.org");
    user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");
    user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");
  10. Change the URL https://www.mozilla.org to the site for which you want to enable this function.
  11. 改变那个URL https://www.mozilla.org 这个网站,你想要使用这个功能。
  12. Save the file and restart Firefox. The Clipboard buttons in the demo, or similar buttons on the sites you listed, should now function.
  13. 保存这个文件和重启火狐。那在演示中的剪切板按钮或者在网站中你列表类似的按钮,应该有现在的功能。

Note: The preference is site as well as protocol specific. For example:


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

is not the same as:


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

This is because the first uses HTTP while the second uses HTTPS.

这是因为第一个使用HTTP 然而第二个使用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", "https://www-archive.mozilla.org https://developer.mozilla.org")

Again, keep in mind the security risks involved here and be sure to remove permission to access the clipboard once you no longer need it enabled.


See also