This article needs a technical review. How you can help.
This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.
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.
SyntaxEdit
var reloaded = FetchEvent.isReload
Value
A Boolean
.
ExampleEdit
self.addEventListener('fetch', function(event) {
event.respondWith(
if (event.isReload) {
//Return something
} else {
//Return something else
};
);
});
SpecificationsEdit
Specification | Status | Comment |
---|---|---|
Service Workers The definition of 'isReload' in that specification. |
Working Draft | Initial definition. |
Browser compatibilityEdit
[1] Service workers (and Push) have been disabled in the Firefox 45 Extended Support Release (ESR.)