Document `contextMenus` alongside `menus` in WebExtensions API docs
MDN URL
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus
What specific section or headline is this issue about?
All menus reference pages and the "Context menu items" user interface guide.
What information was incorrect, unhelpful, or incomplete?
MDN only documents the menus namespace. The same API is also available under the contextMenus namespace, with a different permission:
menusnamespace +menuspermission: Firefox and Safari.contextMenusnamespace +contextMenuspermission: all browsers.
Because contextMenus is barely mentioned, the pages are hard to find when searching for e.g. contextMenus.create, and attempts to fix webextapiref flaws by replacing contextMenus links with menus links (mdn/content#44041, mdn/content#44090) or renaming examples (mdn/webextensions-examples#631) make the content less accurate.
In addition, menus.create and menus.ContextType claim that tools_menu is only available via the menus namespace. This has been incorrect since Firefox 91, where the ContextType differences between the two namespaces were dropped (Bugzilla bug 1706398).
What did you expect to see?
- [ ]
menuslanding page: a section explaining the overlap and differences between the two namespaces. Overlap: everything, unless stated otherwise. Differences:menus.getTargetElement()is only available in content scripts with themenuspermission;contextMenusis never available in content scripts; browser support as above. - [ ] Every
menusmethod, event, and type page: state prominently at the top that it documents bothmenus.*andcontextMenus.*, linking to that section. - [ ]
menus.createandmenus.ContextType: remove the claim thattools_menurequires themenusnamespace. - [ ] "Context menu items" guide: mention both namespaces and their permissions in the introduction, and use
menusin the examples. - [ ]
menus.createandmenus.onClicked: manually link the examples in mdn/webextensions-examples that usecontextMenusfrom the Examples sections, noting that they usecontextMenus. The examples themselves stay unchanged (https://github.com/mdn/webextensions-examples/pull/631#issuecomment-6345055895). - [ ] Decide how
{{WebExtAPIRef("contextMenus.*")}}links should resolve (e.g. in Firefox release notes) once the above is in place.
Do you have any supporting links, references, or citations?
- https://github.com/mdn/content/pull/44090#discussion_r3226428159
- https://github.com/mdn/webextensions-examples/pull/631#pullrequestreview-4272353548
- https://bugzilla.mozilla.org/show_bug.cgi?id=1706398
Do you have anything more you want to share?
No response
Hi everyone, I’d like to give it a try.