The NavigatorOnLine interface contains methods and properties related to the connectivity status of the browser.

There is no object of type NavigatorOnLine, but other interfaces, like Navigator or WorkerNavigator, implement it.

Properties

The NavigatorOnLine interface doesn't inherit any property.

NavigatorOnLine.onLine Read only
Returns a Boolean indicating whether the browser is working online.

Methods

The NavigatorOnLine interface neither implements, nor inherit any method.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'NavigatorOnLine' in that specification.
Living Standard No change from the latest snapshot, HTML5
HTML5
The definition of 'NavigatorOnLine' in that specification.
Recommendation Snapshot of HTML Living Standard with its initial specification.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge ? Firefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
Support on WorkerNavigatorChrome ? Edge ? Firefox Full support 29IE ? Opera ? Safari ? WebView Android ? Chrome Android Full support 29Edge Mobile ? Firefox Android Full support 35Opera Android ? Safari iOS ? Samsung Internet Android ?
onLineChrome Full support Yes
Notes
Full support Yes
Notes
Notes Earlier versions of Chrome incorrectly return true when a tab is first opened, but it starts reporting the correct connectivity status after the first network event. Windows: 11, Mac: 14, Chrome OS: 13, Linux: Always returns true. For history, see crbug.com/7469.
Edge Full support YesFirefox Full support 3.5
Notes
Full support 3.5
Notes
Notes Since Firefox 4 the browser returns true when 'Work Offline' mode is disabled and false when it is enabled, regardless of actual connectivity.
Full support 4
Notes
Notes Since Firefox 41, on OS X and Windows, the returned values follow the actual network connectivity, unless 'Work offline' mode is selected (where it will always return false).
IE Full support 8
Notes
Full support 8
Notes
Notes in Internet Explorer 8 'online' and 'offline' events are raised on the document.body; under IE 9 they are raised on both document.body and window.
Opera No support No
Notes
No support No
Notes
Notes Since Opera 11.10, the browser returns true when 'Work Offline' mode is disabled and false when it is enabled, regardless of actual connectivity.
Safari Full support 5WebView Android Full support Yes
Notes
Full support Yes
Notes
Notes Faulty in a WebView component, see Issue bug 16760.
Chrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.

See also

Document Tags and Contributors

Tags: 
Contributors to this page: fscholz, chrisdavidmills, abbycar, teoli
Last updated by: fscholz,