Bug 1704628 Part 4: Avoid use of ESC to close context menu in browser_toolbox_content...
[gecko.git] / dom / webidl / PushSubscription.webidl
blobf47a18b2f4ce183dd1f06419031b084cd9243b75
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/.
6 * The origin of this IDL file is
7 * https://w3c.github.io/push-api/
8 */
10 interface Principal;
12 enum PushEncryptionKeyName
14   "p256dh",
15   "auth"
18 dictionary PushSubscriptionKeys
20   ByteString p256dh;
21   ByteString auth;
24 dictionary PushSubscriptionJSON
26   USVString endpoint;
27   // FIXME: bug 1493860: should this "= {}" be here?  For that matter, this
28   // PushSubscriptionKeys thing is not even in the spec; "keys" is a record
29   // there.
30   PushSubscriptionKeys keys = {};
33 dictionary PushSubscriptionInit
35   required USVString endpoint;
36   required USVString scope;
37   ArrayBuffer? p256dhKey;
38   ArrayBuffer? authSecret;
39   BufferSource? appServerKey;
42 [Exposed=(Window,Worker), Pref="dom.push.enabled"]
43 interface PushSubscription
45   [Throws, ChromeOnly]
46   constructor(PushSubscriptionInit initDict);
48   readonly attribute USVString endpoint;
49   readonly attribute PushSubscriptionOptions options;
50   [Throws]
51   ArrayBuffer? getKey(PushEncryptionKeyName name);
52   [Throws, UseCounter]
53   Promise<boolean> unsubscribe();
55   // Implements the custom serializer specified in Push API, section 9.
56   [Throws]
57   PushSubscriptionJSON toJSON();