Seed the clipboard using Flash 10 and Zero Clipboard

Jacob Allred
#web-dev

Sometimes it is handy to allow a user to copy a large (or even small) amount of text to the clipboard with a single click. For example, an email address, a section of code, or a coupon code.

Back in the day, accomplishing this was easy with just a few lines of JavaScript, but once it started to get abused the major browser vendors disabled it.

Clever individuals soon discovered that you can embed a small Flash movie to get around this, and life was good again. But then once again, it started to get abused and so Adobe removed the feature from Flash 10.

Fortunately, another clever individual has stepped up and provided a new solution: Zero Clipboard! This easy to use (and tiny) JavaScript/Flash library makes it possible to provide your users with a “Copy to clipboard” button.

Unfortunately, it works by exploiting a clickjacking method that is starting to gain popularity, so even this method may break in the near future as browser vendors update their code to patch vulnerabilities.

Anyways, visit the Zero Clipboard page for the code and easy to follow examples.