12

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"

Rhyono
  • 2,420
  • 1
  • 25
  • 41
  • Does this answer your question? [Add contextmenu items to a Chrome extension's browser action button](https://stackoverflow.com/questions/19468429/add-contextmenu-items-to-a-chrome-extensions-browser-action-button) – Kos Nov 06 '20 at 14:13

2 Answers2

21

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);
  }
});
MithooG
  • 331
  • 2
  • 4
5

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.

sachleen
  • 30,730
  • 8
  • 78
  • 73
  • Seems like something that should exist. But that's how these things go: you don't know they don't exist until you need them. Yeah, I was perusing the Browser Action page trying to find something I overlooked. – Rhyono Aug 23 '12 at 01:43
  • 5
    This is no longer true, you CAN add to that contextMenu. See http://stackoverflow.com/a/26760703/2278186 – SatA Sep 08 '16 at 11:06