--- title: Clipboard slug: Web/API/Clipboard tags: - API - Clipboard - Clipboard API - Interface - Reference - 인터페이스 - 클립보드 - 클립보드 API translation_of: Web/API/Clipboard ---
{{SeeCompatTable}}{{APIRef("Clipboard API")}}
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.
A typical application accesses clipboard functionality by mapping user input such as keybindings, menu selections, etc. to these 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 {{domxref("Navigator.clipboard")}} property.
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-read"
or "clipboard-write"
permission as appropriate.
Note: In reality, at this time browser requirements for access to the clipboard vary significantly. Please see the section {{anch("Clipboard availability")}} for details.
All of the Clipboard API methods operate asynchronously; they return a {{jsxref("Promise")}} which is resolved once the clipboard access has been completed. The promise is rejected if clipboard access is denied.
Clipboard
는 {{domxref("EventTarget")}} 인터페이스를 기반으로 하고 있으며, 해당 인터페이스의 method를 포함합니다.
Promise
which is resolved with a {{domxref("DOMString")}} containing the clipboard's text once it's available.Promise
를 resolve 함으로써 작업이 종료되었다는 사실을 알립니다.Promise
which 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-read"
and "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.
In addition, {{domxref("Clipboard.read", "read()")}} and {{domxref("Clipboard.write", "write()")}} are disabled by default and require changing a preference to enable them. Check the compatibility tables for each method before using it.
Specification | Status | Comment |
---|---|---|
{{SpecName('Clipboard API','#clipboard-interface','Clipboard')}} | {{Spec2('Clipboard API')}} | Initial definition. |
{{Compat("api.Clipboard")}}