Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334590 - [client][editor] Clipboard issues
Summary: [client][editor] Clipboard issues
Status: RESOLVED WONTFIX
Alias: None
Product: Orion
Classification: ECD
Component: Editor (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-17 16:58 EST by Felipe Heidrich CLA
Modified: 2015-05-05 14:53 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felipe Heidrich CLA 2011-01-17 16:58:36 EST
Generally the browsers only allow javascript code to access the system clipboard during the handling for clipboard events.
For example, during a "copy" and a "cut" event it is possible to use clipboardData.setData("text/plain", text); to put content in the clipboard.
During a "paste" event is is possible to use clipboardData.getData("text/plain") to get the content from the clipboard.

Any other time these action will raise a security exception.
This is problem for the editor because it needs access to clipboard during toolbar actions or (custom) context menu actions.

IE: does not have the problem, the clipboard is always accessible.

FF: the clipboard can be accessible if:
"Copy,cut and paste will not work on the editor by default because firefox does not allow javascript code to access the clipboard.

To change that the user can open about:config or edit %appdata%\Mozilla\Firefox\Profiles\xxxx.default\user.js adding something like this:
user_pref("capability.policy.policynames", "allowclipboard");
user_pref("capability.policy.allowclipboard.sites", "http://localhost:8080 http://ssqwin7x64.ottawa.ibm.com:8080";);
user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");
user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");

Alternatively, it is lot easier to use a little app called AllowClipboard Helper (firefox add-on)
After you install the tool, nagivate to the page you need to grant access and in the  Menu bar choose Tools->AllowClipboard Helper.
It will open a window already if the name of the host filled in.

Probably, you will need to change it a bit.
For example, if the URL is http://localhost:8080/webeditor/samples/demo.html
AllowClipboard Helper will put only localhost in the entry for you.
You need to change it to http://localhost:8080 (no slash at the end), and click okay.

Restart firefox."

Chrome: Not accessible
But, there is some experimental API for clipboard, but it seems to work only for extensions (plugins).

http://code.google.com/chrome/extensions/experimental.html
Comment 1 John Arthorne CLA 2015-05-05 14:53:27 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html