非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
SyncManager.register
方法在
SyncManager
interface returns a
Promise
解析为
SyncRegistration
实例。
SyncManager.register([options]).then(function(syncRegistration) { ... })
A
Promise
that resolves to an instance of
SyncRegistration
.
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 is
true
.
id
: The unique identifier of the specified
SyncRegistration
对象。
idleRequired
: A boolean that determines whether synchronization is allowed when the user agent's device is idle. The default is
false
.
maxDelay
: The maximum delay in milliseconds before the next
sync
event (or the first
sync
event if it is periodic). The default is
0
, meaning there is no maximum delay.
minDelay
: The minimum delay in milliseconds before the next
sync
event (or the first sync event if it is periodic). The default is
0
.
minPeriod
: The minimum time in milliseconds between periodic sync events. The default is
0
, 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'
。默认值为
'network-online'
.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
register
非标
|
Chrome 49 | Edge 79 | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 49 | Chrome Android 49 | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 5.0 |
完整支持
不支持
实验。期望将来行为有所改变。
非标。预期跨浏览器支持较差。
SyncManager
getTags()
register()
缓存
CacheStorage
Client
Clients
ExtendableEvent
FetchEvent
InstallEvent
Navigator.serviceWorker
NotificationEvent
PeriodicSyncEvent
PeriodicSyncManager
PeriodicSyncRegistration
ServiceWorker
ServiceWorkerContainer
ServiceWorkerGlobalScope
ServiceWorkerRegistration
SyncEvent
SyncRegistration
WindowClient