--- title: Client slug: Web/API/Client tags: - API - Client - Experimental - Interface - Referencia - Service Workers - Service worker API - ServiceWorkerClient - ServiceWorkers translation_of: Web/API/Client ---

{{SeeCompatTable}}{{APIRef("Service Workers API")}}

A interface de Client representa um contexto executável, tal como um {{domxref("Worker")}}, ou um {{domxref("SharedWorker")}}. Os {{domxref("Window")}} clients são representados pelo mais específico {{domxref("WindowClient")}}. Pode obter os objetos Client/WindowClient a partir dos métodos, tais como {{domxref("Clients.matchAll","Clients.matchAll()")}} e {{domxref("Clients.get","Clients.get()")}}.

Métodos

{{domxref("Client.postMessage()")}}
Sends a message to the client.

Propriedades

{{domxref("Client.id")}} {{readonlyInline}}
The universally unique identifier of the client as a string.
{{domxref("Client.type")}} {{readonlyInline}}
The client's type as a string. It can be "window", "worker", or "sharedworker".
{{domxref("Client.url")}} {{readonlyInline}}
The URL of the client as a string.

Especificações

Especificação Estado Comentário
{{SpecName('Service Workers', '#client', 'Client')}} {{Spec2('Service Workers')}} Definitição inicial.

Compatibilidade de Navegador

{{Compat("api.Client")}}

Consulte também: