mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
Updated online-offline-events.md
Added links, removed grammatical error.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
# Online/Offline Event Detection
|
||||
|
||||
Online and offline event detection can be implemented in the renderer process
|
||||
using standard HTML5 NavigatorOnLine API.
|
||||
[Online and offline event](https://developer.mozilla.org/en-US/docs/Online_and_offline_events) detection can be implemented in the renderer process using [NavigatorOnLine](http://html5index.org/Offline%20-%20NavigatorOnLine.html) attribute, part of standard HTML5 API.
|
||||
The navigator.onLine attribute returns `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) i.e. definitely offline (disconnected from the network) and must return `true` otherwise.
|
||||
Since all other conditions return `true`, one has to be mindful of getting false positives, as we cannot assume `true` value necessarily means that Electron can access the internet. Such as in cases where the computer is running a virtualization software that has virtual ethernet adapters that are always “connected.”
|
||||
Therefore, if you really want to determine the internet access status of Electron,
|
||||
|
||||
Reference in New Issue
Block a user