0

Good morning, I searched around but I didn't find a working solution to copy an image(png, jpg) from a URL link to the clipboard. I tried:

const response = await fetch(image1);
const blob = await response.blob();
try {
    navigator.clipboard.write([
        new ClipboardItem({
            'image/jpg': blob
        })
    ]);
} catch (error) {
    console.error(error);
}
Sorry if it's a dumb question.
  • 1
    I don't get what you are trying to ask could you elaborate, please? have a look at this I think the same kind of question. [here](https://stackoverflow.com/questions/33175909/copy-image-to-clipboard) – Ameya Jun 30 '22 at 21:09
  • @Ameya thank you for the response, but I tried the solution proposed https://stackoverflow.com/a/59162806 but it doesn't work. The other solutions doesn't seem to be what I need. To explain it better, I want to copy an image I have the link of lets say https://........../image.jpg to the clipboard, so I can paste it in my word in a faster way. – xsjq7mb Jul 03 '22 at 21:44

0 Answers0