Bug 1861467 - [wpt-sync] Update web-platform-tests to eedf737ce39c512d0ca3471f988972e...
[gecko.git] / dom / webidl / InstallTrigger.webidl
blob01fcb3a4463d9eddb4ab1a3e38d9b40b0898d9bc
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/.
4  */
7 /**
8  * A callback function that webpages can implement to be notified when triggered
9  * installs complete.
10  */
11 callback InstallTriggerCallback = undefined(DOMString url, short status);
13 dictionary InstallTriggerData {
14   DOMString URL;
15   DOMString? IconURL;
16   DOMString? Hash;
19 /**
20  * The interface for the InstallTrigger object available to all websites.
21  */
22 [ChromeOnly,
23  JSImplementation="@mozilla.org/addons/installtrigger;1",
24  Exposed=Window]
25 interface InstallTriggerImpl {
26   /**
27    * Retained for backwards compatibility.
28    */
29   const unsigned short SKIN = 1;
30   const unsigned short LOCALE = 2;
31   const unsigned short CONTENT = 4;
32   const unsigned short PACKAGE = 7;
34   /**
35    * Tests if installation is enabled.
36    */
37   boolean enabled();
39   /**
40    * Tests if installation is enabled.
41    *
42    * @deprecated Use "enabled" in the future.
43    */
44   boolean updateEnabled();
46   /**
47    * Starts a new installation of a set of add-ons.
48    *
49    * @param  aArgs
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
57    * @param  aCallback
58    *         A callback to call as each installation succeeds or fails
59    * @return true if the installations were successfully started
60    */
61   [Deprecated="InstallTriggerInstallDeprecated"]
62   boolean install(record<DOMString, (DOMString or InstallTriggerData)> installs,
63                   optional InstallTriggerCallback callback);
65   /**
66    * Starts installing a new add-on.
67    *
68    * @deprecated use "install" in the future.
69    *
70    * @param  aType
71    *         Unused, retained for backwards compatibility
72    * @param  aUrl
73    *         The URL of the add-on
74    * @param  aSkin
75    *         Unused, retained for backwards compatibility
76    * @return true if the installation was successfully started
77    */
78   [Deprecated="InstallTriggerInstallDeprecated"]
79   boolean installChrome(unsigned short type, DOMString url, DOMString skin);
81   /**
82    * Starts installing a new add-on.
83    *
84    * @deprecated use "install" in the future.
85    *
86    * @param  aUrl
87    *         The URL of the add-on
88    * @param  aFlags
89    *         Unused, retained for backwards compatibility
90    * @return true if the installation was successfully started
91    */
92   [Deprecated="InstallTriggerInstallDeprecated"]
93   boolean startSoftwareUpdate(DOMString url, optional unsigned short flags);