ServiceWorkerContainer class

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

MDN Reference

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

Constructors

ServiceWorkerContainer()
factory

Properties

addEventListener ↔ void Function(String, [Object?, Object?])

Available on EventTarget, provided by the EventTarget$Typings extension

getter/setter pair
addEventListener → ({void Function<K$>(ServiceWorkerContainerEventMap<K$> type, dynamic listener(K$), [Object? options]) $1, void Function(String type, Object listener, [Object? options]) $2})

Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension

Overload accessor: $1, $2
no setter
controller ServiceWorker?

Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension

MDN Reference
no setter
dispatchEvent bool Function(Event)

Available on EventTarget, provided by the EventTarget$Typings extension

getter/setter pair
getRegistration Future<ServiceWorkerRegistration?> Function([Object?])

Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension

getter/setter pair
getRegistrations Future<ReadonlyArray<ServiceWorkerRegistration>> Function()

Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension

getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
oncontrollerchange ↔ dynamic Function(Event)?

Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension

MDN Reference
getter/setter pair
onmessage ↔ dynamic Function(MessageEvent)?

Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension

MDN Reference
getter/setter pair
onmessageerror ↔ dynamic Function(MessageEvent)?

Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension

getter/setter pair
ready Future<ServiceWorkerRegistration>

Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension

MDN Reference
no setter
register Future<ServiceWorkerRegistration> Function(Object, [RegistrationOptions?])

Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension

getter/setter pair
removeEventListener ↔ void Function(String, [Object?, Object?])

Available on EventTarget, provided by the EventTarget$Typings extension

getter/setter pair
removeEventListener → ({void Function<K$>(ServiceWorkerContainerEventMap<K$> type, dynamic listener(K$), [Object? options]) $1, void Function(String type, Object listener, [Object? options]) $2})

Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension

Overload accessor: $1, $2
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startMessages ↔ void Function()

Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension

getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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