Closed djbrown closed 3 months ago
AFAIK Firefox didn't throw that error a year ago
The browser_action
key has always been a requirement for the browserAction
API.
It would be a good idea to double-check that the manifest key requirement is well-documented in the articles of all extension APIs. I went through the list of manifest keys at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json#list_of_manifest.json_keys and from my recollection, these are the keys with an API:
theme
key is mutually exclusive with being an extension)permissions
API, but the latter is available without manifest keys, even though it is connected to the host_permissions (MV3), optional_permissions, optional_host_permissions (MV3) keys)I have checked that list and aside from the toolbar and address bar button the requirement, or otherwise, for the manifest key to be specified before the API can be used are clearly documented. It appears that the requirements for these buttons were correctly and fully specified in the UI descriptions. I have now submitted a PR to clarify this in the APIand manifest key descriptions.
Ah yes I see User Interface > Toolbar Button clearly states it. +1 for #32703 though
MDN URL
Toolbar button
What specific section or headline is this issue about?
Specifying the browser action
What information was incorrect, unhelpful, or incomplete?
Missing information about the
browser_action
key itself, only that all properties are optional. If I miss this key inmanifest.json
thenbrowser.browserAction
is undefined inbackground.js
:What did you expect to see?
It should be stated, that the
browserAction
API is only available of thebrowser_api
key/object is declared in themanifest.json
.Do you have any supporting links, references, or citations?
Do you have anything more you want to share?
might also be a problem with other APIs
MDN metadata
Page report details
* Folder: `en-us/mozilla/add-ons/webextensions/user_interface/toolbar_button` * MDN URL: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Toolbar_button * GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/mozilla/add-ons/webextensions/user_interface/toolbar_button/index.md * Last commit: https://github.com/mdn/content/commit/8e7726da0782dcf7d1ca273177df60e3ff0893df * Document last modified: 2023-11-17T15:34:57.000Z