title | short-title | slug | page-type | browser-compat |
---|---|---|---|---|
SyncEvent: SyncEvent() constructor |
SyncEvent() |
Web/API/SyncEvent/SyncEvent |
web-api-constructor |
api.SyncEvent.SyncEvent |
{{APIRef("Background Sync")}}{{AvailableInWorkers("service")}}
The SyncEvent()
constructor creates a new {{domxref("SyncEvent")}} object.
new SyncEvent(type, options)
type
- : A string with the name of the event.
It is case-sensitive and browsers always set it to
sync
.
- : A string with the name of the event.
It is case-sensitive and browsers always set it to
options
- : An object that, in addition to the properties defined in {{domxref("ExtendableEvent/ExtendableEvent", "ExtendableEvent()")}}, can have the following properties:
tag
- : A developer-defined unique identifier for this
SyncEvent
.
- : A developer-defined unique identifier for this
lastChance
{{optional_inline}}- : A boolean value indicating that the user agent will not make further synchronization attempts after the current attempt.
It defaults to
false
.
- : A boolean value indicating that the user agent will not make further synchronization attempts after the current attempt.
It defaults to
- : An object that, in addition to the properties defined in {{domxref("ExtendableEvent/ExtendableEvent", "ExtendableEvent()")}}, can have the following properties:
A new {{domxref("SyncEvent")}} object.
{{Specifications}}
{{Compat}}