BackgroundFetchEvent: registration property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("Background Fetch API")}}{{SeeCompatTable}}{{AvailableInWorkers("service")}}
The **registration** read-only property of the {{domxref("BackgroundFetchEvent")}} interface returns a {{domxref("BackgroundFetchRegistration")}} object.
Value
A {{domxref("BackgroundFetchRegistration")}}.
Examples
In this example, if the user clicks on the user interface displaying the download progress, this fires the {{domxref("ServiceWorkerGlobalScope/backgroundfetchclick_event", "backgroundfetchclick")}} event. The current {{domxref("BackgroundFetchRegistration")}} is returned by calling event.registration.
js
addEventListener("backgroundfetchclick", (event) => {
console.log(event.registration);
});Specifications
{{Specifications}}
Browser compatibility
{{Compat}}