PeriodicSyncEvent()

Draft

This page is not complete.

The PeriodicSyncEvent() constructor creates a new PeriodicSyncEvent object. This constructor is not typically used. The browser creates these objects itself and provides them to ServiceWorkerGlobalScope.onperiodicsync callback.

Syntax

var PeriodicSyncEvent = new PeriodicSyncEvent();

Parameters

type
A DOMString indicating the event which occurred. For PeriodicSyncEvent, this is always periodicsync.
periodicSyncEventInitDict Optional
An options object containing any initialization data you want to populate the PeriodicSyncEvent object with. The options are:
  • tag: The tag referencing the sync event.

Return value

A PeriodicSyncEvent object configured using the given inputs.

Examples

This example constructs a new PeriodicSyncEvent with the relevant associated tag.

var syncTag = {
  tag : 'unique-tag'
}

var psEvent = new ExtendableEvent('periodicsync', syncTag);

psEvent.tag; // should return 'unique-tag'

Specifications

Specification Status Comment
Web Periodic Background Synchronization
The definition of 'PeriodicSyncEvent' in that specification.
Working Draft Initial definition.

Browser compatibility

BCD tables only load in the browser

See also