Background syncLimited availability
The background synchronization API registers a service worker callback to run only when the device is no longer offline. You can use this to let users continue using your app while offline and synchronize with a server after reconnecting.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
1–48Not supported
49+Supportedsince Mar 2, 2016
Current: 155Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154Firefox
✕Not supportedup to 157
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
18–48Not supported
49+Supportedsince Mar 9, 2016
Current: 155Firefox Android
✕Not supportedup to 157
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How 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: sync event.
Feature detection
JS · check before using
if ("Permissions" in globalThis && "permission_background-sync" in Permissions.prototype) {
// Permissions.permission_background-sync is available
}Specification
Sub-features
Support for each part of the feature (11). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Permissions.permission_background-sync | 62 | 79 | ✕ | ✕ | 62 | ✕ | ✕ |
| ServiceWorkerGlobalScope.sync_event | 49 | 79 | ✕ | ✕ | 49 | ✕ | ✕ |
| ServiceWorkerRegistration.sync | 49 | 79 | ✕ | ✕ | 49 | ✕ | ✕ |
| SyncEvent | 49 | 79 | ✕ | ✕ | 49 | ✕ | ✕ |
| SyncEvent.SyncEvent | 49 | 79 | ✕ | ✕ | 49 | ✕ | ✕ |
| SyncEvent.lastChance | 49 | 79 | ✕ | ✕ | 49 | ✕ | ✕ |
| SyncEvent.tag | 49 | 79 | ✕ | ✕ | 49 | ✕ | ✕ |
| SyncManager | 49 | 79 | ✕ | ✕ | 49 | ✕ | ✕ |
| SyncManager.getTags | 49 | 79 | ✕ | ✕ | 49 | ✕ | ✕ |
| SyncManager.register | 49 | 79 | ✕ | ✕ | 49 | ✕ | ✕ |
| SyncManager.worker_support | 61 | 79 | ✕ | ✕ | 61 | ✕ | ✕ |