blob: fda0e298f5e7f1c55a619e3858682d850844b5ef [file] [log] [blame]
<!DOCTYPE html>
<title>Service Workers: Client</title>
<link rel="help" href="">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src=/resources/WebIDLParser.js></script>
<script src=/resources/idlharness.js></script>
<script type=text/plain id="idl_0">
[Constructor()] // no-op constructor
interface Client {
readonly attribute unsigned long id;
void postMessage(any message, DOMString targetOrigin,
optional sequence<Transferable> transfer);
The `Client` interface represents the window or the worker (defined as client)
that is [controlled][1] by the Service Worker. This object provides a no-op
constructor. Callers should note that only `Client` objects created by the user
agent (see [`this.clients.getServiced()`][2]) will provide meaningful
The `id` of a `Client` identifies the specific client object from the list of
client objects serviced by the Service Worker. The `postMessage(message,
targetOrigin, transfer)` method of a `[Client][3]`, when called, causes a
`[MessageEvent][4]` to be dispatched at the client object.
[1]: #document-control
[2]: #get-serviced-method
[3]: #client-interface
<script type=text/plain id="untested_idls">
interface Transferable {};
var idl_array = new IdlArray();
Client: ["throw new Error ('No object defined for the Client interface')"]