Nossos voluntários ainda não traduziram este artigo para o Português (do Brasil). Junte-se a nós e ajude-nos a fazer o trabalho!
Você também pode ler o artigo em English (US).

The Clipboard API adds to the Navigator interface the read-only clipboard property, which returns the Clipboard object used to read and write the clipboard's contents. The Clipboard API can be used to implement cut, copy, and paste features within a web application.

Use of the asynchronous clipboard read and write methods requires that the user grant the web site or app permission to access the clipboard. This permission must be obtained from the Permissions API using the "clipboard-read" and/or "clipboard-write" permissions.


theClipboard = navigator.clipboard;


The Clipboard object used to access the system clipboard.


The following code uses navigator.clipboard to access the system clipboard in order to read the contents of the clipboard.

  clipText => document.querySelector(".cliptext").innerText = clipText);

This snippet replaces the contents of the element whose class is "cliptext" with the text contents of the clipboard. Perhaps this code is being used in a browser extension that displays the current clipboard contents, automatically updating periodically or when specific events fire.

If the clipboard is empty or doesn't contain text, the "cliptext" element's contents are cleared. This happens because readText() returns an empty string if the clipboard is empty or doesn't contain text.


Specification Status Comment
Clipboard API and events
The definition of 'navigator.clipboard' in that specification.
Working Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
clipboardChrome Full support 66Edge ? Firefox Full support 63IE ? Opera Full support YesSafari ? WebView Android Full support 66Chrome Android Full support 66Edge Mobile ? Firefox Android Full support 63Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes


Full support  
Full support
Compatibility unknown  
Compatibility unknown

Etiquetas do documento e colaboradores

Colaboradores desta página: mdnwebdocs-bot, Magistern, mfuji09, Sheppy
Última atualização por: mdnwebdocs-bot,