2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2013-12-12 06:08:00 +04:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
2010-04-30 00:11:23 +04:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A callback function that webpages can implement to be notified when triggered
|
|
|
|
* installs complete.
|
|
|
|
*/
|
2013-12-12 06:08:00 +04:00
|
|
|
callback InstallTriggerCallback = void(DOMString url, short status);
|
2010-04-30 00:11:23 +04:00
|
|
|
|
2014-05-16 20:10:20 +04:00
|
|
|
dictionary InstallTriggerData {
|
|
|
|
DOMString URL;
|
|
|
|
DOMString? IconURL;
|
|
|
|
DOMString? Hash;
|
|
|
|
};
|
|
|
|
|
2010-04-30 00:11:23 +04:00
|
|
|
/**
|
|
|
|
* The interface for the InstallTrigger object available to all websites.
|
|
|
|
*/
|
2013-12-12 06:08:00 +04:00
|
|
|
[ChromeOnly,
|
2019-09-27 18:26:14 +03:00
|
|
|
JSImplementation="@mozilla.org/addons/installtrigger;1",
|
|
|
|
Exposed=Window]
|
2013-12-12 06:08:00 +04:00
|
|
|
interface InstallTriggerImpl {
|
2010-04-30 00:11:23 +04:00
|
|
|
/**
|
|
|
|
* Retained for backwards compatibility.
|
|
|
|
*/
|
2013-12-12 06:08:00 +04:00
|
|
|
const unsigned short SKIN = 1;
|
|
|
|
const unsigned short LOCALE = 2;
|
|
|
|
const unsigned short CONTENT = 4;
|
|
|
|
const unsigned short PACKAGE = 7;
|
2010-04-30 00:11:23 +04:00
|
|
|
|
|
|
|
/**
|
2010-12-08 13:02:39 +03:00
|
|
|
* Tests if installation is enabled.
|
2010-04-30 00:11:23 +04:00
|
|
|
*/
|
2013-12-12 06:08:00 +04:00
|
|
|
boolean enabled();
|
2010-04-30 00:11:23 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests if installation is enabled.
|
2013-12-12 06:08:00 +04:00
|
|
|
*
|
|
|
|
* @deprecated Use "enabled" in the future.
|
2010-04-30 00:11:23 +04:00
|
|
|
*/
|
2013-12-12 06:08:00 +04:00
|
|
|
boolean updateEnabled();
|
2010-04-30 00:11:23 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts a new installation of a set of add-ons.
|
|
|
|
*
|
2010-04-28 20:42:07 +04:00
|
|
|
* @param aArgs
|
|
|
|
* The add-ons to install. This should be a JS object, each property
|
|
|
|
* is the name of an add-on to be installed. The value of the
|
|
|
|
* property should either be a string URL, or an object with the
|
|
|
|
* following properties:
|
|
|
|
* * URL for the add-on's URL
|
|
|
|
* * IconURL for an icon for the add-on
|
|
|
|
* * Hash for a hash of the add-on
|
|
|
|
* @param aCallback
|
|
|
|
* A callback to call as each installation succeeds or fails
|
|
|
|
* @return true if the installations were successfully started
|
2010-04-30 00:11:23 +04:00
|
|
|
*/
|
2017-02-15 08:00:17 +03:00
|
|
|
boolean install(record<DOMString, (DOMString or InstallTriggerData)> installs,
|
2014-05-16 20:10:20 +04:00
|
|
|
optional InstallTriggerCallback callback);
|
2010-04-30 00:11:23 +04:00
|
|
|
|
|
|
|
/**
|
2013-12-12 06:08:00 +04:00
|
|
|
* Starts installing a new add-on.
|
|
|
|
*
|
|
|
|
* @deprecated use "install" in the future.
|
2010-04-30 00:11:23 +04:00
|
|
|
*
|
2010-04-28 20:42:07 +04:00
|
|
|
* @param aType
|
|
|
|
* Unused, retained for backwards compatibility
|
|
|
|
* @param aUrl
|
|
|
|
* The URL of the add-on
|
|
|
|
* @param aSkin
|
|
|
|
* Unused, retained for backwards compatibility
|
|
|
|
* @return true if the installation was successfully started
|
2010-04-30 00:11:23 +04:00
|
|
|
*/
|
2013-12-12 06:08:00 +04:00
|
|
|
boolean installChrome(unsigned short type, DOMString url, DOMString skin);
|
2010-04-30 00:11:23 +04:00
|
|
|
|
|
|
|
/**
|
2010-12-08 13:02:39 +03:00
|
|
|
* Starts installing a new add-on.
|
|
|
|
*
|
|
|
|
* @deprecated use "install" in the future.
|
2010-04-30 00:11:23 +04:00
|
|
|
*
|
2010-04-28 20:42:07 +04:00
|
|
|
* @param aUrl
|
|
|
|
* The URL of the add-on
|
|
|
|
* @param aFlags
|
|
|
|
* Unused, retained for backwards compatibility
|
|
|
|
* @return true if the installation was successfully started
|
2010-04-30 00:11:23 +04:00
|
|
|
*/
|
2013-12-12 06:08:00 +04:00
|
|
|
boolean startSoftwareUpdate(DOMString url, optional unsigned short flags);
|
2010-04-30 00:11:23 +04:00
|
|
|
};
|