Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ServiceWorker

Package version

This ServiceWorker API interface provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object.

Hierarchy

Index

Properties

EventTarget

EventTarget: { constructor: any; prototype: EventTarget }

Type declaration

  • constructor: function
    • Returns EventTarget

  • prototype: EventTarget

onerror

onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null

onstatechange

onstatechange: ((this: ServiceWorker, ev: Event) => any) | null

scriptURL

scriptURL: string

state

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

postMessage

  • Parameters

    Returns void

  • Parameters

    Returns void

removeEventListener

Generated using TypeDoc