Detects change from offline to online, but does not do anything when going offline again
bythornchris opened this issue · comments
I use an image to detect the connection
../images/offline_detect.gif
On page load detects correctly - we are online.
Change the filename and Offline does not fire event to indicate that the file cannot be found (offline or "down"). If I start with a bad filename, Offline detects as "down". Change the filename and it detects "up". Change the filename again and Offline.state remains as "up" and no event fires.
I have tried adding a hash to the image file name in an attempt to prevent caching of the image, but it still does not work.
checks: {image: {url: function() { return '../images/offline_detect.gif#' + (Math.floor(Math.random() * 1000000000) }}, active: 'image'}
I detect change using Offline.on with events of 'up' and 'down'. Using 'confirmed-up' and 'confirmed-down' make no difference.
Have tried the timeOut / SetInterval methods and still no joy.
How can I detect when we go offline after having been detected as online?
Thanks
same here
same here:
- I load the page: comes up as online
- in dev tools click network>check "offline" checkbox: comes up as offline
- now I start getting /connection-test.js?_=1473791015506 net::ERR_INTERNET_DISCONNECTED (this is good) every few seconds
- I uncheck offline: no change - stays offline - the checks every few seconds stop appearing!
edit: sorry forgot version: offline-js 0.7.18
You all may find help in this thread: #174 It didn't help me but others have reported differently.