I want to create an extension for chrome browsers: item menu in context menu with two different actions when you use left or right click on item menu. For Firefox it can be realized, but for Chrome? How?
background.js:
chrome.runtime.onInstalled.addListener(function() {
chrome.contextMenus.create({
title: 'do action (left cl. - first, right cl. - second)',
id: 'test',
contexts: ['link'],
});
});
chrome.contextMenus.onClicked.addListener(function(info, tab) {
if (info.menuItemId === "test") {
console.log("first action completed")
}
});