问题
Most of these questions seem to pertain to adding a right click to elements and pages using context menus. I would like to know if it is possible to add a right click option to a Chrome extension's icon. I.e. put an option such as "Documentation" between "Options" and "Disable"
回答1:
There is no API for that currently and I am not aware of any in the works.
If there was anything, it would be in the Browser Action or Page Action documentation.
回答2:
You can use Chrome create contextMenus API and set contexts="browser_action"
Example
chrome.contextMenus.create({
"type":"checkbox",
"checked":true,
"title":"Connect via Cloud",
"contexts":["browser_action"],
"onclick":function(info, tab) {
console.log(info);
}
});
来源:https://stackoverflow.com/questions/12083638/add-right-click-option-to-chrome-extensions-icon