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.
- 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< $1, void Function(String type, Object listener, [Object? options]) $2})K$> type, dynamic listener(K$), [Object? options]) -
Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension
Overload accessor: $1, $2no setter - controller → ServiceWorker?
-
Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension
MDN Referenceno 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< Function()ServiceWorkerRegistration> > -
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 Referencegetter/setter pair - onmessage ↔ dynamic Function(MessageEvent)?
-
Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension
MDN Referencegetter/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 Referenceno 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< $1, void Function(String type, Object listener, [Object? options]) $2})K$> type, dynamic listener(K$), [Object? options]) -
Available on ServiceWorkerContainer, provided by the ServiceWorkerContainer$Typings extension
Overload accessor: $1, $2no 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