Removes a context menu item.


  menuItemId,      // integer or string
  function() {...} // optional function

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


integer or string. The ID of the context menu item to remove.
function. Called when the context menu has been removed. If the item could not be found or some other error occurs, runtime.lastError will be set, and you can check for it in this function.

Browser compatibility

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


This add-on adds a context menu item labeled "Remove me!". If you click the item, the add-on removes it.

function onCreated() {
  if (chrome.runtime.lastError) {
    console.log("error creating item:" + chrome.runtime.lastError);
  } else {
    console.log("item created successfully");

function onRemoved() {
  if (chrome.runtime.lastError) {
    console.log("error removing item:" + chrome.runtime.lastError);
  } else {
    console.log("item removed successfully");

  id: "remove-me",
  title: "Remove me!",
  contexts: ["all"]
}, onCreated);

chrome.contextMenus.onClicked.addListener(function(info, tab) {
  if (info.menuItemId == "remove-me") {
    chrome.contextMenus.remove(info.menuItemId, onRemoved);

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,