Client Class
A client of a service worker (https://w3c.github.io/ServiceWorker/#client-interface): a window or a worker of its origin.
public class ClientProperties
| Name | Description |
|---|---|
| FrameType | Gets the frame type of the client. |
| Id | Gets the id of the client. |
| LifecycleState | Gets whether the document of the client is frozen (https://wicg.github.io/page-lifecycle/#dom-client-lifecyclestate). |
| Type | Gets the type of the client. |
| Url | Gets the creation URL of the client. |
FrameType
Clients.csGets the frame type of the client.
public FrameType FrameType { get; }Gets the id of the client.
public string Id { get; }LifecycleState
Clients.csGets whether the document of the client is frozen (https://wicg.github.io/page-lifecycle/#dom-client-lifecyclestate).
public ClientLifecycleState LifecycleState { get; }Property value
See also
Type
Clients.csGets the type of the client.
public ClientType Type { get; }Url
Clients.csGets the creation URL of the client.
public string Url { get; }Methods
| Name | Description |
|---|---|
| PostMessage(object?, StructuredSerializeOptions?) | Posts a message to the client: it is dispatched at its ServiceWorkerContainer (https://w3c.github.io/ServiceWorker/#dom-client-postmessage-message-options). |
| PostMessage(object?, IReadOnlyList<object>) | Posts a message to the client (https://w3c.github.io/ServiceWorker/#dom-client-postmessage). |
PostMessage overloads
PostMessage(object?, StructuredSerializeOptions?)
Clients.csPosts a message to the client: it is dispatched at its ServiceWorkerContainer (https://w3c.github.io/ServiceWorker/#dom-client-postmessage-message-options).
public void PostMessage(object? message, StructuredSerializeOptions? options = null)Parameters
messageobject?optionsStructuredSerializeOptions?
Exceptions
DomException- A
DataCloneErrorwhen the message cannot be serialized.
See also
PostMessage(object?, IReadOnlyList<object>)
Clients.csPosts a message to the client (https://w3c.github.io/ServiceWorker/#dom-client-postmessage).
public void PostMessage(object? message, IReadOnlyList<object> transfer)