From 4d7e02c3ccebda24ee625c6da5840576b0ef636c Mon Sep 17 00:00:00 2001 From: Rory& Date: Tue, 9 Dec 2025 23:54:45 +0100 Subject: Fix missing import map in index.html, remove hack in service worker I somehow missed this in a side-by-side diff against a clean project. Thanks github:@maraf for catching this over at https://github.com/dotnet/runtime/issues/122340#issuecomment-3634398530. --- MatrixUtils.Web/wwwroot/service-worker.published.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'MatrixUtils.Web/wwwroot/service-worker.published.js') diff --git a/MatrixUtils.Web/wwwroot/service-worker.published.js b/MatrixUtils.Web/wwwroot/service-worker.published.js index aafb48c..3e28e6c 100644 --- a/MatrixUtils.Web/wwwroot/service-worker.published.js +++ b/MatrixUtils.Web/wwwroot/service-worker.published.js @@ -22,7 +22,7 @@ async function onInstall(event) { console.info('Service worker: Install'); // Activate the new service worker as soon as the old one is retired. - self.skipWaiting(); + await self.skipWaiting(); // Fetch and cache all matching items from the assets manifest const assetsRequests = self.assetsManifest.assets @@ -55,19 +55,6 @@ async function onFetch(event) { const shouldCache = offlineAssetsInclude.some(pattern => pattern.test(request.url)); const cache = await caches.open(cacheName); - - if (request !== 'index.html' && request.url.endsWith("_framework/dotnet.js")) { - // return `_framework/dotnet..js` from cache to avoid integrity errors - const dotnetJsUrl = manifestUrlList.find(url => /_framework\/dotnet\.[a-z0-9]+\.js$/.test(url)); - if (dotnetJsUrl) { - cachedResponse = await cache.match(dotnetJsUrl); - if (cachedResponse) { - console.log("Service worker caching: serving dotnet.js from cache: ", dotnetJsUrl); - return cachedResponse; - } - } else console.warn("Service worker caching: could not find dotnet.hash.js in manifest", {request, manifestUrlList}); - } - cachedResponse = await cache.match(request); let exception; let fetched; -- cgit 1.5.1