Created on 23 August 2021
icon_unfollowing
Login to follow
web-api-clipboard

Web API Clipboard

Stable version 1.0.1 (Compatible with OutSystems 11)
Uploaded on 23 August 2021 by 
web-api-clipboard

Web API Clipboard

Documentation
1.0.1

The Clipboard API provides the ability to respond to clipboard commands (cut, copy, and paste) as well as to asynchronously read from and write to the system clipboard. Access to the contents of the clipboard is gated behind the Permissions API: The clipboard-write permission is granted automatically to pages when they are in the active tab. The clipboard-read permission must be requested, which you can do by trying to read data from the clipboard. 

This API is designed to supersede accessing the clipboard using document.execCommand()


Methods

Clipboard_Read_Text

The Clipboard interface's readText() method returns a Promise which resolves with a copy of the textual contents of the system clipboard.

The "clipboard-read" permission of the Permissions API must be granted before you can read data from the clipboard.


Clipboard_Read_Binary

The read() method of the Clipboard interface requests a copy of the clipboard's contents, delivering the data to the returned Promise when the promise is resolved.

Unlike readText(), the read() method can return arbitrary data, such as images.


Clipboard_Write_Text

The Clipboard interface's writeText() property writes the specified text string to the system clipboard. Text may be read back using either read() or readText().

The "clipboard-write" permission of the Permissions API, is granted automatically to pages when they are in the active tab.


Clipboard_Write_Binary

The Clipboard method write() writes arbitrary data, such as images, to the clipboard. This can be used to implement cut and copy functionality.

The "clipboard-write" permission of the Permissions API, is granted automatically to pages when they are in the active tab.


Support options
This asset is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from  who created this asset.
Dependencies
Web API Clipboard has no dependencies.