Clipboard

Overview

The Clipboard interface implements the Clipboard API, providing—if the user grants permission—both read and write access to the contents of the system clipboard.

Location

Required Methods


read

Requests arbitrary data (such as images) from the clipboard, returning a Promise. When the data has been retrieved, the promise is resolved with a DataTransfer object that provides the data.

 

method read: DataTransfer

 

DataTransfer read()

 

func read() -> DataTransfer

 

DataTransfer read()

 

Function read() As DataTransfer

readText

Requests text from the system clipboard; returns a Promise which is resolved with a DOMString containing the clipboard's text once it's available.

 

method readText: String

 

String readText()

 

func readText() -> String

 

String readText()

 

Function readText() As String

write

Writes arbitrary data to the system clipboard. This asynchronous operation signals that it's finished by resolving the returned Promise.

 

method write(pardata: dynamic): dynamic

 

dynamic write(dynamic pardata)

 

func write(_ pardata: dynamic) -> dynamic

 

dynamic write(dynamic pardata)

 

Function write(pardata As dynamic) As dynamic

Parameters:

  • pardata:

writeText

Writes text to the system clipboard, returning a Promise which is resolved once the text is fully copied into the clipboard.

 

method writeText(parnewClipText: dynamic): String

 

String writeText(dynamic parnewClipText)

 

func writeText(_ parnewClipText: dynamic) -> String

 

String writeText(dynamic parnewClipText)

 

Function writeText(parnewClipText As dynamic) As String

Parameters:

  • parnewClipText: