Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

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

Open
manojp1988 opened this issue Mar 14, 2019 · 10 comments

Comments

@manojp1988
Copy link

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
Copy link

I have exact the same issue, also with Edge.

@jonalxh
Copy link

jonalxh commented May 16, 2019

Same here

@av-ipunkt
Copy link

av-ipunkt commented Jul 19, 2019

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

@Shefali33
Copy link

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

@braime
Copy link

braime commented Jan 16, 2020

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
Copy link

jonalxh commented Jan 16, 2020

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
Copy link

braime commented Jan 16, 2020

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
Copy link

braime commented Jan 17, 2020

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
Copy link

Raino commented Jul 16, 2020

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
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants