Clipboard.setText
Functional API
setClipboardTextYou can use the same function with this as well.
Feature description
Copies text to the clipboard. The user can paste it in another app.
If clipboard write permission is not available SetClipboardTextPermissionErroroccurs. Clipboard.setText.getPermission()to check the permission status, Clipboard.setText.openPermissionDialog()to request permission again.
Type
Clipboard.setText(text: string): Promise<void>;Params
The text to copy to the clipboard.
Response
None.
Error
The error is thrown as a class — error instanceof SetClipboardTextPermissionErroridentify it with. The class can @apps-in-toss/web-frameworkbe imported from
SetClipboardTextPermissionError
This is the case when clipboard write permission is denied. Clipboard.setText.openPermissionDialog()You can request again with
Example code
JavaScript
Was this helpful?