"Copy to Clipboard" button not working on embedded notebook

I implemented a copy to clipboard button (as suggested in the Button Inputs notebook by @mbostock) so that users can save/share the current state of this notebook.

Works great on Observable but not on my static site that embeds the notebook via vanilla JS.

The console shows a “Uncaught TypeError: navigator.clipboard is undefined…” whenever I click the button. Can interact with navigator, though

Your page must be served via https with a valid certificate for clipboard to be available.

1 Like

Ah. Thank you for explaining that.