Deprecated
This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
The FetchEvent.client
read-only property returns the Client
that the current service worker is controlling.
Note: This feature has been deprecated, with its functionality replaced by FetchEvent.clientId
and Clients.get()
. See this Github issue for discussion/background.
Syntax
var myClient = FetchEvent.client;
Value
A Client
object.
Example
self.addEventListener('fetch', function(event) { console.log(event.client); });
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
client | Chrome Full support 42 | Edge Full support ≤79 | Firefox Full support 44 | IE No support No | Opera Full support 27 | Safari No support No | WebView Android Full support 42 | Chrome Android Full support 44 | Firefox Android No support No | Opera Android ? | Safari iOS No support No | Samsung Internet Android Full support 4.0 |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.
- Deprecated. Not for use in new websites.
- Deprecated. Not for use in new websites.