clipboard는 데이터 저장 또는 전송을 위한 짧은 기간동안 사용하는 데이터 버퍼 입니다. documents 와 applications 양쪽에서 사용 가능합니다. It is usually implemented as an anonymous, temporary data buffer, sometimes called the paste buffer, that can be accessed from most or all programs within the environment via defined programming interfaces.
Clipboard API 의
Clipboard 인터페이스는 시스템 클립보드로부터 텍스트 및 데이터를 읽거나 시스템 클립보드에 쓰기 위한 인터페이스를 지원합니다.
The Clipboard API can be used to implement cut, copy, and paste features within a web application.
The system clipboard is exposed through the global
Calls to the methods of the
Clipboard object will not succeed if the user hasn't granted the needed permissions using the Permissions API and the
"clipboard-write" permission as appropriate.
Note: In reality, at this time browser requirements for access to the clipboard vary significantly. Please see the section Clipboard availability for details.
All of the Clipboard API methods operate asynchronously; they return a
Promise which is resolved once the clipboard access has been completed. The promise is rejected if clipboard access is denied.
EventTarget 인터페이스를 기반으로 하고 있으며, 해당 인터페이스의 method를 포함합니다.
- 클립보드로부터 임의의 데이터(이미지와 같은)를 요청하며, returning a
Promise. When the data has been retrieved, the promise is resolved with a
DataTransferobject that provides the data.
- 시스템 클립보드로부터 텍스트를 읽는다. returns a
Promisewhich is resolved with a
DOMStringcontaining the clipboard's text once it's available.
- 시스템 클립보드에 예를 들어 이미지들과 같은 데이터를 쓴다. 이 비동기 작업은 Promise를 반환된
Promise를 resolve 함으로써 작업이 종료되었다는 사실을 알립니다.
- 시스템 클립보드에 텍스트를 쓰며, returning a
Promisewhich is resolved once the text is fully copied into the clipboard.
The asynchronous clipboard API is a relatively recent addition, and the process of implementing it in browsers is not yet complete. Due to both potential security concerns and technical complexities, the process of integrating this API is happening gradually in most browsers.
For example, Firefox does not yet support the
"clipboard-write" permissions, so access to the methods that access and change the contents of the clipboard are restricted in other ways.
For WebExtensions, you can request the clipboardRead and clipboardWrite permissions to be able to use clipboard.readText() and clipboard.writeText(). Content scripts applied on HTTP sites do not have access to the clipboard object. See extensions in Firefox 63.
|Clipboard API and events
The definition of 'Clipboard' in that specification.
|Working Draft||Initial definition.|
BCD tables only load in the browser