hatchet-dev/hatchet

bug(frontend): copy to clipboard doesn't work on firefox (within a secure context)

Opened this issue · 3 comments

Error message:

image

We are directly using navigator.clipboard in copy-to-clipboard.tsx, this should be a very easy switch to something like clipboardjs.

Hi @abelanger5 - Can you guide me how can I reproduce this error on firefox? As I used the Copy to clipboard button in API Token and it seems to be working for me.

I filed this on the project's Discord here and it just clicked that the clipboard API is privileged and when I got this error I was accessing via http

Maybe show like an error message or hide the button or something when running on an insecure context?

Ah I see, I think hiding the button would be better as error message can lead to bad UI/UX.

I know this is out of scope now but clipboardjs relies on execCommand API which is now deprecated.