Another snippet I tend to google each time I need it, copying to clipboard that is.
The demo does not work here, because "The Clipboard API has been blocked because of a permissions policy applied to the current document"
But you can find it, try it and use it from any of these places:
- Codepen DEMO
- In the wild over at Pass Genny
- And in GitHub
If you found the content useful, consider supporting me! I post some stuff around here, and have some stuff over on GitHub as well
Top comments (4)
Thanks for this
You're welcome, hope it's useful!
thanks for example. but interested in how to fix the "The Clipboard API has been blocked because of a permissions policy" issue.
I don't think it's posible in this case, just how Iframes are set in dev.to, it only happens if running it from here.
I think you can configure your iframe in some way to allow that permission, but I'm not sure!