Failed to load the script unexpectedly回避

sw.jsとlib.tsを分離してみた
This commit is contained in:
tamaina
2021-11-30 03:12:32 +09:00
parent 7e5ab7af1b
commit 47d77d14fd
6 changed files with 62 additions and 28 deletions

View File

@@ -8,7 +8,7 @@ export async function initializeSw() {
('serviceWorker' in navigator) &&
('PushManager' in window) &&
$i && $i.token) {
navigator.serviceWorker.register(`/sw.js`, { scope: '/', type: 'module' });
navigator.serviceWorker.register(`/sw.js`, { scope: '/', type: 'classic' });
navigator.serviceWorker.ready.then(registration => {
registration.active?.postMessage({