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
Web Periodic Background Synchronization
# dom-periodicsyncevent-periodicsyncevent

Browser compatibility

BCD tables only load in the browser

See also