1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/.
8 * A callback function that webpages can implement to be notified when triggered
11 callback InstallTriggerCallback = undefined(DOMString url, short status);
13 dictionary InstallTriggerData {
20 * The interface for the InstallTrigger object available to all websites.
23 JSImplementation="@mozilla.org/addons/installtrigger;1",
25 interface InstallTriggerImpl {
27 * Retained for backwards compatibility.
29 const unsigned short SKIN = 1;
30 const unsigned short LOCALE = 2;
31 const unsigned short CONTENT = 4;
32 const unsigned short PACKAGE = 7;
35 * Tests if installation is enabled.
40 * Tests if installation is enabled.
42 * @deprecated Use "enabled" in the future.
44 boolean updateEnabled();
47 * Starts a new installation of a set of add-ons.
50 * The add-ons to install. This should be a JS object, each property
51 * is the name of an add-on to be installed. The value of the
52 * property should either be a string URL, or an object with the
53 * following properties:
54 * * URL for the add-on's URL
55 * * IconURL for an icon for the add-on
56 * * Hash for a hash of the add-on
58 * A callback to call as each installation succeeds or fails
59 * @return true if the installations were successfully started
61 [Deprecated="InstallTriggerInstallDeprecated"]
62 boolean install(record<DOMString, (DOMString or InstallTriggerData)> installs,
63 optional InstallTriggerCallback callback);
66 * Starts installing a new add-on.
68 * @deprecated use "install" in the future.
71 * Unused, retained for backwards compatibility
73 * The URL of the add-on
75 * Unused, retained for backwards compatibility
76 * @return true if the installation was successfully started
78 [Deprecated="InstallTriggerInstallDeprecated"]
79 boolean installChrome(unsigned short type, DOMString url, DOMString skin);
82 * Starts installing a new add-on.
84 * @deprecated use "install" in the future.
87 * The URL of the add-on
89 * Unused, retained for backwards compatibility
90 * @return true if the installation was successfully started
92 [Deprecated="InstallTriggerInstallDeprecated"]
93 boolean startSoftwareUpdate(DOMString url, optional unsigned short flags);