svelte-jsoneditor icon indicating copy to clipboard operation
svelte-jsoneditor copied to clipboard

navigator.clipboard is undefined on non-secured orgin (http)

Open hfutyezi opened this issue 2 years ago • 2 comments

i found this problem when my website is not https ,and some browser will have this error. navigator.clipboard return undefined

hfutyezi avatar Jun 14 '22 09:06 hfutyezi

My action is to copy text

hfutyezi avatar Jun 14 '22 09:06 hfutyezi

Ah, that's interesting. For security reasons, navigator.clipboard is not available when you're on a non-secure connection.

I see a workaround here that may work:

  • https://stackoverflow.com/questions/51805395/navigator-clipboard-is-undefined
  • https://stackoverflow.com/a/33928558/1262753

josdejong avatar Jun 14 '22 09:06 josdejong

The fix by @cloydlau has been published in v0.7.5, thanks again.

josdejong avatar Sep 21 '22 09:09 josdejong