Definition
Service Workers Nightly defines ServiceWorkerRegistration
[SecureContext, Exposed=(Window,Worker)]
interface ServiceWorkerRegistration : EventTarget {
readonly attribute ServiceWorker? installing;
readonly attribute ServiceWorker? waiting;
readonly attribute ServiceWorker? active;
readonly attribute USVString scope;
readonly attribute ServiceWorkerUpdateViaCache updateViaCache;
[NewObject] Promise<undefined> update();
[NewObject] Promise<boolean> unregister();
// event
attribute EventHandler onupdatefound;
};
This interface is extended in the following specifications:
- Notifications API Standard
partial interface ServiceWorkerRegistration { Promise<undefined> showNotification(DOMString title, optional NotificationOptions options = {}); Promise<sequence<Notification>> getNotifications(optional GetNotificationOptions filter = {}); };
- Background Fetch
partial interface ServiceWorkerRegistration { readonly attribute BackgroundFetchManager backgroundFetch; };
- Web Background Synchronization
partial interface ServiceWorkerRegistration { readonly attribute SyncManager sync; };
- Content Index
partial interface ServiceWorkerRegistration { [SameObject] readonly attribute ContentIndex index; };
- Cookie Store API
[Exposed=(ServiceWorker,Window)] partial interface ServiceWorkerRegistration { [SameObject] readonly attribute CookieStoreManager cookies; };
- Web Periodic Background Synchronization
[Exposed=(Window,Worker)] partial interface ServiceWorkerRegistration { readonly attribute PeriodicSyncManager periodicSync; };
- Payment Handler API
partial interface ServiceWorkerRegistration { [SameObject] readonly attribute PaymentManager paymentManager; };
- Push API
[SecureContext] partial interface ServiceWorkerRegistration { readonly attribute PushManager pushManager; };
Consolidated IDL (across mixin and partials)
[SecureContext, Exposed=(Window,Worker)]
interface ServiceWorkerRegistration : EventTarget {
readonly attribute ServiceWorker? installing;
readonly attribute ServiceWorker? waiting;
readonly attribute ServiceWorker? active;
readonly attribute USVString scope;
readonly attribute ServiceWorkerUpdateViaCache updateViaCache;
[NewObject] Promise<undefined> update();
[NewObject] Promise<boolean> unregister();
// event
attribute EventHandler onupdatefound;
Promise<undefined> showNotification(DOMString title, optional NotificationOptions options = {});
Promise<sequence<Notification>> getNotifications(optional GetNotificationOptions filter = {});
readonly attribute BackgroundFetchManager backgroundFetch;
readonly attribute SyncManager sync;
[SameObject] readonly attribute ContentIndex index;
[SameObject] readonly attribute CookieStoreManager cookies;
readonly attribute PeriodicSyncManager periodicSync;
[SameObject] readonly attribute PaymentManager paymentManager;
readonly attribute PushManager pushManager;
};
Methods and attributes that return objects implementing ServiceWorkerRegistration
Referring IDL interfaces/dictionaries
Referring specifications
- Notifications API Standard refers to
ServiceWorkerRegistration
- Background Fetch refers to
ServiceWorkerRegistration
- Web Background Synchronization refers to
ServiceWorkerRegistration
- Content Index refers to
ServiceWorkerRegistration
- Cookie Store API refers to
ServiceWorkerRegistration
- Web Periodic Background Synchronization refers to
ServiceWorkerRegistration
- Payment Handler API refers to
ServiceWorkerRegistration
- Push API refers to
ServiceWorkerRegistration