@Generated(value="org.realityforge.webtack")
@JsType(isNative=true,
namespace="<global>",
name="ServiceWorkerContainer")
public class ServiceWorkerContainer
extends EventTarget
| Modifier and Type | Field and Description |
|---|---|
EventHandler |
oncontrollerchange
The oncontrollerchange property of the ServiceWorkerContainer interface is an event handler fired whenever a controllerchange event occurs — when the document's associated ServiceWorkerRegistration acquires a new active worker.
|
MessageEventHandler |
onmessage
The onmessage property of the ServiceWorkerContainer interface is an event handler fired whenever a message event occurs — when incoming messages are received to the ServiceWorkerContainer object (e.g., via a Client.postMessage() call).
|
EventHandler |
onmessageerror |
| Modifier | Constructor and Description |
|---|---|
protected |
ServiceWorkerContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addMessageListener(MessageEventListener callback) |
void |
addMessageListener(MessageEventListener callback,
AddEventListenerOptions options) |
void |
addMessageListener(MessageEventListener callback,
boolean useCapture) |
ServiceWorker |
controller()
The controller read-only property of the ServiceWorkerContainer interface returns a ServiceWorker object if its state is activating or activated (the same object returned by ServiceWorkerRegistration.active).
|
Promise<ServiceWorkerRegistrationOrUndefinedUnion> |
getRegistration()
The getRegistration() method of the ServiceWorkerContainer interface gets a ServiceWorkerRegistration object whose scope URL matches the provided document URL.
|
Promise<ServiceWorkerRegistrationOrUndefinedUnion> |
getRegistration(java.lang.String clientURL)
The getRegistration() method of the ServiceWorkerContainer interface gets a ServiceWorkerRegistration object whose scope URL matches the provided document URL.
|
Promise<JsArray<ServiceWorkerRegistration>> |
getRegistrations()
The getRegistrations() method of the ServiceWorkerContainer interface gets all ServiceWorkerRegistrations associated with a ServiceWorkerContainer, in an array.
|
Promise<ServiceWorkerRegistration> |
ready()
The ready read-only property of the ServiceWorkerContainer interface provides a way of delaying code execution until a service worker is active.
|
Promise<ServiceWorkerRegistration> |
register(java.lang.String scriptURL)
The register() method of the ServiceWorkerContainer interface creates or updates a ServiceWorkerRegistration for the given scriptURL.
|
Promise<ServiceWorkerRegistration> |
register(java.lang.String scriptURL,
RegistrationOptions options)
The register() method of the ServiceWorkerContainer interface creates or updates a ServiceWorkerRegistration for the given scriptURL.
|
void |
removeMessageListener(MessageEventListener callback) |
void |
removeMessageListener(MessageEventListener callback,
boolean useCapture) |
void |
removeMessageListener(MessageEventListener callback,
EventListenerOptions options) |
void |
startMessages()
The startMessages() method of the ServiceWorkerContainer interface explicitly starts the flow of messages being dispatched from a service worker to pages under its control (e.g.
|
addEventListener, addEventListener, addEventListener, dispatchEvent, removeEventListener, removeEventListener, removeEventListenerassign, create, create, defineProperties, defineProperty, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyDescriptor, getOwnPropertyDescriptors, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, is, isExtensible, isFrozen, isSealed, keys, preventExtensions, seal, setPrototypeOf, valueOf_, values@Nullable public EventHandler oncontrollerchange
@Nullable public MessageEventHandler onmessage
@Nullable public EventHandler onmessageerror
@JsProperty(name="controller") @Nullable public ServiceWorker controller()
@JsProperty(name="ready") @Nonnull public Promise<ServiceWorkerRegistration> ready()
@Nonnull public Promise<ServiceWorkerRegistrationOrUndefinedUnion> getRegistration(@Nonnull java.lang.String clientURL)
@Nonnull public Promise<ServiceWorkerRegistrationOrUndefinedUnion> getRegistration()
@Nonnull public Promise<JsArray<ServiceWorkerRegistration>> getRegistrations()
@Nonnull public Promise<ServiceWorkerRegistration> register(@Nonnull java.lang.String scriptURL, @Nonnull RegistrationOptions options)
@Nonnull public Promise<ServiceWorkerRegistration> register(@Nonnull java.lang.String scriptURL)
public void startMessages()
@JsOverlay
public final void addMessageListener(@Nonnull
MessageEventListener callback,
@Nonnull
AddEventListenerOptions options)
@JsOverlay
public final void addMessageListener(@Nonnull
MessageEventListener callback,
boolean useCapture)
@JsOverlay
public final void addMessageListener(@Nonnull
MessageEventListener callback)
@JsOverlay
public final void removeMessageListener(@Nonnull
MessageEventListener callback,
@Nonnull
EventListenerOptions options)
@JsOverlay
public final void removeMessageListener(@Nonnull
MessageEventListener callback,
boolean useCapture)
@JsOverlay
public final void removeMessageListener(@Nonnull
MessageEventListener callback)