clipboardData.setData("Text", s); only works on IE. Need to have a good cross browser solution which might also work on Webkit-based browsers.
Why not use ZeroClipboard library? Flash currently is the only cross-browser solution.
@bjoernWahle Thank you for your contribution, however Flash is not considered a viable solution. It might be the only cross-browser desktop solution,however Flash support got dropped for Linux and the same goes for mobile platforms, such as iOS, Android, ChromeOS and FirefoxOS.
In my opinion this can not be fixed until a standardized API is provided.
@gbraad What about providing multiple ways to copy based on what is available to the browser, such as HTML5 clipboard or document.execCommand('copy'); for extensions/apps and falling back to using ZeroClipboard if flash is available for the web version? This should at least cover the majority of people. And if nothing is available, create an <input> containing the OTP and select the text.
Who knows if there is ever going to be a totally cross-browser solution, but we could at least accommodate with what is available now.
@multiwebinc Absolutely agree!
I might re-evaluate...But want to prevent to increase the footprint of the mobile application. Since appcache is used, even the flash gets downloaded on a mobile phone when not in use. Most of the users are on mobile platforms...
Although it does not seem perfect, it is probably what comes closest to a cross-browser option: http://updates.html5rocks.com/2015/04/cut-and-copy-commands However, since it is not a standard option on Firefox I do see a need to rush implementing it.
would love to see this feature!
Allowing the token text to be selected so that it can be copied to the clipboard in the usual way would be very helpful.