Class Client
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The Client interface represents an executable context such as a Worker, or a SharedWorker. Window clients are represented by the more-specific WindowClient. You can get Client/WindowClient objects from methods such as MatchAll(ClientQueryOptions) and Get(string).
[Value("Client")]
public class Client
- Inheritance
-
Client
- Derived
- Inherited Members
Remarks
Constructors
Client()
public Client()
Properties
FrameType
The frameType read-only property of the Client interface indicates the type of browsing context of the current Client. This value can be one of "auxiliary", "top-level", "nested", or "none".
[Value("frameType")]
public FrameType FrameType { get; }
Property Value
- FrameType
One of these four strings:
"auxiliary","top-level","nested", or"none".
Remarks
Id
The id read-only property of the Client interface returns the universally unique identifier of the Client object.
[Value("id")]
public string Id { get; }
Property Value
- string
A string uniquely identifying the object.
Remarks
LifecycleState
[Value("lifecycleState")]
public ClientLifecycleState LifecycleState { get; }
Property Value
Type
The type read-only property of the Client
interface indicates the type of client the service worker is controlling.
[Value("type")]
public ClientType Type { get; }
Property Value
- ClientType
A string, representing the client type. The value can be one of
Remarks
Url
The url read-only property of the Client
interface returns the URL of the current service worker client.
[Value("url")]
public string Url { get; }
Property Value
- string
A string.
Remarks
Methods
PostMessage(dynamic, StructuredSerializeOptions)
The postMessage() method of the
Client interface allows a service worker to send a message to a client
(a Window, Worker, or SharedWorker). The
message is received in the message event on
ServiceWorkerContainer.
[Value("postMessage")]
public GlobalObject.Undefined PostMessage(dynamic message, StructuredSerializeOptions options = null)
Parameters
messagedynamicoptionsStructuredSerializeOptions
Returns
Remarks
PostMessage(dynamic, List<Object>)
The postMessage() method of the
Client interface allows a service worker to send a message to a client
(a Window, Worker, or SharedWorker). The
message is received in the message event on
ServiceWorkerContainer.
[Value("postMessage")]
public GlobalObject.Undefined PostMessage(dynamic message, List<Object> transfer)