Skip to content

Commit

Permalink
Appease eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
bijij committed Dec 30, 2021
1 parent d0e4378 commit 98e3a4a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,29 @@ chrome.storage.sync.get('defaultOptions', function () {
// Setup "Search by image" context menu item
chrome.contextMenus.create(
{
"id": "ViewImage-SearchByImage",
"title": toI18n("__MSG_searchImage__"),
"contexts": ["image"],
'id': 'ViewImage-SearchByImage',
'title': toI18n('__MSG_searchImage__'),
'contexts': ['image'],
}
);

chrome.contextMenus.onClicked.addListener(
(info, tab) => {

if (DEBUG)
console.log("ViewImage: Search By Image context menu item clicked.", info, tab);
console.log('ViewImage: Search By Image context menu item clicked.', info, tab);

if (info.menuItemId === "ViewImage-SearchByImage") {
if (info.menuItemId === 'ViewImage-SearchByImage') {
chrome.permissions.request({
permissions: ["tabs"],
permissions: ['tabs'],
origins: [tab.url],
}, (granted) => {
if (granted) {
chrome.tabs.executeScript(tab.id, {
code: `window.location.href = "http://www.google.com/searchbyimage?image_url=${encodeURIComponent(info.srcUrl)}"`
})
code: `window.location.href = 'http://www.google.com/searchbyimage?image_url=${encodeURIComponent(info.srcUrl)}'`
});
}
});
}
}
);
);

0 comments on commit 98e3a4a

Please sign in to comment.