NavigatorOnLine

L'interface NavigatorOnLine contient les méthodes et les propriétés concernant l'état de connexion du navigateur.

Il n'y a pas d'objet de type NavigatorOnLine, mais d'autres interfaces l'implémentent comme Navigator ou WorkerNavigator.

Propriétés

L'interface NavigatorOnLine n'hérite d'aucune propriété.

NavigatorOnLine.onLine Lecture seule
Retourne un Boolean indicant si le navigateur est connecté.

Méthodes

The NavigatorOnLine interface neither implements, nor inherit any method.

Spécifications

Spécifications Status Commentaire
HTML Living Standard
La définition de 'NavigatorOnLine' dans cette spécification.
Standard évolutif Pas de changement depuis la dernière version, HTML5
HTML5
La définition de 'NavigatorOnLine' dans cette spécification.
Recommendation Version apportant la définition initiale: HTML Living Standard

Compatibilité des naviagteurs

Update compatibility data on GitHub
OrdinateurMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariWebview AndroidChrome pour AndroidFirefox pour AndroidOpera pour AndroidSafari sur iOSSamsung Internet
NavigatorOnLineChrome Support complet 1Edge Support complet 12Firefox Support complet 3.5IE Support complet 8Opera Support complet 3Safari Support complet 5WebView Android Support complet 1Chrome Android Support complet 18Firefox Android Support complet 4Opera Android Support complet 10.1Safari iOS Support complet 4.2Samsung Internet Android Support complet 1.0
onLineChrome Support complet 1
Notes
Support complet 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 Support complet 12Firefox Support complet 3.5
Notes
Support complet 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 Support complet 8
Notes
Support complet 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 Support complet 3
Notes
Support complet 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 Support complet 5WebView Android Support complet 1
Notes
Support complet 1
Notes
Notes Faulty in a WebView component, see Issue bug 16760.
Chrome Android Support complet 18Firefox Android Support complet 4Opera Android Support complet 10.1
Notes
Support complet 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 Support complet 4.2Samsung Internet Android Support complet 1.0
Available in workersChrome ? Edge ? Firefox Support complet 29IE ? Opera ? Safari ? WebView Android ? Chrome Android Support complet 29Firefox Android Support complet 35Opera Android ? Safari iOS ? Samsung Internet Android Support complet 2.0

Légende

Support complet  
Support complet
Compatibilité inconnue  
Compatibilité inconnue
Voir les notes d'implémentation.
Voir les notes d'implémentation.

Voir aussi