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

'Quick copy to clipboard' not working #431

Open
clbas opened this issue Sep 18, 2023 · 4 comments
Open

'Quick copy to clipboard' not working #431

clbas opened this issue Sep 18, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@clbas
Copy link
Contributor

clbas commented Sep 18, 2023

Description of the bug

The 'quick copy to clipboard' feature is not functioning properly, whether accessed through the menu or the keyboard shortcut. The console displays the error: 'Uncaught TypeError: window.ClipboardItem is not a constructor'.

To reproduce

  1. Within the project, select a section of the automata you wish to copy
  2. Navigate to File > Export > Quick Copy to Clipboard or use the shortcut Cmd+Shift+C
  3. Check your clipboard

Expected behavior

After a user selects a portion of the project and copies it using either the keyboard shortcut or menu option, a PNG of the highlighted section should be available in their clipboard.

Additional information

No response

@clbas clbas added the bug Something isn't working label Sep 18, 2023
@anioncat
Copy link
Member

I think this is a Firefox specific issue. I remember this coming up as a problem with my URL copying but it decided to magically work for text and it slipped my mind. The function should work if you use Chrome and I don't think there is a work around atm (maybe sometime).

Given that you mentioned "cmd" + shift + C was this happening on Safari as well?

@clbas
Copy link
Contributor Author

clbas commented Sep 18, 2023

Ah okay thanks, I was using Firefox originally so that makes sense. Just tested with Safari and received the following error: Unhandled Promise Rejection: NotAllowedError. Seems like it's a fairly well documented issue relating to indirect user interaction with the clipboard. I'll try to find a solution for the Safari error tonight.

@clbas clbas self-assigned this Sep 18, 2023
@s3897720
Copy link
Contributor

s3897720 commented May 1, 2024

For what its worth, I tried this on my Windows machine in the latest Firefox (125.0.3) and it doesn't touch the clipboard at all. Edge (124.0.2478.67) at least clears the clipboard but doesn't "copy" any meaningful text to the clipboard. Worth mentioning that this version of Edge should be a Chrome fork, so does that imply the current implementation is purely Chrome-only?

@ire4ever1190
Copy link
Member

Iirc last time I looked at it yes. The clipboard API used wasn't a standard (basically just a thing chrome was pushing) when I first looked at it so there was a bunch of funky stuff going on. Hopefully the situation has improved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants