Copy to clipboard without Flash

Black_Sun picture Black_Sun · Jun 15, 2011 · Viewed 82.7k times · Source

I found many solutions for copying to the clipboard, but they all either with flash, or for websites side. I'm looking for method copy to clipboard automatically, without flash and for user side, it's for userscripts and of course cross-browser.

Answer

Michael Borgwardt picture Michael Borgwardt · Jun 15, 2011

Without flash, it's simply not possible in most browsers. The user's clipboard is a security-relevant resource since it could contain things like passwords or credit card numbers. Thus, browsers rightly don't allow Javascript access to it (some allow it with a warning shown that the user has confirm, or with signed Javascript code, but none of that is cross-browser).