NavigatorOnLine

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
HTML Living Standard
The definition of 'NavigatorOnLine' in that specification.
Living Standard

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
NavigatorOnLineChrome Full support 1Edge Full support 12Firefox Full support 3.5IE Full support 8Opera Full support 3Safari Full support 5WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 4.2Samsung Internet Android Full support 1.0
onLineChrome Full support 1
Notes
Full support 1
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 12Firefox 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. 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 Full support 3
Notes
Full support 3
Notes
Notes From Opera 11.1 until Opera 12.1, 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 1
Notes
Full support 1
Notes
Notes Faulty in a WebView component, see Issue bug 16760.
Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1
Notes
Full support 10.1
Notes
Notes From Opera 11.1 until Opera 12.1, the browser returns true when 'Work Offline' mode is disabled and false when it is enabled, regardless of actual connectivity.
Safari iOS Full support 4.2Samsung Internet Android Full support 1.0
Available in workersChrome ? Edge ? Firefox Full support 29IE ? Opera ? Safari ? WebView Android ? Chrome Android Full support 29Firefox Android Full support 35Opera Android ? Safari iOS ? Samsung Internet Android Full support 2.0

Legend

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

See also