New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated online-offline-events.md #10834

Merged
merged 3 commits into from Oct 18, 2017

Conversation

Projects
None yet
4 participants
@Vehemos
Contributor

Vehemos commented Oct 18, 2017

Added more info, to clarify things.

Updated online-offline-events.md
Added more info, to clarify things.

@Vehemos Vehemos requested a review from electron/docs as a code owner Oct 18, 2017

@welcome

This comment has been minimized.

welcome bot commented Oct 18, 2017

💖 Thanks for opening this pull request! 💖

Here is a list of things that will help get it across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.
    We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.
@jkleinsc

@Vehemos thanks for the PR! I think we can move this forward with a slight tweak. Also, I think it would be helpful to include a link to documentation on the navigator.onLine attribute, maybe this one: https://developer.mozilla.org/en-US/docs/Online_and_offline_events

@@ -1,7 +1,13 @@
# Online/Offline Event Detection
Online and offline event detection can be implemented in the renderer process
using standard HTML5 APIs, as shown in the following example.
using standard HTML5 NavigatorOnLine API.

This comment has been minimized.

@jkleinsc

jkleinsc Oct 18, 2017

Contributor

This line would read better as:

using the navigator.onLineattribute.

This comment has been minimized.

@Vehemos

Vehemos Oct 18, 2017

Contributor

Ah, I should've noticed that. Thanks a ton!

@Vehemos

Will perform the requested changes.

@@ -1,7 +1,13 @@
# Online/Offline Event Detection
Online and offline event detection can be implemented in the renderer process
using standard HTML5 APIs, as shown in the following example.
using standard HTML5 NavigatorOnLine API.

This comment has been minimized.

@Vehemos

Vehemos Oct 18, 2017

Contributor

Ah, I should've noticed that. Thanks a ton!

Updated online-offline-events.md
Added links, removed grammatical error.
@Vehemos

This comment has been minimized.

Contributor

Vehemos commented Oct 18, 2017

@jkleinsc Any more suggestions? Newbie on GitHub here, any mistakes you point out will help, or something else you might need help with except Documentation, anything which uses C++ but isn't too complex for a beginner. :)
Opened this PR with issue #10805 in mind.

@@ -1,7 +1,12 @@
# Online/Offline Event Detection
Online and offline event detection can be implemented in the renderer process
using standard HTML5 APIs, as shown in the following example.
[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.

This comment has been minimized.

@MarshallOfSound

MarshallOfSound Oct 18, 2017

Member
using the [`navigator.onLine`]() attribute
Online and offline event detection can be implemented in the renderer process
using standard HTML5 APIs, as shown in the following example.
[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.

This comment has been minimized.

@MarshallOfSound

MarshallOfSound Oct 18, 2017

Member

I think we can make this simpler to understand.

The `navigator.onLine` attribute returns `false` if any network
requests are guaranteed to fail.  This normally occurs when
the device is disconnected from the network.  It will return
`true` in all other cases.

This comment has been minimized.

@Vehemos

Vehemos Oct 18, 2017

Contributor

Will do.

Updated online-offline-events.md
Improved readability and simplicity.
@Vehemos

Updated the doc as requested.

EDIT: The Doc attached to this comment is the outdated one since I committed the new one before the review.

Online and offline event detection can be implemented in the renderer process
using standard HTML5 APIs, as shown in the following example.
[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.

This comment has been minimized.

@Vehemos

Vehemos Oct 18, 2017

Contributor

Will do.

@jkleinsc

This comment has been minimized.

Contributor

jkleinsc commented Oct 18, 2017

@Vehemos thanks for making the requested changes. It looks good to go now.

@jkleinsc jkleinsc merged commit cf12d31 into electron:master Oct 18, 2017

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@welcome

This comment has been minimized.

welcome bot commented Oct 18, 2017

Congrats on merging your first pull request! 🎉🎉🎉

@zeke

This comment has been minimized.

Member

zeke commented Oct 18, 2017

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment