Skip to content Skip to sidebar Skip to footer

Firefox Webextension Alternative To Addon Clipboard Sdk For Copying Images

I am trying to develop a Firefox extension which involves copying an image to the clipboard. In the past, it appears that this was accomplished using the clipboard addon sdk. Howev

Solution 1:

WebExtensions has setImageData().

Copy an image that was bundled with the extension:

// requires the API permission "clipboardWrite"fetch(browser.runtime.getURL('image.png'))
.then(response => response.arrayBuffer())
.then(buffer => browser.clipboard.setImageData(buffer, 'png'));

clipboard.setImageData() - Mozilla | MDN

Post a Comment for "Firefox Webextension Alternative To Addon Clipboard Sdk For Copying Images"