Skip to Content
Platform.Ontology

Background Sync

Retries a request later when the connection returns, after the tab closes.

Works without askingNotifications and backgroundBackgroundWeb browsersAfter you leave the site

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

BrowserStatusFirst versionReleasedNote
ChromeSupported492016-03-02None
EdgeSupported792020-01-15None
FirefoxNot supportedNot availableNot listedNone
SafariNot supportedNot availableNot listedNone
Safari on iPhoneNot supportedNot availableNot listedNone
Chrome on AndroidSupported492016-03-09None
Samsung InternetSupported5.02016-12-15None

How a site asks for it

APIregistration.sync.register('tag'); service worker 'sync' event; event.lastChance
Permission namebackground-sync
Browser compat keysapi.SyncManager
api.SyncEvent
How access is grantednone
What the user seesNo prompt; the Permissions API reports background-sync as always granted.
Needs a secure context (HTTPS)Yes
Needs a user gestureNo
How long it lastsTied to the service worker registration
How to take it backUnregister the service worker or clear site data
Inside an iframeService worker only

Typical flow

  1. Register a sync tag from the page
  2. Browser fires sync in the service worker when online
  3. Worker sends queued request
  4. 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

FieldTypeUnitRangePrecision
retriesintegercount3 attempts with exponential backoff in Chromeper tag
tagstringtextany, repeated tags mergeper 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

TypeExampleApps
socialYou 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
productivityA web note app saves your note locally, and sends it to the cloud when the signal returns.Google Keep
shoppingA web store queues an order placed in a weak signal area, and completes it later.None named
gamesA browser game sends your final score or save data later, so a lost signal does not erase progress.None named
creativeA web design tool uploads your latest edits in the background when the network is back.Figma
healthA web health log syncs your entries to the clinic when the connection returns.None named
analyticsA 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

Good uses and abuse

Legitimate uses

  • Offline form submit
  • Queued chat messages

Known abuse

  • Delayed beacon after leaving

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2016-03, Chrome 49: Background Sync ships

Sources

How well checked: Based on official documentation.

On this page