Re: Network Information API

On Thu, Jan 16, 2014 at 10:14 AM, Marcos Caceres <w3c@marcosc.com> wrote:

> > > Also, the new NetInfo object might be useful to distinguish
> User-Agents implementing the latest spec from User-Agents implementing the
> specification v1 (2011). Something like:
> > >
> > > if (navigator.netInfo) { /* Upcoming W3C spec */
> > > }
> > > else if (navigator.connection) { /* W3C Working Draft 7 June 2011 */
> > > }
> >
> >
> > This is also a good point. I wonder how extended is the usage of the v1
> of this spec though. If I am not wrong the Android browser and PhoneGap are
> the only implementors of this API.
> >
> I think that's right. I remember Mounir saying that some version of this
> had shipped on Firefox for Android, but then was removed. So, hopefully no
> versioning code needed.
>

Unfortunately we ship this under the name navigator.mozConnection
everywhere, but on desktop we just have a default implementation returning
infinity for bandwidth and false for metered unconditionally.

Cheers,
--
Ehsan
<http://ehsanakhgari.org/>

Received on Thursday, 16 January 2014 15:41:40 UTC