MDN self-hosted library · e01.org

ClipboardChangeEvent: types property

Clipboard API

Open notebook · 1 cells web-api-instance-property upstream source

Clipboard API

The types read-only property of the ClipboardChangeEvent interface returns an array of strings representing the mandatory MIME types 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