Closed Bug 783516 Opened 11 years ago Closed 9 years ago

navigator.onLine always returns true

Categories

(Core :: DOM: Core & HTML, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 654579

People

(Reporter: sonny, Unassigned)

References

Details

On OSX, navigator.onLine always returns true, except if I check the 'Work offline' option within the File menu.

If there are no active connections navigator.onLine shoulds returns false as Chrome does.
(I *think* this is a dup and done on purpose, but could be wrong.)
http://www.whatwg.org/specs/web-apps/current-work/#dfnReturnLink-0

"The navigator.onLine attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail), and must return true otherwise."
Yes. What if you're with dial-up connection? You don't have connection open, but
clicking a link might open it, no?
Yes they are case where opening a link works without having a 'proper' Internet access.

But I would say the most common case is probably the one to take into account. If the system network API (such as networkmanager on Linux) says there a no connection opened, maybe navigator.onLine should returns false.

Or maybe the solution is for the Web App to 'ping' a URL.
Again, IIRC, this is a dup, and this has been discussed elsewhere.
I don't recall all the details.
(but I agree that it would be good if .online would be actually more useful than what it is now.)
Blocks: 756364
Note bug 620472, which seems to be where the current behavior was implemented.
Looks like a dupe of bug 654579 to me.
Agreed on duping after some bugzilla investigation today; I'm duping into bug 654579 and will update its subject to also include this subject, for clarity.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.