SyncEvent: SyncEvent() constructor

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Note: This feature is only available in Service Workers.

The SyncEvent() constructor creates a new SyncEvent object.

Syntax

js
new SyncEvent(type, options)

Parameters

type

A string with the name of the event. It is case-sensitive and browsers always set it to sync.

options

An object that, in addition to the properties defined in ExtendableEvent(), can have the following properties:

tag

A developer-defined unique identifier for this SyncEvent.

lastChance Optional

A boolean value indicating that the user agent will not make further synchronization attempts after the current attempt. It defaults to false.

Return value

A new SyncEvent object.

Specifications

Specification
Web Background Synchronization
# dom-syncevent-syncevent

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
SyncEvent() constructor
Chrome – Full support
Chrome 49 (Release date: 2016-03-02)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 36 (Release date: 2016-03-15)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 49 (Release date: 2016-03-09)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 36 (Release date: 2016-03-31)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 5 (Release date: 2016-12-15)
footnote Full support
WebView Android – No support
WebView Android
footnote
footnote See bug 40449796
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.