From 14e14f60ae7e738f6b0255091abc12645923950b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AE=97=E8=8B=B1?= Date: Tue, 5 Dec 2023 05:25:48 +0800 Subject: [PATCH] fix server worker is blocked (#565) * fix server worker is blocked * Also use relURL in manifest --------- Co-authored-by: Alex Shpak --- assets/manifest.json | 6 +++--- assets/sw-register.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/manifest.json b/assets/manifest.json index 6a137ac..3e0314f 100644 --- a/assets/manifest.json +++ b/assets/manifest.json @@ -1,14 +1,14 @@ { "name": "{{ .Site.Title }}", "short_name": "{{ .Site.Title }}", - "start_url": "{{ "/" | relURL }}", - "scope": "{{ "/" | relURL }}", + "start_url": "{{ "./" | relURL }}", + "scope": "{{ "./" | relURL }}", "display": "standalone", "background_color": "#000000", "theme_color": "#000000", "icons": [ { - "src": "{{ "/favicon.svg" | relURL }}", + "src": "{{ "./favicon.svg" | relURL }}", "sizes": "512x512" } ] diff --git a/assets/sw-register.js b/assets/sw-register.js index b67dbfd..e5d1761 100644 --- a/assets/sw-register.js +++ b/assets/sw-register.js @@ -2,6 +2,6 @@ if (navigator.serviceWorker) { navigator.serviceWorker.register( "{{ $swJS.RelPermalink }}", - { scope: "{{ "/" | relURL }}" } + { scope: "{{ "./" | relURL }}" } ); }