此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

BackgroundFetchRegistration:downloadTotal 属性

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

备注: 此特性在 Web Worker 中可用。

BackgroundFetchRecord 接口的只读属性 downloadTotal 返回此下载的总大小(以字节为单位)。该值在注册后台获取时设置,如果未设置则为 0

number

示例

访问该属性以获取该下载的总大小(以字节为单位),并将其打印在控制台中。

js
console.log(bgFetch.downloadTotal);

规范

Specification
Background Fetch
# dom-backgroundfetchregistration-downloadtotal

浏览器兼容性