Extension Manager:API Rewrite:API: Difference between revisions

no edit summary
No edit summary
Line 5: Line 5:
==getInstallForURL==
==getInstallForURL==


Creates a new object representing an add-on installation from a url. This may perform a request to the URL to determine the type of add-on before passing an [[#AddonInstall|AddonInstall]] onto the provided callback. Operates asynchronously.
Creates a new object representing an add-on installation from a url. Any information provided will be replaced with real details from the add-on once available. This method operates asynchronously.


;url :The URL to install the add-on from
;url :The URL to install the add-on from
;callback :A function to pass an [[#AddonInstall|AddonInstall]] to when created
;callback :A function to pass an [[#AddonInstall|AddonInstall]] to when created
;mimetype :The mimetype of the add-on to be downloaded. If not provided the mimetype given by the server or file based detection will be used. (optional)
;mimetype :The mimetype of the add-on to be downloaded.
;hash :A hash of the file to be downloaded (optional)
;hash :A hash to compare the downloaded add-on to (optional).
;name :A human readable name for the add-on to be displayed during install (optional)
;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)
;iconURL :An icon used to represent the add-on during install (optional).
;version :The version of the add-on to be installed (optional).
;loadgroup :An nsILoadGroup to attach any download channels to for the purposes of correct cookie sending.


==getInstallForFile==
==getInstallForFile==


Creates a new object representing an add-on installation from a local file, properties for the install will be loaded out of the file. Operates asynchronously.
Creates a new object representing an add-on installation from a local file, properties for the install will be loaded out of the file. This method operates asynchronously.


;file :A <code>nsIFile</code> to install the add-on from
;file :A <code>nsIFile</code> to install the add-on from
Line 22: Line 24:
;mimetype :The mimetype of the add-on to be downloaded. If not provided file based detection will be used. (optional)
;mimetype :The mimetype of the add-on to be downloaded. If not provided file based detection will be used. (optional)


==getInstallForData==
==getInstalls==


Creates a new object representing an add-on installation from some data, properties for the install will be loaded out of the data. Operates asynchronously.
Returns the list of known add-on installs optionally restricting to a set of types of add-ons. This method operates asynchronously.


;data :A <code>string</code> or <code>object</code> to install the add-on from
;types :An array of types of add-ons to return (optional)
;callback :A function that will be passed the [[#AddonInstall|AddonInstall]] for the installation
;callback :A function that will be passed an array of [[#AddonInstall|AddonInstalls]]
;mimetype :The mimetype of the add-on to be installed. If not provided some detection mechanism may be used. (optional)


==getInstalls==
==startInstallation==


Returns the list of known add-on installs optionally restricting to a set of types of add-ons. Operates asynchronously.
Starts the install process for multiple [[#AddonInstall|AddonInstalls]] calling the registered extIWebInstallListener to notify about blocked or started installs. This is primarily intended to start installs triggered by content webpages.


;types :An array of types of add-ons to return (optional)
;mimetype :The mimetype of the installs.
;callback :A function that will be passed an array of [[#AddonInstall|AddonInstalls]]
;source :The source nsIDOMWindow that triggered the installs (optional).
;uri :The nsIURI that triggered the installs (optional).
;installs :An array of [[#AddonInstall|AddonInstalls]].


==addInstallListener==
==addInstallListener==
Line 51: Line 54:
==getAddon==
==getAddon==


Gets an installed add-on. Operates asynchronously.
Gets an installed add-on. This method operates asynchronously.


;id :The ID of the add-on to retrieve
;id :The ID of the add-on to retrieve
Line 58: Line 61:
==getAddons==
==getAddons==


Gets an array of the installed add-ons optionally restricting to a set of types. Operates asynchronously.
Gets an array of the installed add-ons optionally restricting to a set of types. This method operates asynchronously.


;types :An array of types of add-ons to return (optional)
;types :An array of types of add-ons to return (optional)
;callback :A function that will be passed an array of [[#Addon|Addons]] representing the installed add-ons
;callback :A function that will be passed an array of [[#Addon|Addons]] representing the installed add-ons
==getAddonsWithPendingOperations==
Gets an array of add-ons that currently have pending operations requiring an application restart to complete. This method operates asynchronously.
;types :An array of types of add-ons to return (optional)
;callback :A function that will be passed an array of [[#Addon|Addons]] representing the add-ons with pending operations.


==addAddonListener==
==addAddonListener==
canmove, Confirmed users
1,570

edits