Progressive Web App: How to detect and handle when connection is up again
You could monitor the offline and online events, which are widely supported. Further, you could test connectivity by attempting to fetch HEAD from the target server URL: // Test this by running the code snippet below and then // use the “Offline” checkbox in DevTools Network panel window.addEventListener(‘online’, handleConnection); window.addEventListener(‘offline’, handleConnection); function handleConnection() { if … Read more