Clipboard API

The Clipboard API is a replacement for the deprecated document.execCommand() and is currently under development. It allows for advanced features like customized content and multi-format data support, enabling richer interactions.

The API enhances control and security by ensuring precise data transfer and protecting against unauthorized clipboard interference.

Inconsistent Support

In Safari, unsupported formats don't result in an error, and you can still proceed with copying text. However, Chrome and Firefox might throw an error when faced with unsupported formats.

Additionally, Safari and Firefox may prompt you before pasting text, whereas Chrome might request permissions only once.

Demo

You can use this demo to check what is supported by your browser.


Clipboard API support for current browser
FeatureSupportedDetails
ClipboardItemSupported by all modern browsers
ClipboardItem (constructor)Copy stars to check if this feature is supported
Static ClipboardItem.supports()
ClipboardItem.types()Copy and paste stars to check if this feature is supported
Multiple itemsCopy stars to check if this feature is supported
image/svg+xmlCopy and paste stars to check if this feature is supported
Custom web formatsCopy and paste stars to check if this feature is supported
presentationStyleCopy and Paste stars to check if this feature is supported