exercism / website

The codebase for Exercism's website.
https://exercism.org
GNU Affero General Public License v3.0
436 stars 126 forks source link

CopyToClipboardButton broken #279

Closed iHiD closed 3 years ago

iHiD commented 4 years ago

When rendering this via the Bootloader, navigator is always undefined for me here so the component doesn't render.

https://github.com/exercism/v3-website/blob/7615ccf8b288909e4486e930155ac5c2e1915664/app/javascript/components/common/CopyToClipboardButton.tsx#L12

ErikSchierboom commented 4 years ago

Do you mean when rendering it like:

ReactComponents::Common::CopyToClipboardButton.new("exercism download --exercise=pattern")

?

When rendering it like that, it works for me in Chrome and Edge.

SleeplessByte commented 4 years ago

The clipboard API only works in secure contexts (https with valid certificate, localhost).

ErikSchierboom commented 3 years ago

I've just checked, and this does indeed now work on exercism.lol now that it's HTTPS.