Clipboard API
The types read-only property of the ClipboardChangeEvent interface returns an array of strings representing the mandatory MIME type available on the system clipboard when the ClipboardChangeEvent event was fired. Optional types and custom formats are not included to limit fingerprinting.
Value
An array of strings.
Examples
In this example, when the contents of the clipboard change, the event listener logs to the console every string representing a mime type that is available in the array returned by the ClipboardChangeEvent.types property.
navigator.clipboard.addEventListener("clipboardchange", (event) => {
event.types.forEach((value) => {
console.log(value);
});
});
Specifications
Browser compatibility
See also
- ClipboardChangeEvent.changeId
- ClipboardChangeEvent
- ClipboardEvent
- Clipboard API
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
