• Thanks for the plugin. It’s a great idea!
    Are you mantaining it?
    I have seen that you are using a library to test the connection. The problem is that today you can use a better option to test the connection.
    I have tried it with a PWA and it doesn’t work (maybe it crashes with the “service worker”.
    The point is to use this script instead. I have been trying it and it works perfectly for web and webApps (service worker installed)

    <script>
    setInterval(function(){
    if (navigator.onLine) {
    console.log(“online”);
    } else {
    console.log(“offline”);
    }
    }, 4000);
    </script>

    Let me know If you would like to use it this way, thanks!!!

Viewing 1 replies (of 1 total)
  • Plugin Author Sanjeev Aryal

    (@sanzeeb3)

    Hi @gtamborero,

    Thanks for your feedback. Service Workers are probably great these days for cached responses and viewing the offline site, replacing the Application cache. At this point, the plugin only offers the way to display status, and the interactive themes and design lured me to use the library, but feedbacks and contributions are welcome. I’m maintaining the plugin here for any reported bugs and enhancements here: https://github.com/sanzeeb3/internet-connection-status.

    Have a good one!

Viewing 1 replies (of 1 total)
  • The topic ‘hi! service worker + navigator.onLine’ is closed to new replies.