Updates a previously created context menu item.


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

This API is also available as browser.contextMenus.update() in a version that returns a promise.


integer or string. The ID of the item to update.
object. The properties to update. Accepts the same values as create().
contextMenus.ItemType. The type of menu item: "normal", "checkbox", "radio", "separator". Defaults to "normal".
string. The text to be displayed in the item; this is mandatory unless type is "separator".
boolean. The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items.
array of contextMenus.ContextType. Array of contexts in which this menu item will appear. Defaults to ['page'] if not specified.
function. A function that will be called when the menu item is clicked. Event pages cannot use this: instead, they should register a listener for contextMenus.onClicked.
integer or string.  The ID of a parent menu item; this makes the item a child of a previously added item. Note: You cannot change an item to be a child of one of its own descendants.
array of string. Lets you restrict the item to apply only to documents whose URL matches one of the given match patterns. This applies to frames as well.
array of string. Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags.
boolean. Whether this context menu item is enabled or disabled. Defaults to true.
function. Called when the context menu has been updated.

Browser compatibility

Chrome Edge Firefox Firefox for Android Opera
Basic support Yes Yes 48.0 No 33

Compatibility notes


  • documentUrlPatterns is supported from Firefox 50.


This example creates a context menu item, then updates its title when the user clicks it:

function onUpdated() {
  if (chrome.runtime.lastError) {
    console.log("error updating item:" + chrome.runtime.lastError);
  } else {
    console.log("item updated successfully");

  id: "do-not-click-me",
  title: "Do not click this button",
  contexts: ["all"]

chrome.contextMenus.onClicked.addListener(function(info, tab) {
  if (info.menuItemId == "do-not-click-me") {
    chrome.contextMenus.update(info.menuItemId, {
      title: "Do not click this button again"
    }, onUpdated);

Example add-ons


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

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.

Document Tags and Contributors

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