For the complete documentation index, see llms.txt. This page is also available as Markdown.

Clipboard.getText

Functional API getClipboardTextYou can use the same function with this as well.

Feature description

Gets the text stored in the clipboard. If there is no text in the clipboard, returns an empty string.

If you don't have clipboard read permission GetClipboardTextPermissionErroroccurs. Clipboard.getText.getPermission()to check the permission status, Clipboard.getText.openPermissionDialog()to request permission again.

Type

Clipboard.getText(): Promise<string>;

Params

None

Response

Returns the text stored in the clipboard. If there is no text, it is an empty string.

Error

The error is thrown as a class — error instanceof GetClipboardTextPermissionErroridentify it with. The class can @apps-in-toss/web-frameworkbe imported from

Error class
Description

GetClipboardTextPermissionError

This is when clipboard read permission has been denied. Clipboard.getText.openPermissionDialog()You can request again with

Example code

JavaScript

Was this helpful?