Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Clipboard

Clipboard

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨March 2020⁩.

* Some parts of this feature may have varying levels of support.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

TheClipboard interface of theClipboard API provides read and write access to the contents of the system clipboard.This allows a web application to implement cut, copy, and paste features.

EventTarget Clipboard

The system clipboard is exposed through the globalNavigator.clipboard property.

All of the Clipboard API methods operate asynchronously; they return aPromise which is resolved once the clipboard access has been completed.The promise is rejected if clipboard access is denied.

All the methods require asecure context.Additional requirements for using the API are discussed in theSecurity consideration section of the API overview topic.

Instance methods

Clipboard is based on theEventTarget interface, and includes its methods.

read()

Requests arbitrary data (such as images) from the clipboard, returning aPromise that resolves with an array ofClipboardItem objects containing the clipboard's contents.

readText()

Requests text from the system clipboard, returning aPromise that is fulfilled with a string containing the clipboard's text once it's available.

write()

Writes arbitrary data to the system clipboard, returning aPromise that resolves when the operation completes.

writeText()

Writes text to the system clipboard, returning aPromise that is resolved once the text is fully copied into the clipboard.

Specifications

Specification
Clipboard API and events
# clipboard-interface

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp