JavaScripture
Contribute via GitHub Feedback

ClipboardItem : Object

An item to place on the clipboard. Note FireFox does not yet support this API. See Bug 1619947.

Constructors

new ClipboardItem(valuesByType : Object, [options : Object]) : ClipboardItem
options : {
presentationStyle :String'attachment', 'inline', or 'unspecified'. Default = 'unspecified'.
}

valuesByType is an object where the property names are the mime types and the property values are the data for that type. The property values must be either a String or Blob, or a Promise that returns a String or Blob. Note Chrome does not yet support promises. See Bug 1014310.

Copy Text Example

Example:

Run

Results:

 

Copy Image Example

Example:

Run

Results:

 

Instance Properties

delayed : Boolean  

lastModified : Number  

presentationStyle : String  

'attachment', 'inline', or 'unspecified'.

types : Array<String>  

Instance Methods

getType(type : String) : Promise<Blob>

ClipboardItem Methods

createDelayed(valuesByType : Object, [options : Object]) : ClipboardItem
options : {
presentationStyle :String'attachment', 'inline', or 'unspecified'. Default = 'unspecified'.
}