Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
The SyncManager.register
method of the SyncManager
interface returns a Promise
that resolves to a SyncRegistration
instance.
Syntax
SyncManager.register([options]).then(function(syncRegistration) { ... })
Returns
A Promise
that resolves to an instance of SyncRegistration
.
Parameters
- options Optional
- An object that sets options for an instance of
SyncRegistration
. The available options are:allowOnBattery
: A boolean that determines whether synchronization is allowed when the user agent is on a battery-powered device. The default istrue
.id
: The unique identifier of the specifiedSyncRegistration
object.idleRequired
: A boolean that determines whether synchronization is allowed when the user agent's device is idle. The default isfalse
.maxDelay
: The maximum delay in milliseconds before the nextsync
event (or the firstsync
event if it is periodic). The default is0
, meaning there is no maximum delay.minDelay
: The minimum delay in milliseconds before the nextsync
event (or the first sync event if it is periodic). The default is0
.minPeriod
: The minimum time in milliseconds between periodic sync events. The default is0
, meaning events are not periodic.minRequiredNetwork
: The network condition under which background synchronization will occur. Valid values are'network-any'
,'network-offline'
,'network-online'
,'network-non-mobile'
. The default value is'network-online'
.
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
register | Chrome Full support 49 | Edge Full support 79 | Firefox No support No | IE No support No | Opera No support No | Safari No support No | WebView Android Full support 49 | Chrome Android Full support 49 | Firefox Android No support No | Opera Android No support No | Safari iOS No support No | Samsung Internet Android Full support 5.0 |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.