cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Sierra <>
Subject RE: cordova API doc queries
Date Wed, 22 May 2013 14:44:41 GMT
Short of consistent behavior, would it be fair to recommend best practice to assume the event
may fire soon after deviceready, prior to which you might test connection.type?  From the
POV of HTML5-savvy developers, do any of these platforms' devices not support the corresponding
navigator.onLine property?

--Mike S

From: Ray Camden
Sent: Tuesday, May 21, 2013 5:52 PM
Cc: Michael Sierra
Subject: Re: cordova API doc queries

Are you sure? I built a demo a while ago to show connection handling, and
I had to check during start up as well as use events. I just tested with
PhoneGap 2.6 and Ripple, and on Chrome, it did *not* fire an event handler
for network change when the app started.

On 5/20/13 4:05 PM, "Shazron" <> wrote:
>> * Do relevant online/offline events fire when the app starts up, or
>>   only when a change is detected during execution? The text for the
>>   offline event iOS quirk implies the former case: "During initial
>>   startup, the first offline event (if applicable) takes at least a
>>   second to fire." If it fires when the app inits, is the value of
>>   navigator.onLine true or false during that 1-second delay?
>During both startup and when a change is detected.
>navigator.onLine is tied to the connection API:
>During that iOS delay, it will be 'unknown' then after it should reflect
>the right value.

View raw message