Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / webidl / ServiceWorkerRegistration.webidl
blob6acb887cd6161e4c36a6212e106645af85a3499c
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://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
8  * https://w3c.github.io/push-api/
9  * https://notifications.spec.whatwg.org/
10  */
12 [Func="ServiceWorkerVisible",
13  Exposed=(Window,Worker)]
14 interface ServiceWorkerRegistration : EventTarget {
15   readonly attribute ServiceWorker? installing;
16   readonly attribute ServiceWorker? waiting;
17   readonly attribute ServiceWorker? active;
19   [Pref="dom.serviceWorkers.navigationPreload.enabled", SameObject]
20   readonly attribute NavigationPreloadManager navigationPreload;
22   readonly attribute USVString scope;
23   [Throws]
24   readonly attribute ServiceWorkerUpdateViaCache updateViaCache;
26   [Throws, NewObject]
27   Promise<undefined> update();
29   [Throws, NewObject]
30   Promise<boolean> unregister();
32   // event
33   attribute EventHandler onupdatefound;
36 enum ServiceWorkerUpdateViaCache {
37   "imports",
38   "all",
39   "none"
42 // https://w3c.github.io/push-api/
43 partial interface ServiceWorkerRegistration {
44   [Throws, Exposed=(Window,Worker), Pref="dom.push.enabled"]
45   readonly attribute PushManager pushManager;
48 // https://notifications.spec.whatwg.org/
49 partial interface ServiceWorkerRegistration {
50   [NewObject, Func="mozilla::dom::Notification::PrefEnabled"]
51   Promise<undefined> showNotification(DOMString title, optional NotificationOptions options = {});
52   [NewObject, Func="mozilla::dom::Notification::PrefEnabled"]
53   Promise<sequence<Notification>> getNotifications(optional GetNotificationOptions filter = {});