Background Fetch support
Published Updated
Background Fetch hands a long-running download (or upload) off to the browser itself: the browser performs the fetch in a user-visible way, showing progress and a cancel option, and wakes the service worker once the operation completes.
Browser & ecosystem support
Section titled “Browser & ecosystem support”- Legend
- Yes
- Partial
- Flag
- No
- Unknown
| Browser / Platform | Support | Versions | Confidence | Source | Notes |
|---|---|---|---|---|---|
| Chrome (Desktop) | Yes | 74 | high | source | — |
| Chrome (Android) | Yes | 74 | high | source | 1 |
| Edge (Desktop) | Yes | 79 | high | source | 2 |
| Firefox (Desktop) | No | — | high | source | 3 |
| Firefox (Android) | No | — | high | source | 45 |
| Safari (macOS) | No | — | high | source | 6 |
| Safari (iOS) | No | — | high | source | 78 |
| Samsung Internet | Yes | 11.0 | high | source | 9 |
| WebView (Android) | No | — | high | source | 10 |
- Derived by browser-compat-data mirroring from Chrome.
- Derived by browser-compat-data mirroring from Chrome.
- No Firefox support is recorded in browser-compat-data.
- No Firefox for Android support is recorded in browser-compat-data.
- Derived by browser-compat-data mirroring from Firefox.
- No Safari support is recorded in browser-compat-data.
- No Safari on iOS support is recorded in browser-compat-data.
- Derived by browser-compat-data mirroring from Safari.
- Derived by browser-compat-data mirroring from Chrome Android.
- No WebView Android support is recorded in browser-compat-data.
How to use it
Section titled “How to use it”Feature-detect, then call fetch() on the service worker registration’s
backgroundFetch manager:
async function startBackgroundFetch(urls) { const registration = await navigator.serviceWorker.ready; return registration.backgroundFetch.fetch('my-fetch', urls, { title: 'Episode 5', downloadTotal: 60 * 1024 * 1024, });}Handle the settlement events in the service worker:
self.addEventListener('backgroundfetchsuccess', (event) => { event.waitUntil(handleCompletedFetch(event.registration));});self.addEventListener('backgroundfetchfail', (event) => { event.waitUntil(cleanUpFailedFetch(event.registration));});How to detect it at runtime
Section titled “How to detect it at runtime”Check for BackgroundFetchManager before calling fetch(). When it is absent, download
each file with a regular fetch() call instead:
async function downloadFiles(urls) { if (!('BackgroundFetchManager' in self)) { for (const url of urls) { const response = await fetch(url); await handleResponse(response); } return; } const registration = await navigator.serviceWorker.ready; await registration.backgroundFetch.fetch('my-fetch', urls, { title: 'Files', downloadTotal: 0, });}Practical checklist
Section titled “Practical checklist”- Firefox and Safari do not implement this API — per the table above, support is
Chromium-only, so always branch to a regular-
fetch()fallback rather than assuming availability. - Group files that belong together (e.g. media plus artwork) into a single
fetch()call so they appear as one user-visible download. - Handle
backgroundfetchsuccessandbackgroundfetchfailin the service worker to process or clean up after the download; handlebackgroundfetchclickto route the user back to a relevant screen. - Reserve Background Fetch for large, long-running downloads — it is not a substitute for short tasks that don’t need user-visible progress.
Where to go next
Section titled “Where to go next”← Back to the Compatibility explorer.