fix server worker is blocked (#565)

* fix server worker is blocked

* Also use relURL in manifest

---------

Co-authored-by: Alex Shpak <alex-shpak@users.noreply.github.com>
This commit is contained in:
李宗英 2023-12-05 05:25:48 +08:00 committed by GitHub
parent 3f1bcccbfb
commit 14e14f60ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -1,14 +1,14 @@
{ {
"name": "{{ .Site.Title }}", "name": "{{ .Site.Title }}",
"short_name": "{{ .Site.Title }}", "short_name": "{{ .Site.Title }}",
"start_url": "{{ "/" | relURL }}", "start_url": "{{ "./" | relURL }}",
"scope": "{{ "/" | relURL }}", "scope": "{{ "./" | relURL }}",
"display": "standalone", "display": "standalone",
"background_color": "#000000", "background_color": "#000000",
"theme_color": "#000000", "theme_color": "#000000",
"icons": [ "icons": [
{ {
"src": "{{ "/favicon.svg" | relURL }}", "src": "{{ "./favicon.svg" | relURL }}",
"sizes": "512x512" "sizes": "512x512"
} }
] ]

View File

@ -2,6 +2,6 @@
if (navigator.serviceWorker) { if (navigator.serviceWorker) {
navigator.serviceWorker.register( navigator.serviceWorker.register(
"{{ $swJS.RelPermalink }}", "{{ $swJS.RelPermalink }}",
{ scope: "{{ "/" | relURL }}" } { scope: "{{ "./" | relURL }}" }
); );
} }