Midas editor module security preferences 编辑

This functionality is completely removed since 2013-12-14 18:23 PST, see: bugs 38966 and 913734

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)
  • Paste: Ctrl+V or Shift+Insert (command+V on Mac)
  • Cut: Ctrl+X or Shift+Delete (command+X on 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. 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. Find your Firefox profile directory.
  3. Open the user.js file from that directory in a text editor. If there's no user.js file, create one.
  4. Add these lines to user.js:
    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");
    
  5. Change the URL https://www.mozilla.org to the site for which you want to enable this function.
  6. Save the file and restart Firefox. The Clipboard buttons in the demo, or similar buttons on the sites you listed, should now function.
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.

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:68 次

字数:4497

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文