Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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/.
5 *
6 * The origin of this IDL file is
7 * http://notifications.spec.whatwg.org/
8 *
9 * Copyright:
10 * To the extent possible under law, the editors have waived all copyright and
11 * related or neighboring rights to this work.
12 */
14 [Pref="dom.webnotifications.enabled",
15 Constructor(DOMString title, optional NotificationOptions options)]
16 interface Notification : EventTarget {
17 [GetterThrows]
18 static readonly attribute NotificationPermission permission;
20 [Throws]
21 static void requestPermission(optional NotificationPermissionCallback permissionCallback);
23 [Throws]
24 static Promise get(optional GetNotificationOptions filter);
26 attribute EventHandler onclick;
28 attribute EventHandler onshow;
30 attribute EventHandler onerror;
32 attribute EventHandler onclose;
34 [Pure]
35 readonly attribute DOMString title;
37 [Pure]
38 readonly attribute NotificationDirection dir;
40 [Pure]
41 readonly attribute DOMString? lang;
43 [Pure]
44 readonly attribute DOMString? body;
46 [Constant]
47 readonly attribute DOMString? tag;
49 [Pure]
50 readonly attribute DOMString? icon;
52 void close();
53 };
55 dictionary NotificationOptions {
56 NotificationDirection dir = "auto";
57 DOMString lang = "";
58 DOMString body = "";
59 DOMString tag = "";
60 DOMString icon = "";
61 };
63 dictionary GetNotificationOptions {
64 DOMString tag;
65 };
67 enum NotificationPermission {
68 "default",
69 "denied",
70 "granted"
71 };
73 callback NotificationPermissionCallback = void (NotificationPermission permission);
75 enum NotificationDirection {
76 "auto",
77 "ltr",
78 "rtl"
79 };