简体   繁体   English

为什么我们不能在Firefox中使用粘贴插件右键单击粘贴到TinyMCE中?

[英]Why can't we right-click paste into TinyMCE with paste plugin in Firefox?

It seems to be impossible to copy text and then paste it into a TinyMCE editor using right-click paste with Firefox if you have the "paste" plugin. 如果你有“粘贴”插件,似乎无法复制文本然后使用Firefox右击粘贴将其粘贴到TinyMCE编辑器中。 Why is this? 为什么是这样?

I'm using: 我正在使用:

  • Firefox 33.1.1 (although users have complained of the issue with FF 29) Firefox 33.1.1(虽然用户抱怨FF 29的问题)
  • TinyMCE 4.1.1 with the "paste" plugin TinyMCE 4.1.1带有“粘贴”插件

I can right-click paste into these without error: 我可以右键单击粘贴到这些中而不会出现错误:

Users have discussed on the TinyMCE forum as far back as 2007 , and mention an alert that says "Copy/Cut/Paste is not available in Mozilla and Firefox" which I do not receive with FF 33. No one mentions why this problem occurs, and the TinyMCE admins claim "this is not a bug". 早在2007年 ,用户就已经在TinyMCE论坛上进行了讨论,并且提到了一个警告“Mozilla和Firefox中没有复制/剪切/粘贴”,我没有收到FF 33。没有人提到为什么会出现这个问题,并且TinyMCE管理员声称“这不是一个错误”。 I'm interested in knowing what change was made to either Firefox or TinyMCE that causes this, and why (security?). 我有兴趣了解导致这种情况的Firefox或TinyMCE的变化,以及为什么(安全性?)。

This question -- tinymce mouse paste not working -- has an answer of how to fix the issue: remove the "contextarea" plugin or any plugin that is based on it. 这个问题 - 无法使用鼠标粘贴 - 有一个如何解决问题的答案:删除“contextarea”插件或任何基于它的插件。 But I'm interesting in knowing why it happens in the first place. 但我很有兴趣知道为什么它首先发生。

A co-worker got me on the right track and I found these two links: 一位同事让我走上了正确的轨道,我找到了这两个链接:

https://developer.mozilla.org/en-US/Firefox/Releases/29/Site_Compatibility#Security https://developer.mozilla.org/en-US/Firefox/Releases/29/Site_Compatibility#Security

The removal of allowclipboard policy support broke the copy/paste buttons on some rich text editors like CKEditor. 删除allowclipboard策略支持打破了一些富文本编辑器(如CKEditor)上的复制/粘贴按钮。 The standard Clipboard API's click-to-copy support will be implemented in the near future. 标准的Clipboard API的点击复制支持将在不久的将来实施。 The general keyboard shortcuts, Ctrl+C and Ctrl+V, should always work. 常规键盘快捷键Ctrl + C和Ctrl + V应该始终有效。

http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard

By default, JavaScript is not allowed to read or set your clipboard data for security and privacy reasons. 默认情况下,出于安全和隐私原因,不允许JavaScript读取或设置剪贴板数据。 This is because websites scripts can erase and replace what you currently have in your clipboard (data loss issue) and they can read whatever you have in your clipboard (security and privacy issue); 这是因为网站脚本可以删除和替换您当前在剪贴板中的内容(数据丢失问题),并且他们可以读取剪贴板中的任何内容(安全和隐私问题); as such, you should grant access with caution. 因此,您应谨慎授予访问权限。

Maybe someone with TinyMCE expertise can provide more information on how it accesses the clipboard. 也许拥有TinyMCE专业知识的人可以提供有关如何访问剪贴板的更多信息。

Good follow-up questions might be: Why don't the other browsers do this? 好的后续问题可能是:为什么其他浏览器不这样做? Why is ctrl+v safer? 为什么ctrl + v更安全?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM