Options
All
  • Public
  • Public/Protected
  • All
Menu

The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations. Available only in secure contexts.

Hierarchy

  • EventTarget
    • ServiceWorkerContainer

Index

Properties

controller: null | internal.ServiceWorker
oncontrollerchange: null | ((this: internal.ServiceWorkerContainer, ev: Event) => any)
onmessage: null | ((this: internal.ServiceWorkerContainer, ev: internal.MessageEvent<any>) => any)
onmessageerror: null | ((this: internal.ServiceWorkerContainer, ev: internal.MessageEvent<any>) => any)

Methods

  • addEventListener<K>(type: K, listener: ((this: internal.ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any), options?: boolean | AddEventListenerOptions): void
  • addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void
  • dispatchEvent(event: Event): boolean
  • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

    Parameters

    • event: Event

    Returns boolean

  • removeEventListener<K>(type: K, listener: ((this: internal.ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any), options?: boolean | EventListenerOptions): void
  • removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void
  • startMessages(): void
  • Returns void

Generated using TypeDoc