hatchet icon indicating copy to clipboard operation
hatchet copied to clipboard

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

Open abelanger5 opened this issue 1 year ago • 4 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.

abelanger5 avatar Mar 22 '24 20:03 abelanger5

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.

yashsinghcodes avatar Mar 23 '24 07:03 yashsinghcodes

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?

grahhnt avatar Mar 23 '24 17:03 grahhnt

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.

yashsinghcodes avatar Mar 26 '24 14:03 yashsinghcodes

@abelanger5 Please review

shiv4nk4r avatar Jul 02 '24 07:07 shiv4nk4r