-
-
Notifications
You must be signed in to change notification settings - Fork 31
Handle missing "navigator.clipboard" #159
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
Conversation
In some cases navigator.clipboard can be undefined. For example on HTTP site (happens in DMZ environments). In such cases copy will fail. However, it can always be remediated on user side by using good old execCommand. This commit modifies code to avoid exception on copy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. I wonder if you know an easy way to create an environment where navigator.clipboard
is not defined?
You can create a record in /etc/hosts (mac, linux) to point to your localhost and then open it with port and HTTP. I think windows has something similar. |
Okay, thanks. I managed to test it out and I can reproduce the issue and see your solution! I wonder though -- with your solution, I still get the If so, what function are you using? |
yeah, my solution is to run copy code inside
|
Thanks for the info. Apparently the I'll merge your PR though and I'll start a new issue to:
Appreciate the contribution! |
In some cases navigator.clipboard can be undefined. For example on HTTP site (happens in DMZ environments).
In such cases copy will fail. However, it can always be remediated on user side by using good old execCommand.
This commit modifies code to avoid exception on copy.