Background Sync
Retries a request later when the connection returns, after the tab closes.
In one line
Can retry sending queued data after you close the tab, once you are back online
Retries a request later when the connection returns, after the tab closes.
Lets a site send queued data (a message, a form, a like) once the device is back online even if the person has left. Quiet and automatic, so no prompt is shown.
What it can and can't do
What the user does: You tap Send or Save while offline, then leave the page
It can
- Send a saved message, form or like later when your device is online again
- Finish quietly in the background without a pop up
- Retry a few times if sending fails
It cannot
- Run in Firefox or Safari
- Do anything open ended; it only sends items the page already queued
- Keep trying forever, since the browser stops it after a few tries
- Show you any prompt or notice that it ran
How it differs between platforms: Chrome, Edge and Samsung Internet only. Firefox, Safari and iPhone browsers do not support it.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 49 | 2016-03-02 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Not supported | Not available | Not listed | None |
| Safari | Not supported | Not available | Not listed | None |
| Safari on iPhone | Not supported | Not available | Not listed | None |
| Chrome on Android | Supported | 49 | 2016-03-09 | None |
| Samsung Internet | Supported | 5.0 | 2016-12-15 | None |
How a site asks for it
| API | registration.sync.register('tag'); service worker 'sync' event; event.lastChance |
| Permission name | background-sync |
| Browser compat keys | api.SyncManagerapi.SyncEvent |
| How access is granted | none |
| What the user sees | No prompt; the Permissions API reports background-sync as always granted. |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | No |
| How long it lasts | Tied to the service worker registration |
| How to take it back | Unregister the service worker or clear site data |
| Inside an iframe | Service worker only |
Typical flow
- Register a sync tag from the page
- Browser fires sync in the service worker when online
- Worker sends queued request
- On failure the browser retries with backoff, lastChance on the final try
Data you get
What comes back: Sync event with a tag
Shape: event
How often: when connectivity returns
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
retries | integer | count | 3 attempts with exponential backoff in Chrome | per tag |
tag | string | text | any, repeated tags merge | per origin |
Technical limits
- Not in Firefox or Safari
- Only when the browser process runs and the device is online
- Limited retries
The story
What it is
A site can retry a failed action later, once your connection returns, even after you close the tab.
For you
You send a message or form while offline. The site says it will send later. When your phone gets signal, it goes out without reopening the page.
For makers
Makers use it so users never lose a post, order or edit because of a bad connection. It builds trust and cuts support issues. It only runs in Chromium browsers.
Where you see it
| Type | Example | Apps |
|---|---|---|
| social | You post in a web chat on a subway. The post is queued, and sends itself after you leave the tunnel and close the browser. | None named |
| productivity | A web note app saves your note locally, and sends it to the cloud when the signal returns. | Google Keep |
| shopping | A web store queues an order placed in a weak signal area, and completes it later. | None named |
| games | A browser game sends your final score or save data later, so a lost signal does not erase progress. | None named |
| creative | A web design tool uploads your latest edits in the background when the network is back. | Figma |
| health | A web health log syncs your entries to the clinic when the connection returns. | None named |
| analytics | A web app sends queued usage events later, so measurement does not drop when the user is offline. | None named |
Risks
- Actions happen later
- Only in Chromium
What the platform says
- MDN Web Docs: Background Synchronization API. Defer actions until the user has a stable connection, so work is sent even if the tab closes.
Good uses and abuse
Legitimate uses
- Offline form submit
- Queued chat messages
Known abuse
- Delayed beacon after leaving
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2016-03, Chrome 49: Background Sync ships
Related capabilities
Related
- Periodic Background Sync. Can refresh an installed web app now and then while closed, at times the browser picks
Sources
How well checked: Based on official documentation.