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.
14 lines
423 B
14 lines
423 B
chrome.runtime.onInstalled.addListener(() => {
|
|
chrome.contextMenus.create({
|
|
id: "searchWithLens",
|
|
title: "Search Image with Google Lens",
|
|
contexts: ["image"]
|
|
});
|
|
});
|
|
|
|
chrome.contextMenus.onClicked.addListener((info, tab) => {
|
|
if (info.menuItemId === "searchWithLens") {
|
|
const url = `https://lens.google.com/uploadbyurl?url=${encodeURIComponent(info.srcUrl)}`;
|
|
chrome.tabs.create({ url });
|
|
}
|
|
});
|
|
|