W3cubDocs

/Web APIs

PeriodicSyncEvent: PeriodicSyncEvent() constructor

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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

Syntax

js

new PeriodicSyncEvent(type, options)

Parameters

type

A string with the name of the event. It is case-sensitive and browsers set it to periodicsync.

options

An object that, in addition of the properties defined in Event(), can have the following properties:

tag

The tag referencing the sync event.

Return value

A new PeriodicSyncEvent object configured using the given inputs.

Examples

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

js

const psEvent = new ExtendableEvent("periodicsync", { tag: "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 No 80 No 57 No 13.0

See also

© 2005–2023 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