HubSpot/offline

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

manojp1988 opened this issue · 10 comments

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.

I have exact the same issue, also with Edge.

Same here

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

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

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!

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.

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.

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

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?

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.