Updates a previously created menu item.

For compatibility with other browsers, Firefox makes this method available via the contextMenus namespace as well as the menus namespace.

This is an asynchronous function that returns a Promise.


var updating = browser.menus.update(
  id,               // integer or string
  updateProperties // object


integer or string. The ID of the item to update.
object. The properties to update. The same as the createProperties object passed to menus.create(), except that id can't be set.

Return value

A Promise that will be fulfilled with no arguments if the update was successful, or rejected with an error message if the update failed.

Browser compatibility

ChromeEdgeFirefoxFirefox for AndroidOpera
Basic Support (Yes) (as contextMenus.update) (Yes) (as contextMenus.update)


48 (as contextMenus.update)

No (Yes) (as contextMenus.update)


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

function onUpdated() {
  console.log("item updated successfully");

function onError() {
  console.log("error updating item:" + browser.runtime.lastError);

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

browser.menus.onClicked.addListener(function(info, tab) {
  if (info.menuItemId == "do-not-click-me") {
    var updating = browser.contextMenus.update(info.menuItemId, {
      title: "Do not click this button again"
    updating.then(onUpdated, onError);

Example extensions


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, Makyen
 Last updated by: wbamberg,