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.

Hierarchy

Index

Properties

EventTarget

EventTarget: object

Type declaration

  • constructor: function
    • Returns EventTarget

  • prototype: EventTarget

controller

controller: ServiceWorker | null

oncontrollerchange

oncontrollerchange: function | null

onmessage

onmessage: function | null

onmessageerror

onmessageerror: function | null

ready

Methods

addEventListener

dispatchEvent

  • 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

    Returns boolean

getRegistration

  • Parameters

    • Optional clientURL: string

    Returns Promise<ServiceWorkerRegistration | undefined>

getRegistrations

  • Returns Promise<ReadonlyArray<ServiceWorkerRegistration>>

register

removeEventListener

startMessages

  • startMessages(): void
  • Returns void

Generated using TypeDoc