blob: 267c1fafc4bd4ffa595a1e3edce80807eafaa5df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
---
title: Client
slug: Web/API/Client
tags:
- API
- Client
- Experimental
- Interface
- Referencia
- Service Workers
- Service worker API
- ServiceWorkerClient
- ServiceWorkers
translation_of: Web/API/Client
---
<p>{{SeeCompatTable}}{{APIRef("Service Workers API")}}</p>
<p>A interface de <em>Client</em> representa um contexto executável, tal como um<span class="seoSummary"> {{domxref("Worker")}}, ou um {{domxref("SharedWorker")}}. Os {{domxref("Window")}} <em>clients</em> </span>são representados pelo mais específico <span class="seoSummary">{{domxref("WindowClient")}}. Pode obter os objetos <em><code>Client</code>/<code>WindowClient</code></em> a partir dos métodos, tais como {{domxref("Clients.matchAll","Clients.matchAll()")}} e {{domxref("Clients.get","Clients.get()")}}.</span></p>
<h2 id="Métodos">Métodos</h2>
<dl>
<dt>{{domxref("Client.postMessage()")}}</dt>
<dd>Sends a message to the client.</dd>
</dl>
<h2 id="Propriedades">Propriedades</h2>
<dl>
<dt>{{domxref("Client.id")}} {{readonlyInline}}</dt>
<dd>The universally unique identifier of the client as a string.</dd>
<dt>{{domxref("Client.type")}} {{readonlyInline}}</dt>
<dd>The client's type as a string. It can be "<code>window"</code>, "<code>worker"</code>, or "<code>sharedworker"</code>.</dd>
<dt>{{domxref("Client.url")}} {{readonlyInline}}</dt>
<dd>The URL of the client as a string.</dd>
</dl>
<h2 id="Especificações">Especificações</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Especificação</th>
<th scope="col">Estado</th>
<th scope="col">Comentário</th>
</tr>
<tr>
<td>{{SpecName('Service Workers', '#client', 'Client')}}</td>
<td>{{Spec2('Service Workers')}}</td>
<td>Definitição inicial.</td>
</tr>
</tbody>
</table>
<h2 id="Compatibilidade_de_Navegador">Compatibilidade de Navegador</h2>
<p>{{Compat("api.Client")}}</p>
<h2 id="Consulte_também">Consulte também:</h2>
<ul>
<li><a href="/en-US/docs/Web/API/ServiceWorker_API/Using_Service_Workers">Using Service Workers</a></li>
<li><a href="https://jakearchibald.github.io/isserviceworkerready/">Is ServiceWorker ready?</a></li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promises</a></li>
</ul>
|