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

View in English Always switch to English

BackgroundFetchRegistration:recordsAvailable 属性

Limited availability

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

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

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

BackgroundFetchRecord 接口的只读属性 recordsAvailable 在存在可访问的请求和响应时返回 true。如果此属性返回 false,你将无法使用 match()matchAll()

boolean

示例

访问该属性以获取用于指示是否存在记录的 truefalse 布尔值,并将其打印到控制台中。

js
console.log(bgFetch.recordsAvailable);

规范

Specification
Background Fetch
# dom-backgroundfetchregistration-recordsavailable

浏览器兼容性