Add-ons

menus.create()

Creates a new menu item, given an options object defining properties for the item.

Unlike other asynchronous functions, this one does not return a promise, but uses an optional callback to communicate success or failure. This is because its return value is the ID of the new item.

For compatibility with other browsers, Firefox makes this method available via the contextMenus namespace as well as the menus namespace. Note though that it's not possible to create tools menu items (contexts: ["tools_menu"]) using the contextMenus namespace.

Document Tags and Contributors

 Contributors to this page: wbamberg, yfdyh000, ThiefZero, andrewtruongmoz, Makyen, rolfedh
 Last updated by: wbamberg,
Would you answer 4 questions for us? Open the survey in a new tab and fill it out when you are done on the site. Thanks!