Definition of the interface
partial interface ServiceWorkerRegistration {
readonly attribute PeriodicSyncManager periodicSync;
};
[SecureContext , Exposed =(Window ,Worker )]
interface PeriodicSyncManager {
Promise<void > register (DOMString tag, BackgroundSyncOptions options);
Promise<void > unregister (DOMString tag);
Promise<sequence<DOMString>> getTags ();
};
Definition of the Service Worker event
partial interface ServiceWorkerGlobalScope {
attribute EventHandler onperiodicsync;
};
[Constructor (DOMString type, PeriodicSyncEventInit init), Exposed =ServiceWorker ]
interface SyncEvent : ExtendableEvent {
readonly attribute DOMString tag;
};
dictionary PeriodicSyncEventInit : ExtendableEventInit {
required DOMString tag;
};
Extensions to the Background Sync API
dictionary BackgroundSyncOptions {
// …existing properties…
unsigned long long minInterval;
};
Extensions to the Permissions API
enum PermissionsName {
// …existing permissions…
" periodic-background-sync" ,
}