clipboard API

Offers the ability to write to the clipboard. Reading is not supported because the clipboard can already be read through the standard web platform APIs.

Note

The permission clipboardWrite is required to use messenger.clipboard.*.

Functions

setImageData(imageData, imageType)

Copy an image to the clipboard. The image is re-encoded before it is written to the clipboard. If the image is invalid, the clipboard is not modified.

Parameters

imageData

The image data to be copied.

imageType

(string)

The type of imageData.

Supported values:

jpeg

png

Required permissions

  • clipboardWrite