FetchEvent.client

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

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
client
ExperimentalDeprecatedNon-standard
Chrome Full support 42Edge Full support ≤79Firefox Full support 44IE No support NoOpera Full support 27Safari No support NoWebView Android Full support 42Chrome Android Full support 44Firefox Android No support NoOpera Android ? Safari iOS No support NoSamsung 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.

See also