HubSpot / offline

Automatically display online/offline indication to your users
http://github.hubspot.com/offline/docs/welcome
MIT License
8.64k stars 846 forks source link

Offline not showing any popup if I disable WIFI, but it is working if I manually choose offline in chrome. #284

Open manojp1988 opened 5 years ago

manojp1988 commented 5 years ago

https://skptricks.github.io/learncoding/Check%20internet%20connection%20using%20offline%20js/index.html

This is not mysite though. If you go to the link and then disable wifi, nothing will happen. But if you open dev tools and toggle 'offline' it is working.

bkampsnl commented 5 years ago

I have exact the same issue, also with Edge.

jonalxh commented 5 years ago

Same here

av-ipunkt commented 5 years ago

Actually, it works. Have to wait longer till it shows message.

Shefali33 commented 4 years ago

@av-ipunkt ... Can you please mention the code, for how is it working?

braime commented 4 years ago

I have the same issue here and I strongly think, it does not work currently. If I choose "offline" in Chrome dev-tools, I can see the requests fire and fail until I choose "online" again. But pulling the network cable does nothing, not even a single request fired in network tab. Any help would be greatly appreciated. Please let me know, if I can provide additional information to resolve this issue!

jonalxh commented 4 years ago

I had the same issue and it worked when I deployed to the hosting. I've checked in Macbook and Windows and it worked, but Linux didn't.

braime commented 4 years ago

Thanks for the fast answer! After some more testing, it is working fine locally. Perhaps there are some other factors to consider here, as we have a quite complex custom hardware-setup. Will follow up here, if it is not our setup or if I have any other helpful findings.

braime commented 4 years ago

The issue was our hardware setup in the end and also, because I was testing by just pulling the network-cable out of our device. Our earlier hardware responded on the cable plug with a change in the network tray (OS Win10) and triggered the window.offline event, requests for favicon went out, everything worked fine. Our new hardware has an embedded router and the cable plug does not change anything in the network tray of the PC and the window.offline event is never fired, no request for favicon visible in dev-tools. Sorry for suspecting the lib first, but perhaps my final findings can help somebody else with similar problems!

Raino commented 4 years ago

I use a normal computer with normal Internet, without any add-ons, but I have the same problem. How can I fix it, or can I call the offline window in some artificial way?

deepansh96 commented 3 years ago

Disabling wifi was not working for me because my app was deployed locally on localhost:8080. As Offline.js tries to request favicon from the same domain, turning off the WiFi will not work because the app can still fetch the favicon as it's deployed on a local server. That was the case in my scenario. When I turned off the development server, it was able to detect the network connection going down.