How do I copy image directly to clipboard from an image url ? I am getting ClipboardItem or browser is not defined when i try 2 ways to copy to clipboard

const copyImage = async () => {

try {

// var response = await fetch(

//   'https://cors-anywhere.herokuapp.com/https://pngimg.com/uploads/cheetah/cheetah_PNG14848.png'

// );

// var response = await fetch('./cheetah.png');

// console.log(response);

// var blob = await response.blob();

// console.log(blob);

// await navigator.clipboard.write([new ClipboardItem({ 'img/png': blob })]);

// await navigator.clipboard.write([

//   new ClipboardItem({

//     [blob.type]: blob,

//   }),

// ]);

fetch(

  'https://cors-anywhere.herokuapp.com/https://pngimg.com/uploads/cheetah/cheetah_PNG14848.png'

)

  .then((response) => response.arrayBuffer())

  .then((buffer) => browser.clipboard.setImageData(buffer, 'png'));

} catch (err) {

console.error('Failed to copy!', err);

}

// navigator.clipboard.writeText(‘testing’)

};