Merge pull request #17 from Lekensteyn/fix-serviceworker-check
Fix fallback scripts when ServiceWorkers are unavailable
This commit is contained in:
commit
379addaf3f
|
@ -85,7 +85,7 @@ ns.on("capabilities", () => {
|
||||||
|
|
||||||
if (!ns.canScript) {
|
if (!ns.canScript) {
|
||||||
|
|
||||||
if (!!navigator.serviceWorker.controller) {
|
if ("serviceWorker" in navigator && navigator.serviceWorker.controller) {
|
||||||
addEventListener("beforescriptexecute", e => e.preventDefault());
|
addEventListener("beforescriptexecute", e => e.preventDefault());
|
||||||
(async () => {
|
(async () => {
|
||||||
for (let r of await navigator.serviceWorker.getRegistrations()) {
|
for (let r of await navigator.serviceWorker.getRegistrations()) {
|
||||||
|
|
Loading…
Reference in New Issue