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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
PeriodicSyncEvent
80
80
No
No
67
No
80
80
No
57
No
13.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PeriodicSyncEvent/PeriodicSyncEvent