ClipboardItem: supports() static method

Baseline 2025
Newly available

Since March 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The supports() static method of the ClipboardItem interface returns true if the given MIME type is supported by the clipboard, and false otherwise.

Note that the Clipboard API mandates support for plain text, HTML and PNG files. The supports() method will always return true for these MIME types, so testing them is unnecessary.

Syntax

js
supports(type)

Parameters

type

A string indicating the MIME type to test.

These MIME types are always supported:

  • text/plain
  • text/html
  • image/png

These MIME types may be supported:

  • image/svg+xml
  • Custom MIME-type formats starting with "web ". The custom type (without the "web " prefix), must have the correct formatting for a MIME type.

Return value

true if the given MIME type is supported by the clipboard, false otherwise.

Examples

Writing an image to the clipboard

The following example fetches an SVG image, represents it as a Blob, and then writes it to the clipboard.

We use supports() to check whether the "image/svg+xml" MIME type is supported by the clipboard before fetching the image and writing it using clipboard.write(). We also wrap the whole function body in a try...catch statement to catch any other errors, such as ClipboardItem itself not being supported.

js
async function writeClipImg() {
  try {
    if (ClipboardItem.supports("image/svg+xml")) {
      const imgURL = "/my-image.svg";
      const data = await fetch(imgURL);
      const blob = await data.blob();
      await navigator.clipboard.write([
        new ClipboardItem({
          [blob.type]: blob,
        }),
      ]);
      console.log("Fetched image copied to clipboard.");
    } else {
      console.log("SVG image not supported by clipboard");
    }
  } catch (err) {
    console.error(err.name, err.message);
  }
}

Specifications

Specification
Clipboard API and events
# dom-clipboarditem-supports

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
supports() static method
Chrome – Full support
Chrome 121 (Release date: 2024-01-23)
footnote Full support
Edge – Full support
Edge 121 (Release date: 2024-01-25)
footnote Full support
Firefox – Full support
Firefox 127 (Release date: 2024-06-11)
footnote Full support
Opera – Full support
Opera 107 (Release date: 2024-02-07)
footnote Full support
Safari – Full support
Safari 18.4 (Release date: 2025-03-31)
footnote Full support
Chrome Android – Full support
Chrome Android 121 (Release date: 2024-01-23)
footnote Full support
Firefox for Android – Full support
Firefox for Android 127 (Release date: 2024-06-11)
footnote Full support
Opera Android – Full support
Opera Android 81 (Release date: 2024-03-14)
footnote Full support
Safari on iOS – Full support
Safari on iOS 18.4 (Release date: 2025-03-31)
footnote Full support
Samsung Internet – Full support
Samsung Internet 25 (Release date: 2024-04-24)
footnote Full support
WebView Android – Full support
WebView Android 121 (Release date: 2024-01-23)
footnote Full support
WebView on iOS – Full support
WebView on iOS 18.4 (Release date: 2025-03-31)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also