contextMenus.update()

Updates a previously created context menu item.

Syntax

browser.contextMenus.update(
  id,               // integer or string
  updateProperties, // object
  function() {...}  // optional function
)

Parameters

id
integer or string. The ID of the item to update.
updateProperties
object. The properties to update. Accepts the same values as the create function.
typeOptional
contextMenus.ItemType.
titleOptional
string.
checkedOptional
boolean.
contextsOptional
array of contextMenus.ContextType.
onclickOptional
function.
parentIdOptional
integer or string. Note: You cannot change an item to be a child of one of its own descendants.
documentUrlPatternsOptional
array of string.
targetUrlPatternsOptional
array of string.
enabledOptional
boolean.
callbackOptional
function. Called when the context menu has been updated.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?45.0Yes33
Firefox
Basic supportNo

Examples

Acknowledgements

This API is based on Chromium's chrome.contextMenus API. This documentation is derived from context_menus.json in the Chromium code.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,