Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.09 KB

File metadata and controls

42 lines (30 loc) · 1.09 KB
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.

Syntax

new SyncEvent(type, options)

Parameters

  • type
    • : A string with the name of the event. It is case-sensitive and browsers always set it to sync.
  • 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.
      • 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.

Return value

A new {{domxref("SyncEvent")}} object.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}