ServiceWorkerContainer class

The interface of the Service Worker 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. Most importantly, it exposes the ServiceWorkerContainer.register() method used to register service workers, and the ServiceWorkerContainer.controller property used to determine whether or not the current page is actively controlled.

EventTarget

ServiceWorkerContainer

Implemented types
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

ServiceWorkerContainer()
factory

Properties

controller ServiceWorker?

Available on ServiceWorkerContainer, provided by the PropsServiceWorkerContainer extension

no setter
hashCode int
The hash code for this object.
no setterinherited
oncontrollerchange EventHandlerNonNull<Event>?

Available on ServiceWorkerContainer, provided by the PropsServiceWorkerContainer extension

getter/setter pair
onmessage EventHandlerNonNull<Event>?

Available on ServiceWorkerContainer, provided by the PropsServiceWorkerContainer extension

getter/setter pair
onmessageerror EventHandlerNonNull<Event>?

Available on ServiceWorkerContainer, provided by the PropsServiceWorkerContainer extension

getter/setter pair
ready Future<ServiceWorkerRegistration>

Available on ServiceWorkerContainer, provided by the PropsServiceWorkerContainer extension

no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

dispatchEvent(Event event) bool

Available on EventTarget, provided by the PropsEventTarget extension

getRegistration([String? clientURL = '']) → dynamic

Available on ServiceWorkerContainer, provided by the PropsServiceWorkerContainer extension

getRegistrations() Future<Iterable<ServiceWorkerRegistration>>

Available on ServiceWorkerContainer, provided by the PropsServiceWorkerContainer extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register(String scriptURL, [RegistrationOptions? options]) Future<ServiceWorkerRegistration>

Available on ServiceWorkerContainer, provided by the PropsServiceWorkerContainer extension

removeEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

startMessages() → void

Available on ServiceWorkerContainer, provided by the PropsServiceWorkerContainer extension

toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited