ClipboardItem.supports()
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.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 121 | 121 | 127 | 18.4 | 121 | 18.4 | |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
JAVASCRIPT
supports(type) Use cases
-
Using ClipboardItem.supports()
The supports() static method of the ClipboardItem interface returns true if the given MIME type is supported by the clipboard, and false otherwise.
Cautions
- May not be supported in older browsers.
Implementation notes
- Some APIs require a secure context (HTTPS) or user activation. Check the requirements before use.