BackgroundFetchEvent.BackgroundFetchEvent()

The BackgroundFetchEvent() constructor creates a new BackgroundFetchEvent object. This constructor is not typically used as the browser creates these objects itself and provides them to background fetch event callbacks.

Syntax

let BackgroundFetchEvent = new BackgroundFetchEvent(type, BackgroundFetchEventInit);

Parameters

type
A string representing the name of the event. One of:
  • onbackgroundfetchabort
  • onbackgroundfetchclick
BackgroundFetchEventInit
A BackgroundFetchRegistration.

Specifications

Specification
Background Fetch
# dom-backgroundfetchevent-backgroundfetchevent

Browser compatibility

BCD tables only load in the browser