Edit in GitHubLog an issue

document.clipboard

Clipboard support.

See: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard

setContent(data)#

Returns: Promise
Nonstandard: This method is non-standard.

ParamTypeDescription
dataObjectThe data to store in the clipboard. The object keys are the mime types, so for text, use text/plain as a key.

Example

Copied to your clipboard
navigator.clipboard.setContent({"text/plain": "Hello!"});

writeText(text)#

Sets the clipboard's contents.

Bugged: The standard does not support an object for text; when this is fixed in the future, your plugin may break.
See: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText

ParamTypeDescription
text*The text to set. Note, currently this will fail unless this is an object of the form {"text/plain": "text to set"}. This will be fixed in a future release.

clearContent()#

Clears the contents of the clipboard.

Returns: Promise
Nonstandard: This method is non-standard.

Copyright © 2021 Adobe. All rights reserved.