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

View in English Always switch to English

BackgroundFetchRegistration:uploaded 属性

Limited availability

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

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

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

BackgroundFetchRecord 接口的只读属性 uploaded 返回成功发送的字节数。该属性的初始值为 0

如果此属性的值发生变化,将在关联的 BackgroundFetchRegistration 对象上触发 progress 事件。

number

示例

访问该属性以获取已上传的字节数,并将其打印到控制台中。

js
console.log(bgFetch.uploaded);

规范

Specification
Background Fetch
# dom-backgroundfetchregistration-uploaded

浏览器兼容性