diff --git a/game/game.js b/game/game.js index 3101a5c49..66b797c24 100644 --- a/game/game.js +++ b/game/game.js @@ -141,7 +141,7 @@ new Promise(resolve => { module._compile(require('fs').readFileSync(filename, 'utf8'), filename); }; } - if (location.protocol.startsWith('http') && 'serviceWorker' in navigator) { + if (window.isSecureContext && 'serviceWorker' in navigator) { let scope = window.location.protocol + '//' + window.location.host + '/'; navigator.serviceWorker.getRegistrations().then(registrations => { let findServiceWorker = registrations.find(registration => { diff --git a/index.html b/index.html index 6ec89d172..22e37375f 100755 --- a/index.html +++ b/index.html @@ -1,4 +1,5 @@ + @@ -6,19 +7,90 @@ 无名杀