WindowClient Class
A window client of a service worker (https://w3c.github.io/ServiceWorker/#windowclient-interface).
public sealed class WindowClient : Client- Inheritance
ClientWindowClient
Properties
| Name | Description |
|---|---|
| AncestorOrigins | Gets the ancestor origins of the document of the client. |
| Focused | Gets whether the document of the client has the focus. |
| VisibilityState | Gets the visibility state of the document of the client (visible or hidden). |
AncestorOrigins
Clients.csGets the ancestor origins of the document of the client.
public IReadOnlyList<string> AncestorOrigins { get; }Focused
Clients.csGets whether the document of the client has the focus.
public bool Focused { get; }VisibilityState
Clients.csGets the visibility state of the document of the client (visible or hidden).
public string VisibilityState { get; }Methods
| Name | Description |
|---|---|
| Focus() | Focuses the window of the client (https://w3c.github.io/ServiceWorker/#client-focus). |
| Navigate(string) | Navigates the window of the client to url (https://w3c.github.io/ServiceWorker/#client-navigate): returns its window client, or null when the new document does not have the origin of the service worker. |
Focus()
Clients.csFocuses the window of the client (https://w3c.github.io/ServiceWorker/#client-focus).
public Task<WindowClient> Focus()Returns
Remarks
A window of the origin must have the transient activation (e.g. the user clicked it).