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

3.1k views Asked by At

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. Why is this?

I'm using:

  • Firefox 33.1.1 (although users have complained of the issue with FF 29)
  • TinyMCE 4.1.1 with the "paste" plugin

I can right-click paste into these without error:

  • an element with the contenteditable="true" attribute (same method as TinyMCE), tested on http://html5demos.com/contenteditable
  • a normal textarea
  • TinyMCE 4.1.1 without the "paste" plugin

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". I'm interested in knowing what change was made to either Firefox or TinyMCE that causes this, and why (security?).

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. But I'm interesting in knowing why it happens in the first place.

1

There are 1 answers

0
Luke On

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

The removal of allowclipboard policy support broke the copy/paste buttons on some rich text editors like CKEditor. The standard Clipboard API's click-to-copy support will be implemented in the near future. The general keyboard shortcuts, Ctrl+C and Ctrl+V, should always work.

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. 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.

Good follow-up questions might be: Why don't the other browsers do this? Why is ctrl+v safer?