Back to Content

BackgroundFetchRegistration: downloadTotal property

files/en-us/web/api/backgroundfetchregistration/downloadtotal/index.md

latest561 B
Original Source

{{APIRef("Background Fetch API")}}{{SeeCompatTable}}{{AvailableInWorkers}}

The downloadTotal read-only property of the {{domxref("BackgroundFetchRegistration")}} interface returns the total size in bytes of this download. This is set when the background fetch was registered, or 0 if not set.

Value

A {{jsxref("number")}}.

Examples

Logging this property to the console returns the total size in bytes of this download.

js
console.log(bgFetch.downloadTotal);

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}