Merge pull request #17 from Lekensteyn/fix-serviceworker-check

Fix fallback scripts when ServiceWorkers are unavailable
This commit is contained in:
hackademix 2018-08-30 17:19:51 +02:00 committed by GitHub
commit 379addaf3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -85,7 +85,7 @@ ns.on("capabilities", () => {
if (!ns.canScript) {
if (!!navigator.serviceWorker.controller) {
if ("serviceWorker" in navigator && navigator.serviceWorker.controller) {
addEventListener("beforescriptexecute", e => e.preventDefault());
(async () => {
for (let r of await navigator.serviceWorker.getRegistrations()) {