BackgroundFetchRegistration.result

The result read-only property of the BackgroundFetchRegistration interface returns a string indicating whether the background fetch was successful or failed.

Syntax

let theResult = BackgroundFetchRegistration.result;

Value

One of the following strings:

""
The fetch is active so there is no result.
"success"
The background fetch was successful.
"failure"
The background fetch failed. This only appears when there is no ability for the browser to retry.

Examples

Logging BackgroundFetchRegistration.result to the console returns a string indicating the status, or an empty string if the fetch is still active.

console.log(bgFetch.result);

Specifications

Specification Status Comment
Background Fetch
The definition of 'BackgroundFetchRegistration.result' in that specification.
Draft Initial definition.

Browser compatibility

BCD tables only load in the browser