BackgroundFetchRecord: thuộc tính request

Limited availability

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

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Note: This feature is available in Web Workers.

Thuộc tính chỉ đọc request của giao diện BackgroundFetchRecord trả về thông tin chi tiết của tài nguyên cần được tìm nạp.

Giá trị

Một Request.

Ví dụ

Trong ví dụ này, một BackgroundFetchRecord riêng lẻ được trả về bằng BackgroundFetchManager.fetch(). request được trả về và ghi ra console.

js
bgFetch.match("/ep-5.mp3").then(async (record) => {
  if (!record) {
    console.log("No record found");
    return;
  }

  console.log(`Here's the request`, record.request);
});

Thông số kỹ thuật

Specification
Background Fetch
# dom-backgroundfetchrecord-request

Tương thích trình duyệt