Skip to content
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

fix(frontend): fix copyToClipboard on non-HTTPS site #2046

Merged
merged 1 commit into from
Aug 23, 2023
Merged

fix(frontend): fix copyToClipboard on non-HTTPS site #2046

merged 1 commit into from
Aug 23, 2023

Conversation

ImSingee
Copy link
Contributor

navigator.clipboard is only available on HTTPS sites if the host is not localhost.

Though there are some implements like https://stackoverflow.com/a/65996386/8398770, using a well-tested third-party library is better (it can handle many edge cases).

This PR uses clip-to-keyboard npm package for this.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 13, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@ImSingee
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@rubenfiszel
Copy link
Contributor

Looks like it uses execCommand first which seems to be deprecated: https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand#
Would rather not import a library just for this

@ImSingee
Copy link
Contributor Author

@rubenfiszel I removed the 3rd-party library and used navigator.clipboard if possible

@rubenfiszel
Copy link
Contributor

Thanks!

@rubenfiszel rubenfiszel merged commit 95ea0e8 into windmill-labs:main Aug 23, 2023
2 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants