FetchEvent.isReload

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The isReload read-only property of the FetchEvent interface returns true if the event was dispatched by the user attempting to reload the page, and false otherwise. Pressing the refresh button is a reload while clicking a link and pressing the back button is not.

Syntax

var reloaded = FetchEvent.isReload

Value

A Boolean.

Example

self.addEventListener('fetch', function(event) {
  event.respondWith(
    if (event.isReload) {
      //Return something
    } else {
      //Return something else
    };
  );
​});

Specifications

Specification Status Comment
Service Workers
The definition of 'isReload' in that specification.
Working Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic support
Experimental
Chrome Full support 45Edge Full support 17Firefox Full support 44
Notes
Full support 44
Notes
Notes Service workers (and Push) have been disabled in the Firefox 45 and 52 Extended Support Releases (ESR.)
IE No support NoOpera Full support 32Safari No support NoWebView Android Full support 45Chrome Android Full support 45Edge Mobile Full support 17Firefox Android Full support 44Opera Android Full support 32Safari iOS No support NoSamsung Internet Android Full support 5.0

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
See implementation notes.
See implementation notes.

See also

Document Tags and Contributors

Contributors to this page: fscholz, chrisdavidmills, Sebastianz, kscarfone, jpmedley
Last updated by: fscholz,