Newly available Newly available. Verify your target environments before adopting.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
66
79
63
13.1
66
13.4

The read() method of the Clipboard interface requests a copy of the clipboard's contents, fulfilling the returned Promise with the data.

76
79
127
13.1
76
13.4

The readText() method of the Clipboard interface returns a Promise which fulfills with a copy of the textual contents of the system clipboard.

66
79
125
13.1
66
13.4
type_image-png

Supports `image/png` MIME type

76
79
127
13.1
76
13.4
type_text-html

Supports `text/html` MIME type

86
86
127
13.1
86
13.4
type_text-plain

Supports `text/plain` MIME type

76
79
127
13.1
76
13.4

The write() method of the Clipboard interface writes arbitrary ClipboardItem data such as images and text to the clipboard, fulfilling the returned Promise on completion. This can be used to implement cut and copy functionality.

76
79
127
13.1
76
13.4

The writeText() method of the Clipboard interface writes the specified text to the system clipboard, returning a Promise that is resolved once the system clipboard has been updated.

66
79
63
13.1
66
13.4

The ClipboardItem interface of the Clipboard API represents a single item format, used when reading or writing clipboard data using Clipboard.read() and Clipboard.write() respectively.

76
79
127
13.1
84
13.4

The ClipboardItem() constructor creates a new ClipboardItem object, which represents data to be stored or retrieved via the Clipboard API clipboard.write() and clipboard.read() methods, respectively.

133
133
127
13.1
98
13.4

The getType() method of the ClipboardItem interface returns a Promise that resolves with a Blob of the requested MIME type or an error if the MIME type is not found.

76
79
127
13.1
84
13.4

The read-only presentationStyle property of the ClipboardItem interface returns a string indicating how an item should be presented.

127
13.1
13.4

The read-only types property of the ClipboardItem interface returns an Array of MIME type available within the ClipboardItem.

76
79
127
13.1
84
13.4

The clipboard read-only property of the Navigator interface returns a Clipboard object used to read and write the clipboard's contents.

66
79
63
13.1
66
13.4
permission_clipboard-write
Experimental

`clipboard-write` permission

64
79
64
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Notes 1 item(s)
Implementation note
  • The user must grant the `clipboard-read` permission.
Notes 1 item(s)
Implementation note
  • The user must grant the `clipboard-read` permission.
Notes 3 item(s)
Implementation note
  • This method must be called within user gesture event handlers.
  • A paste prompt is displayed when the clipboard is read. If the clipboard contains same-origin content, the prompt is suppressed.
  • Web extensions with the `clipboardRead` permission in their manifest can read data without the paste prompt displaying. Prior to Firefox 147, extensions without this permission were unable to read clipboard data.
Notes 1 item(s)
Implementation note
  • The user must grant the `clipboard-read` permission.
Notes 1 item(s)
Implementation note
  • The user must grant the `clipboard-read` permission.
Notes 1 item(s)
Implementation note
  • The user must grant the `clipboard-read` permission.
Notes 3 item(s)
Implementation note
  • This method must be called within user gesture event handlers.
  • A paste prompt is displayed when the clipboard is read. If the clipboard contains same-origin content, the prompt is suppressed.
  • Web extensions with the `clipboardRead` permission in their manifest can read data without the paste prompt displaying. Prior to Firefox 147, extensions without this permission were unable to read clipboard data.
Notes 1 item(s)
Implementation note
  • The user must grant the `clipboard-read` permission.
Notes 2 item(s)
Implementation note
  • From version 107, this method must be called within user gesture event handlers, or the user must grant the `clipboard-write` permission.
  • Before version 107, the user must grant the `clipboard-write` permission.
Notes 2 item(s)
Implementation note
  • This method must be called within user gesture event handlers.
  • Web extensions with the `clipboardWrite` permission in their manifest can write data without a user gesture.
Notes 2 item(s)
Implementation note
  • From version 107, this method must be called within user gesture event handlers, or the user must grant the `clipboard-write` permission.
  • Before version 107, the user must grant the `clipboard-write` permission.
Notes 2 item(s)
Implementation note
  • From version 107, this method must be called within user gesture event handlers, or the user must grant the `clipboard-write` permission.
  • Before version 107, the user must grant the `clipboard-write` permission.
Notes 2 item(s)
Implementation note
  • From version 107, this method must be called within user gesture event handlers, or the user must grant the `clipboard-write` permission.
  • Before version 107, the user must grant the `clipboard-write` permission.
Notes 2 item(s)
Implementation note
  • This method must be called within user gesture event handlers.
  • Web extensions with the `clipboardWrite` permission in their manifest can write data without a user gesture.
Notes 1 item(s)
Implementation note
  • This method must be called within user gesture event handlers.
Notes 2 item(s)
Implementation note
  • From version 107, this method must be called within user gesture event handlers, or the user must grant the `clipboard-write` permission.
  • Before version 107, the user must grant the `clipboard-write` permission.
Notes 1 item(s)
Implementation note
  • This method must be called within user gesture event handlers.
Notes 5 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (133)
  • This feature was removed in a later browser version (98)
Implementation note
  • Only accepts a `Blob` or a Promise resolving to a `Blob` as the item data.
  • Only accepts a `Blob` as the item data. See bug 40103226.
Notes 5 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (133)
  • This feature was removed in a later browser version (98)
Implementation note
  • Only accepts a `Blob` or a Promise resolving to a `Blob` as the item data.
  • Only accepts a `Blob` as the item data. See bug 40103226.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (98)
Implementation note
  • The `ClipboardItem` constructor only accepts a blob as the item data, but not strings or Promises that resolve to strings or blobs. See bug 40103226.

Use cases

  • Using Async clipboard

    The Clipboard interface of the Clipboard API provides read and write access to the contents of the system clipboard.

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.