Options
All
  • Public
  • Public/Protected
  • All
Menu

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. Available only in secure contexts.

Hierarchy

Index

Properties

onerror: null | ((this: AbstractWorker, ev: internal.ErrorEvent) => any)
onstatechange: null | ((this: internal.ServiceWorker, ev: Event) => any)
scriptURL: string

Methods

  • addEventListener<K>(type: K, listener: ((this: internal.ServiceWorker, ev: ServiceWorkerEventMap[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

  • Parameters

    Returns void

  • Parameters

    Returns void

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

Generated using TypeDoc