1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
7 dictionary InstallParameters {
8 sequence<DOMString> receipts = [];
9 sequence<DOMString> categories = [];
12 [NoInterfaceObject, NavigatorProperty="mozApps",
13 JSImplementation="@mozilla.org/webapps;1"]
14 interface DOMApplicationsRegistry {
15 [CheckPermissions="webapps-manage"]
16 readonly attribute DOMApplicationsManager mgmt;
17 DOMRequest install(DOMString url, optional InstallParameters params);
18 DOMRequest installPackage(DOMString url, optional InstallParameters params);
20 DOMRequest getInstalled();
21 DOMRequest checkInstalled(DOMString manifestUrl);
24 [JSImplementation="@mozilla.org/webapps/application;1", ChromeOnly]
25 interface DOMApplication : EventTarget {
26 // manifest and updateManifest will be turned into dictionaries once
27 // in bug 1053033 once bug 963382 is fixed.
28 readonly attribute any manifest;
29 readonly attribute any updateManifest;
30 readonly attribute DOMString manifestURL;
31 readonly attribute DOMString origin;
32 readonly attribute DOMString installOrigin;
33 readonly attribute DOMTimeStamp installTime;
34 readonly attribute boolean removable;
36 // That's actually a [Cached, Pure] sequence<DOMString>.
37 // Will update once bug 963382 is fixed.
38 readonly attribute any receipts;
40 readonly attribute double progress;
42 readonly attribute DOMString installState;
44 readonly attribute DOMTimeStamp lastUpdateCheck;
45 readonly attribute DOMTimeStamp updateTime;
47 readonly attribute boolean downloadAvailable;
48 readonly attribute boolean downloading;
49 readonly attribute boolean readyToApplyDownload;
50 readonly attribute long downloadSize;
52 readonly attribute DOMError? downloadError;
54 attribute EventHandler onprogress;
55 attribute EventHandler ondownloadsuccess;
56 attribute EventHandler ondownloaderror;
57 attribute EventHandler ondownloadavailable;
58 attribute EventHandler ondownloadapplied;
61 void cancelDownload();
63 DOMRequest launch(optional DOMString? url);
65 DOMRequest clearBrowserData();
66 DOMRequest checkForUpdate();
69 * Inter-App Communication APIs.
71 * https://wiki.mozilla.org/WebAPI/Inter_App_Communication_Alt_proposal
74 Promise<MozInterAppConnection> connect(DOMString keyword, optional any rules);
76 Promise<sequence<MozInterAppMessagePort>> getConnections();
78 // Receipts handling functions.
79 DOMRequest addReceipt(optional DOMString receipt);
80 DOMRequest removeReceipt(optional DOMString receipt);
81 DOMRequest replaceReceipt(optional DOMString oldReceipt,
82 optional DOMString newReceipt);
85 [JSImplementation="@mozilla.org/webapps/manager;1",
87 CheckPermissions="webapps-manage"]
88 interface DOMApplicationsManager : EventTarget {
90 DOMRequest getNotInstalled();
91 void applyDownload(DOMApplication app);
92 DOMRequest uninstall(DOMApplication app);
94 attribute EventHandler oninstall;
95 attribute EventHandler onuninstall;