Get to know MDN better
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 FetchEvent() constructor creates a new FetchEvent object.
A string with the name of the event. It is case-sensitive and browsers always set it to fetch.
optionsAn object that, in addition of the properties defined in ExtendableEvent(), can have the following properties:
requestThe Request object that would have triggered the event handler.
preloadResponseA Promise which returns a previously-loaded response to the client.
clientId OptionalThe Client that the current service worker is controlling. It defaults to "".
isReload OptionalA boolean value that signifies whether the page was reloaded or not when the event was dispatched. true if yes, and false if not. Typically, pressing the refresh button in a browser is a reload, while clicking a link and pressing the back button is not. If not present, it defaults to false.
replacesClientId OptionalA string which identifies the client which is being replaced by resultingClientId. It defaults to "".
resultingClientId OptionalA string containing the new clientId if the client changes as a result of the page load. It defaults to ""
handledA pending promise that will be fulfilled once the event has been handled.
A new FetchEvent object.
| Service Workers Nightly # dom-fetchevent-fetchevent |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 6, 2024 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.