addEventListener("backgroundfetchclick", (event) => {
const bgFetch = event.registration;
if (bgFetch.result === "success") {
clients.openWindow("/latest-podcasts");
} else {
clients.openWindow("/download-progress");
}
});BackgroundFetchEvent / notebook
BackgroundFetchEvent
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.