'Tis the season to be coding! We’ve got some exciting news to share as we gear up for the holiday season – get ready for a week of Christmas releases, starting with the first one today
!
I copy pasted the above intro from ChatGPT, and now your app’s users can copy too.
We’ve heard from you that having access to the clipboard would improve the UX of your apps, so we’re officially enabling support for Clipboard write access via the web’s clipboard.writeText API (Shoutout to those using document.execCommand as a workaround!).
How to guide:
To copy something to the user’s clipboard, refer to the following code snippet.
const textToCopy = "Happy Holidays 🎄!";
await navigator.clipboard.writeText(textToCopy);
Alternative web clipboard APIs:
- clipboard.write will remain disabled to ensure cross-browser compatibility
- document.execCommand will continue to work for now, but we recommend migrating to
clipboard.writeText - clipboard read will remain disabled
We hope this helps open up some new use-cases for your apps and tidy up your code workarounds!
This is just the first present in our festive series. Stay tuned as we unwrap more surprises this week ![]()