Documenting the new Add-ons Manager

I’ve spent some time this week transferring all the API documentation for the new add-ons manager from the Mozilla wiki to the Mozilla Developer Network. This should now be the place to go for the definitive info.

Right now it is pretty dry, for the most part just pure API info with no examples. Before I started working more on that side of things I wanted to ask what kind of examples people might like to see documented?

3 thoughts on “Documenting the new Add-ons Manager”

  1. Some of the things I do commonly are:

    Get an nsIFile for the directory where my add-on is installed based on the ID.

    Uninstall my addon programmatically.

    Use the extension datasource to get the updateURL for my addon (to determine if it is AMO or not)

    Are all the observer messages for unininstall/disabling the same?

  2. These need documentation:
    * AddonCallback may get called with |null| if no addon matching the id is found.
    * AddonListCallback may get called with an empty array if no matching addons are found

    People will wonder how to check for a specific (set of) addon(s) to be installed and do something based on the result. Some addons might activate/deactivate features or shims in the presence of certain (versions of) third-party addons.
    Some might think that once their callback gets called the addon is installed.
    Others might think getAddonById() (and friends) is not an appropriate API for them, because they might think that the callback isn’t called when there is no result, and instead use getAllAddons().
    So document that those callbacks are always called and that their in parameter must be checked.

    Other common things encountered in addons:
    Get the installed version of self (first-run pages, upgrade/migration tasks, about dialogs).
    Get the homepage URL (first-run pages, …)

Comments are closed.