coderef

Background fetchLimited availability

Background fetch downloads data in the background even when the web page is closed.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–73Not supported
74+Supportedsince Apr 23, 2019
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
✕Not supportedup to 27
Current: 27
MobileChrome Android
18–73Not supported
74+Supportedsince Apr 24, 2019
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Firefox, Safari, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: BackgroundFetchEvent.

Feature detection

JS · check before using
if ("ServiceWorkerRegistration" in globalThis && "backgroundFetch" in ServiceWorkerRegistration.prototype) {
  // ServiceWorkerRegistration.backgroundFetch is available
}

Sub-features

Support for each part of the feature (31). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
BackgroundFetchEvent7479✕✕74✕✕
BackgroundFetchEvent.BackgroundFetchEvent7479✕✕74✕✕
BackgroundFetchEvent.registration7479✕✕74✕✕
BackgroundFetchManager7479✕✕74✕✕
BackgroundFetchManager.fetch7479✕✕74✕✕
BackgroundFetchManager.get7479✕✕74✕✕
BackgroundFetchManager.getIds7479✕✕74✕✕
BackgroundFetchRecord7479✕✕74✕✕
BackgroundFetchRecord.request7479✕✕74✕✕
BackgroundFetchRecord.responseReady7479✕✕74✕✕
BackgroundFetchRegistration7479✕✕74✕✕
BackgroundFetchRegistration.abort7479✕✕74✕✕
BackgroundFetchRegistration.downloadTotal7479✕✕74✕✕
BackgroundFetchRegistration.downloaded7479✕✕74✕✕
BackgroundFetchRegistration.failureReason7479✕✕74✕✕
BackgroundFetchRegistration.id7479✕✕74✕✕
BackgroundFetchRegistration.match7479✕✕74✕✕
BackgroundFetchRegistration.matchAll7479✕✕74✕✕
BackgroundFetchRegistration.progress_event7479✕✕74✕✕
BackgroundFetchRegistration.recordsAvailable7479✕✕74✕✕
Show 11 more