Extension Manager:API Rewrite:API

From MozillaWiki
Revision as of 23:04, 9 October 2009 by Mossop (talk | contribs)
Jump to navigation Jump to search

AddonManager

getInstallForURL

Creates a new object representing an add-on installation from a url.

TODO This probably needs to be asynchronous to look up the mimetype of the url to determine the add-on type and maybe the signing certificate. Also move name and version arguments into a generic parameters object.

name
A human readable name for the add-on to be displayed during install (optional)
version
The version of the add-on to be installed (optional)
url
The URL to install the add-on from
hash
A hash of the file to be downloaded
returns
An AddonInstall for the installation

getInstallForFile

Creates a new object reperesenting an add-on installation from a local file, properties for the install will be loaded out of the file synchronously.

file
A nsIFile to install the add-on from
returns
An AddonInstall for the installation

getInstalls

Returns the list of known add-on installs optionally restricting to a set of types of add-ons.

types
An array of types of add-ons to return (optional)
returns
An array of AddonInstalls

addInstallListener

Adds a listener that will be notified about any events in any install. The same listener will not be added multiple times.

listener
An InstallListener

removeInstallListener

Removes a previously added install listener.

listener
An InstallListener

getAddon

Gets an installed add-on.

TODO Make this asynchronous.

id
The ID of the add-on to retrieve
returns
An Addon representing the add-on or null if there is no installed add-on with the given ID

getAddons

Gets an array of the installed add-ons optionally restricting to a set of types.

TODO Make this asynchronous.

types
An array of types of add-ons to return (optional)
returns
An array of Addons representing the installed add-ons

addAddonListener

Adds a listener that will be notified about changes to add-on states for all installed add-ons. The same listener will not be added multiple times.

listener
An AddonListener

removeAddonListener

Removes a previously added add-on listener.

listener
An AddonListener

Addon

AddonInstall

AddonListener

InstallListener