Bug 225645 - REGRESSION: Safari 14 navigator.onLine returns true despite wifi turned off
Summary: REGRESSION: Safari 14 navigator.onLine returns true despite wifi turned off
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 14
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-11 02:28 PDT by Paul Meyer
Modified: 2021-05-19 10:23 PDT (History)
3 users (show)

See Also:


Attachments
Offline, could not load page but navigator.onLine returns true (203.95 KB, image/png)
2021-05-11 02:28 PDT, Paul Meyer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Meyer 2021-05-11 02:28:55 PDT
Created attachment 428259 [details]
Offline, could not load page but navigator.onLine returns true

The Safari Browser is currenly unable to distinguish between being online or offline. 

"In Chrome and Safari, if the browser is not able to connect to a local area network (LAN) or a router, it is offline; all other conditions return true"

This seemed to have been true in the past, but currently is not working

How to reproduce: 

Turn off Wifi and make sure not ethernet connection exists. 
Try to open web page in Safari (e.g www.google.com or any other)
Open inspector
Go to console
type `navigator.onLine` 

Expected Behaviour: 

Returns false

Observed Behaviour: 

Returns true
Comment 1 Paul Meyer 2021-05-11 02:31:51 PDT
Please note that I was unsure which component to chose here. If you think the component I chose is incorrect, please propose another and I will amend it accordingly.
Comment 2 Alexey Proskuryakov 2021-05-11 10:33:37 PDT
I can reproduce this, and "ifconfig" isn't showing any active interfaces.
Comment 3 Radar WebKit Bug Importer 2021-05-18 02:29:18 PDT
<rdar://problem/78146615>
Comment 4 Chris Dumez 2021-05-18 08:43:14 PDT
Thanks for the bug report. I'll see if I can reproduce and investigate shortly.
Comment 5 Chris Dumez 2021-05-19 10:11:35 PDT
Weird, I am unable to reproduce on my iMac Pro. I did:
1. Open WebInspector, type navigator.onLine and it returned true
2. Go to Network System preferences and click "Turn off Wifi"
3. type navigator.onLine and it returned false

I tried both WebKit trunk and shipping Safari.
Comment 6 Chris Dumez 2021-05-19 10:18:36 PDT
(In reply to Chris Dumez from comment #5)
> Weird, I am unable to reproduce on my iMac Pro. I did:
> 1. Open WebInspector, type navigator.onLine and it returned true
> 2. Go to Network System preferences and click "Turn off Wifi"
> 3. type navigator.onLine and it returned false
> 
> I tried both WebKit trunk and shipping Safari.

I have just tried on a MacBook Pro and it worked fine too.
Comment 7 Chris Dumez 2021-05-19 10:23:25 PDT
(In reply to Chris Dumez from comment #6)
> (In reply to Chris Dumez from comment #5)
> > Weird, I am unable to reproduce on my iMac Pro. I did:
> > 1. Open WebInspector, type navigator.onLine and it returned true
> > 2. Go to Network System preferences and click "Turn off Wifi"
> > 3. type navigator.onLine and it returned false
> > 
> > I tried both WebKit trunk and shipping Safari.
> 
> I have just tried on a MacBook Pro and it worked fine too.

I you can attach the output of 'ifconfig', it may help me figure out what's different about our configurations. I think for example that some virtual machines are known to create some network interfaces that say up even when the VM is not running.