You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
503 B
19 lines
503 B
chrome.contextMenus.create({
|
|
id: "copyImageLink",
|
|
title: "Copy Image Link",
|
|
contexts: ["image"],
|
|
onclick: (info, tab) => {
|
|
// Get the URL of the clicked image
|
|
const imageUrl = info.srcUrl;
|
|
|
|
// Copy the image URL to the clipboard
|
|
navigator.clipboard.writeText("")
|
|
.then(() => {
|
|
console.log("Image URL copied to clipboard:", imageUrl);
|
|
})
|
|
.catch(error => {
|
|
console.error("Error copying image URL:", error);
|
|
});
|
|
}
|
|
});
|
|
|
|
|