interface dom.ServiceWorkerContainer
implements EventTarget
import { type dom } from "https://deno.land/x/evt@v2.4.18/lib/index.ts";
const { ServiceWorkerContainer } = dom;
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.
Properties
readonly
controller: ServiceWorker | nulloncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null
onmessage: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null
onmessageerror: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null
readonly
ready: Promise<ServiceWorkerRegistration>Methods
getRegistration(clientURL?: string): Promise<ServiceWorkerRegistration | undefined>
getRegistrations(): Promise<ReadonlyArray<ServiceWorkerRegistration>>
register(scriptURL: string, options?: RegistrationOptions): Promise<ServiceWorkerRegistration>
addEventListener<K extends keyof ServiceWorkerContainerEventMap>(): void
type: K,
listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
addEventListener(): void
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
removeEventListener<K extends keyof ServiceWorkerContainerEventMap>(): void
type: K,
listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any,
options?: boolean | EventListenerOptions,