chrome.clipboard
Description: |
The chrome.clipboard API is provided to allow users to
access data of the clipboard. This is a temporary solution for
chromeos platform apps until open-web alternative is available. It will be
deprecated once open-web solution is available, which could be in 2017 Q4.
|
Availability: |
Dev channel only.
Learn more.
|
Permissions: |
"clipboard"
|
Summary
Methods | |
---|---|
setImageData −
chrome.clipboard.setImageData(ArrayBuffer imageData, enum of
| |
Events | |
onClipboardDataChanged |
Methods
setImageData
chrome.clipboard.setImageData(ArrayBuffer imageData, enum of "png"
, or "jpeg"
type, array of object additionalItems, function callback)
Dev channel only. Learn more.
Sets image data to clipboard.
Parameters | ||||||||
---|---|---|---|---|---|---|---|---|
ArrayBuffer | imageData |
Since Chrome 86. Warning: this is the current Dev channel. Learn more. The encoded image data. |
||||||
enum of "png" , or "jpeg" |
type |
Since Chrome 86. Warning: this is the current Dev channel. Learn more. The type of image being passed. |
||||||
array of object | (optional) additionalItems |
Since Chrome 86. Warning: this is the current Dev channel. Learn more.
Additional data items for describing image data. The callback is called with Properties of each object
|
||||||
function | (optional) callback |
If you specify the callback parameter, it should be a function that looks like this: function() {...};
|
Events
onClipboardDataChanged
Dev channel only. Learn more.
Fired when clipboard data changes. Requires clipboard and clipboardRead permissions for adding listener to chrome.clipboard.onClipboardDataChanged event. After this event fires, the clipboard data is available by calling document.execCommand('paste').
addListener
chrome.clipboard.onClipboardDataChanged.addListener(function callback)
Parameters | ||
---|---|---|
function | callback |
The callback parameter should be a function that looks like this: function() {...};
|