From 09b4b6c4d66118513dbfa528301b743d8a71d3d1 Mon Sep 17 00:00:00 2001 From: Amirreza Rezaei Date: Mon, 27 Apr 2026 12:11:00 +0330 Subject: [PATCH] new way of showing offline.html --- public/sw.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/sw.js b/public/sw.js index ebbc869..5a0a784 100644 --- a/public/sw.js +++ b/public/sw.js @@ -51,7 +51,9 @@ self.addEventListener("activate", function (event) { // }) // .catch(() => { // return caches.open(CACHE_STATIC_NAME).then((cache) => { -// return cache.match("/offline.html"); +// if (event.request.headers.get("accept").includes("text/html")) { +// return caches.match("/offline.html"); +// } // }); // }); // }