HubSpot / offline

Automatically display online/offline indication to your users

Home Page:http://github.hubspot.com/offline/docs/welcome

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  1. I load the page: comes up as online
  2. in dev tools click network>check "offline" checkbox: comes up as offline
  3. now I start getting /connection-test.js?_=1473791015506 net::ERR_INTERNET_DISCONNECTED (this is good) every few seconds
  4. 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.