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 Status Comment
Background Fetch
The definition of 'BackgroundFetchEvent' in that specification.
Draft Initial definition.

Browser compatibility

BCD tables only load in the browser