[
https://issues.apache.org/jira/browse/CB-8185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14382026#comment-14382026
]
ASF GitHub Bot commented on CB-8185:
------------------------------------
Github user deadbird1980 commented on a diff in the pull request:
https://github.com/apache/cordova-plugin-network-information/pull/25#discussion_r27221938
--- Diff: www/network.js ---
@@ -26,7 +26,9 @@ var exec = require('cordova/exec'),
// Link the onLine property with the Cordova-supplied network info.
// This works because we clobber the navigator object with our own
// object in bootstrap.js.
-if (typeof navigator != 'undefined') {
+// Browser platform do not need to define this property, because
+// it is already supported by modern browsers
+if (cordova.platforId !== 'browser' && typeof navigator != 'undefined') {
--- End diff --
I think it should be cordova.platformId here, just found this problem when
testing latest code on browser.
> Add online and offiline plugin-network-information events support for the
> Browser platform
> ------------------------------------------------------------------------------------------
>
> Key: CB-8185
> URL: https://issues.apache.org/jira/browse/CB-8185
> Project: Apache Cordova
> Issue Type: Improvement
> Components: Browser, Plugin Network Information
> Reporter: Sergey Shakhnazarov
> Assignee: Vladimir Kotikov
>
> Initial implementation used XHR to check whether we connected to network or
> not. Two main problems of this approach is that it used CORS and wasn't able
> to detect local network access.
> So for better compatibility with specs it is better to use browsers native
> implementation of {{navigator.onLine}} property which properly handles all
> the aspects of network accessibility.
> {{navigator.onLine}} available for all modern browsers:
> http://caniuse.com/#feat=online-status
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]