ContextType to override, to allow menu items from other extensions in the menu. Currently only 'bookmark' and 'tab' are supported. showDefaults cannot be used with this option.
The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts except for 'tab' and 'tools_menu'.
The type of menu item.
ConstACTION_ConstonFired when a context menu item is clicked.
ConstonFired when a menu is hidden. This event is only fired if onShown has fired before.
ConstonFired when a menu is shown. The extension can add, modify or remove menu items and call menus.refresh() to update the menu.
Information about the context of the menu action and the created menu items. For more information about each property, see OnClickData. The following properties are only set if the extension has host permissions for the given context: linkUrl, linkText, srcUrl, pageUrl, frameUrl, selectionText.
Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in runtime.lastError).
Optionalcallback: () => void
Called when the item has been created in the browser. If there were any problems creating the item, details will be available in runtime.lastError.
The ID of the newly created item.
Retrieve the element that was associated with a recent contextmenu event.
The identifier of the clicked element, available as info.targetElementId in the menus.onShown, onClicked or onclick event.
Show the matching menu items from this extension instead of the default menu. This should be called during a 'contextmenu' DOM event handler, and only applies to the menu that opens after this event.
Updates the extension items in the shown menu, including changes that have been made since the menu was shown. Has no effect if the menu is hidden. Rebuilding a shown menu is an expensive operation, only invoke this method when necessary.
Removes a context menu item.
The ID of the context menu item to remove.
Removes all context menu items added by this extension.
Updates a previously created context menu item.
The ID of the item to update.
The properties to update. Accepts the same values as the create function.
Use the browser.contextMenus API to add items to the browser's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.
Permissions:
contextMenus