W3cubDocs

/Web APIs

Client

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨April 2018⁩.

Note: This feature is only available in Service Workers.

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 Clients.matchAll() and Clients.get().

Instance methods

Client.postMessage()

Sends a message to the client.

Instance properties

Client.frameType Read only

The client's frame type as a string. It can be "auxiliary", "top-level", "nested", or "none".

Client.id Read only

The universally unique identifier of the client as a string.

Client.type Read only

The client's type as a string. It can be "window", "worker", or "sharedworker".

Client.url Read only

The URL of the client as a string.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
Client 40 17 44 27 11.1 40 44 27 11.3 4.0 40 No
frameType 43 17 44 30 11.1 43 44 30 11.3 4.0 43 No
id 40 17 44 27 11.1 40 44 27 11.3 4.0 40 No
postMessage 40 17 44 27 11.1 40 44 27 11.3 4.0 40 No
type 60 17 54 47 11.1 60 54 44 11.3 8.0 60 No
url 40 17 44 27 11.1 40 44 27 11.3 4.0 40 No

See also

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Client