You have to set certain preferences to the xulrunner engine.
At first you have to access the prefs.js file for the xulrunner. This can be done with the following snippet:
Class<?> loadClass = Activator.getDefault().getClass()
.getClassLoader()
.loadClass("org.eclipse.swt.browser.MozillaDelegate");
Method declaredMethod = loadClass
.getDeclaredMethod("getProfilePath");
declaredMethod.setAccessible(true);
String profilePath = (String) declaredMethod.invoke(null);
File userPrefs = new File(profilePath + File.separator + "prefs.js"))
In this file you have to set the following key-values:
capability.policy.policynames, allowclipboard
capability.policy.allowclipboard.Clipboard.cutcopy,allAccess
capability.policy.allowclipboard.Clipboard.paste,allAccess
capability.policy.allowclipboard.sites,file://
See also http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard
Note: This is only working if your website is local. Otherwise you have to add the domains to the capability.policy.allowclipboard.sites
key.