WebIDLpedia

ServiceWorkerRegistration interface

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;
  [SameObject] readonly attribute NavigationPreloadManager navigationPreload;

  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:

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;
  [SameObject] readonly attribute NavigationPreloadManager navigationPreload;

  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