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

Can't copy clipped long string to clipboard #145

Closed
ranqn opened this issue Jan 3, 2022 · 5 comments
Closed

Can't copy clipped long string to clipboard #145

ranqn opened this issue Jan 3, 2022 · 5 comments
Labels
investigating I'm looking at it

Comments

@ranqn
Copy link

ranqn commented Jan 3, 2022

Bug Report

Versions

Version
node.js
verdaccio 5.4.0
verdaccio-github-oauth-ui (Plugin) 3.2.0
verdaccio-github-oauth-ui (CLI)

Expected behavior

Click Copy to clipboard button should always copy the text.

Observed behaviour

Copy failed with error when copy long text (end with ...)

Steps to reproduce

  1. Open Registry Info window
  2. Find a long string (clipped by the window) to copy
  3. Click Copy to clipboard button
  4. The string is not copied to clipboard

Additional context

image

Browser error after click, filename: /-/static/github-oauth-ui/verdaccio-5.js
image

@n4bb12
Copy link
Owner

n4bb12 commented Feb 3, 2022

Hi @Ran-QUAN, which browser and version are you using?

@ranqn
Copy link
Author

ranqn commented Feb 4, 2022

@n4bb12
Microsoft Edge 97.0.1072.76 on Windows 11
Currently I switched back to version 3.0.0, and the copy function works without any problem.

@n4bb12
Copy link
Owner

n4bb12 commented Feb 4, 2022

Thank you.

That's strange because it's a native browser feature and your browser supports it.
https://caniuse.com/mdn-api_clipboard_writetext

Actually, I'm using the same browser, and it works for me 😪

Is it possible the feature is disabled by default or disabled for the page?
edge://settings/content/clipboard?search=clipboard
edge://settings/content/all?search=clipboard

@n4bb12 n4bb12 added the investigating I'm looking at it label Feb 4, 2022
@ranqn
Copy link
Author

ranqn commented Feb 4, 2022

@n4bb12
It seems like clipboard API is only available for HTTPS sites, and we're hosting verdaccio on an internal server via HTTP.
https://stackoverflow.com/a/51823007/3556176

@n4bb12
Copy link
Owner

n4bb12 commented Feb 5, 2022

In that case I would rather keep the built-in clipboard implementation. This plugin exchanges secrets and therefore should not be communicating over HTTP. If it works, great, but it's not something I want to officially support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating I'm looking at it
Projects
None yet
Development

No branches or pull requests

2 participants