Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Copy response key to clipboard when clicked on #4

Open
gbraad opened this Issue · 8 comments

5 participants

@gbraad
Owner

clipboardData.setData("Text", s); only works on IE. Need to have a good cross browser solution which might also work on Webkit-based browsers.

http://stackoverflow.com/questions/7713182/copy-to-clipboard-for-all-browsers-using-javascript
http://stackoverflow.com/questions/400212/how-to-copy-to-the-clipboard-in-javascript

@br0x

Why not use ZeroClipboard library? Flash currently is the only cross-browser solution.

@gbraad
Owner

@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.

@multiwebinc

@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.

@br0x

@multiwebinc Absolutely agree!

@gbraad
Owner

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...

@gbraad
Owner

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.

@slava-vishnyakov

:+1: would love to see this feature!

@philwebb

Allowing the token text to be selected so that it can be copied to the clipboard in the usual way would be very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.