-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use navigator.clipboard.writeText when available #87
Comments
I think a downside of this is it looks like you can only copy text, and can't specify the format. Am I incorrect here? |
|
To use the new api but still support older browsers i'm using this implementation. But might be good to add this to copy-to-clipboard.
|
I guess with this API available, this module is pretty much obsolete, so one option could be to not support it, letting this module exist only as a "legacy solution". |
the new clipboard API just works on HTTPS or localhost. In some usage scenarios, such as intranet environments without domain name resolution and custom certificates, the new API is not available. |
This is a new promise-based API available available in some browsers which does not require DOM interaction to copy a string:
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText
https://jsfiddle.net/p73yv6re/
The text was updated successfully, but these errors were encountered: