Emulate clipboardData object

By ale5000 Last update Oct 18, 2009 — Installed 347 times.


Script Summary: It emulates the window.clipboardData object and improve it's use (it is very useful on "XDCC List" pages for example).

Version: 1.1.7

License: GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html

Thumb
Compatibility
Tested on Opera, Firefox (Greasemonkey), Google Chrome, Chromium, K-Meleon (Greasify).
On K-Meleon it works only partially.
Probably it works also on Safari but I cannot test it.
FOR OPERA USERS: Rename the file of the script to lib-clipboardData.js

Description
This script add the three methods of window.clipboardData (setData, getData and clearData) like the ones of Internet Explorer in other browsers but with some differences (see next section).

There are some difference compared to the IE version of window.clipboardData:
- clearData: It delete only the data in the internal variable (see setData).
- getData: It retrieve only the data stored by setData, it cannot access the real clipboard.
- setData: It store the data into an internal variable instead of the real clipboard and also show it in some places, see "Options"
(additionally it can also copy the data to the real clipboard but there are additional steps to do, see the "How copy text to the real clipboard" section).

How copy text to the real clipboard
- This can be done only on Firefox and Gecko based browsers (like K-Meleon)
- The variable in the script "copy_text_to_real_clipboard" must be set to 1.
- You must go on about:config and set "signed.applets.codebase_principal_support" to true.
- Every time the action of copy text to the real clipboard is executed, the browser will show a dialog that asks if allow it

Options
- use_alert (display the data set by setData in an alert)
- use_error_console (display the data set by setData on the error console)
- use_status_bar (display the data set by setData on the status bar)
- copy_text_to_real_clipboard (see "How copy text to the real clipboard")

Find out how install User Scripts in your browser