--- url: "https://web.dev/blog/baseline-clipboard-item-supports" titulek: "The ClipboardItem.supports() function is now Baseline Newly available | Blog | web.dev" h1: "The ClipboardItem.supports() function is now Baseline Newly available Stay organized with collections Save and categorize content based on your preferences." popis: "The static ClipboardItem.supports() function to determine support for a given MIME type is now part of Baseline." jazyk: "en" kanonicka: "https://web.dev/blog/baseline-clipboard-item-supports" drobecky: ["Blog", "The ClipboardItem.supports() function is now Baseline Newly available"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 00:05:40" znaku: 4095 slov: 552 kodovani: "iso-8859-2" sha256: "d239c79273759cbd53ad77169aa61db4d6de59757bdd9baad40d1740227c9227" --- The ClipboardItem.supports() function is now Baseline Newly available Stay organized with collections Save and categorize content based on your preferences. Thomas Steiner Published: April 30, 2025 Celebration: This web feature is now available in all three major browser engines, and becomes Baseline Newly available as of March 30, 2025. The Async Clipboard API has made working with the clipboard a lot easier than it used to be in the past. In lieu of previous methods for managing the clipboard, you can now call [`navigator.clipboard.writeText()`](https://developer.mozilla.org/docs/Web/API/Clipboard/writeText) for plain text content or [`navigator.clipboard.write()`](https://developer.mozilla.org/docs/Web/API/Clipboard/write) for "almost" everything else like images, textual content, or HTML. One missing piece so far, though, was quantifying the "almost". For example, you couldn't know if the API supported SVG until you tried, and then, in case of non-support, caught the exception that was thrown. This wasn't a very ergonomic way to determine support, which is why the static [`ClipboardItem.supports()`](https://developer.mozilla.org/docs/Web/API/ClipboardItem/supports_static) function was specified. The function has now reached Baseline Newly available status, which means working with the clipboard becomes even better. To know if a browser supports a given format, pass the MIME type of the format you're interested in to the function. `const format = 'image/svg+xml'; const supportsFormat = ClipboardItem.supports(format); console.log(`This browser does${supportsFormat ? '' : ' not'} support ${format}.`); // "This browser does support image/svg+xml."` Before, I wrote "almost" *everything* else, and this is where it gets really interesting. [Web custom formats](https://developer.chrome.com/blog/web-custom-formats-for-the-async-clipboard-api) allow you to work with formats the browser doesn't natively support. For example, by default, the browser doesn't support AVIF images. `const format = 'image/avif'; const supportsFormat = ClipboardItem.supports(format); console.log(`This browser does${supportsFormat ? '' : ' not'} support ${format}.`); // "This browser does not support image/avif."` But by using web custom formats, you can work with AVIF images and copy and paste them around freely, as long as the receiving party also knows how to deal with the web custom format. `const format = 'web image/avif'; const supportsFormat = ClipboardItem.supports(format); console.log(`This browser does${supportsFormat ? '' : ' not'} support ${format}.`); // "This browser does support web image/avif."` Thanks to the `ClipboardItem.supports()` function, you can now properly detect the clipboard support situation for web custom format as well and be sure it works. `if (ClipboardItem.supports('web image/avif')) { // Fetch remote AVIF image and obtain its blob representation. const blob = await fetch('image.avif').then((response) => response.blob()); try { // Write the image data to the clipboard, prepending the blob's actual // type (`"image/avif"` with the string `"web "`, so it becomes // `"web image/avif"`. const clipboardItem = new ClipboardItem({ 'web image/avif': blob, }); await navigator.clipboard.write([clipboardItem]); } catch (err) { console.error(err.name, err.message); } }` With the `ClipboardItem.supports()` function now Baseline Newly available, web developers can reliably detect clipboard support for various MIME types, including web custom formats. This enhancement makes working with the clipboard more robust and predictable, improving the user experience across all browsers. Except as otherwise noted, the content of this page is licensed under the [Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). For details, see the [Google Developers Site Policies](https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates. Last updated 2025-04-30 UTC.