mirror of
https://github.com/aljazceru/meshcore-web.git
synced 2025-12-17 16:24:18 +01:00
check if service worker exists on navigator
This commit is contained in:
@@ -62,6 +62,7 @@ for(const route of routes){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// listen for postMessage events from service worker
|
// listen for postMessage events from service worker
|
||||||
|
if(navigator.serviceWorker){
|
||||||
navigator.serviceWorker.addEventListener("message", async (event) => {
|
navigator.serviceWorker.addEventListener("message", async (event) => {
|
||||||
if(event.data.type === "notificationclick"){
|
if(event.data.type === "notificationclick"){
|
||||||
|
|
||||||
@@ -76,6 +77,7 @@ navigator.serviceWorker.addEventListener("message", async (event) => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// access Connection class from window
|
// access Connection class from window
|
||||||
// this allows typing "Connection.log = true" in Chrome dev tools
|
// this allows typing "Connection.log = true" in Chrome dev tools
|
||||||
|
|||||||
Reference in New Issue
Block a user