For years and years the only way to create a button on a web site that would copy something to the visitor’s clipboard was to use a Flash shim of sorts since Flash had an API that could access the clipboard.
It looks like Mozilla is going to step in and change that requirement where JavaScript will now be able to be used to access the clipboard.
Fortunately, we have a solution. The editor APIs provide document.execCommand as an entry point for executing editor commands. The "copy" and cut" commands have previously been disabled for web pages, but with Firefox 41, which is currently in Beta, and slated to move to release in mid-September, it is becoming available to JavaScript within user-action initiated callbacks.
Long, long overdue.
I saw this on Hacker News I think but I had it tucked away in Unmark.