summaryrefslogblamecommitdiffstats
path: root/js/app.js
blob: 98da025accb762e8585b4bb3fa8531c7033718dd (plain) (tree)
1
2
3
4
5
6
7

                                              
                        
                                                                                


                                           





                                                                    
 



                                                                                            
if ("serviceWorker" in navigator) {
    navigator.serviceWorker.register("/sw.js")
        .then(() => { })
        .catch((err) => console.log("Service worker registration failed", err));
}

// Listen to messages from service workers.
if (navigator.serviceWorker) {
    navigator.serviceWorker.addEventListener('message', (event) => {
        if (event.data.msg === "install") {
            window.location.replace("/index.html");
        }
    });
}
if (location.protocol != 'https:')
{
 location.href = 'https:' + window.location.href.substring(window.location.protocol.length);
}