You can add a context menu using the new Mozilla add-in SDK image using the image property
in the Advanced Settings section:
just add an image attribute like this
var menuItem = contextMenu.Menu({ include: "*.stackoverflow.com", label: "do something", image: "data:image/png;base64,iVBORw0KGgoAA ...", context: contextMenu.SelectorContext('div.someclass'), contentScriptFile: data.url("cs.js"), items: [ contextMenu.Item({ label: "Item 1", data: "item1" }), contextMenu.Item({ label: "Item 2", data: "item2" }), contextMenu.Item({ label: "Item 3", data: "item3" }) ] });
image: element icon, string URL. The URL may be remote, a link to an image in the add-in data directory or data URI.
Mozilla context menu help page for Addon SDK
ejectamenta
source share