The web’s clipboard, and how it stores data of different types

Summary:
The author explores the inner workings of the clipboard, focusing on the web clipboard APIs and their limitations. The async Clipboard API restricts data types to text, HTML, and images, while the older Clipboard Events API allows for more flexibility. Surprisingly, Google Docs uses execCommand(“copy”) to write custom data types to the clipboard, bypassing the restrictions of the async Clipboard API. Similarly, Figma uses a unique approach by encoding data as a binary format in HTML to enable copy-pasting complex designs. The history, security implications, and practical applications of clipboard interactions are thoroughly examined in the post.

https://alexharri.com/blog/clipboard

To top