New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 368358 link

Starred by 45 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task

Blocked on:
issue 416864
issue 377736
issue 378785
issue 381683
issue 412741

Blocking:
issue 375550


Show other hotlists

Hotlists containing this issue:
Top-Starred-Bugs


Sign in to add a comment

Implement Network Info API

Project Member Reported by jkarlin@google.com, Apr 29 2014

Issue description

Description:
The Network Information API enables web applications to access the underlying connection information of the device.

Changes to API surface:
* Add navigator.connection
* Add attribute navigator.connection.type
* Add event navigator.connection.ontypechange

Links:
Public standards discussion: http://w3c.github.io/netinfo/

Support in other browsers:
Internet Explorer: No public signal
Firefox: Yes, being implemented
Safari: No public signal

 
Labels: cr-blink cr-internals-network Cr-UI-OSIntegration
Owner: jkarlin@chromium.org
Status: Started
See  bug 112937  for discussion of implementation of previous versions of this API.
Cc: igrigo...@chromium.org
Blocking: chromium:375550
Project Member

Comment 4 by bugdroid1@chromium.org, May 23 2014

The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=174640

------------------------------------------------------------------
r174640 | jkarlin@chromium.org | 2014-05-23T02:57:32.979002Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/page/NetworkStateNotifier.h?r1=174640&r2=174639&pathrev=174640
   M http://src.chromium.org/viewvc/blink/trunk/Source/web/WebNetworkStateNotifier.cpp?r1=174640&r2=174639&pathrev=174640
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/core.gypi?r1=174640&r2=174639&pathrev=174640
   A http://src.chromium.org/viewvc/blink/trunk/public/platform/WebConnectionType.h?r1=174640&r2=174639&pathrev=174640
   M http://src.chromium.org/viewvc/blink/trunk/public/web/WebNetworkStateNotifier.h?r1=174640&r2=174639&pathrev=174640
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/page/NetworkStateNotifier.cpp?r1=174640&r2=174639&pathrev=174640
   A http://src.chromium.org/viewvc/blink/trunk/Source/core/page/NetworkStateNotifierTest.cpp?r1=174640&r2=174639&pathrev=174640

Adds type members and accessors to the NetworkStateNotifier.  Also allows for registration of thread-safe observers for said type information so that both workers and windows can receive notification.

This is part of adding NetInfo v3 to Chrome, and this code is used by https://codereview.chromium.org/291203002.

Design doc: https://docs.google.com/a/chromium.org/document/d/1LTk9uVMGi4kurzcF5ellsAJReTF31fFJMHrQwSVtBjc/ 

BUG=368358

Review URL: https://codereview.chromium.org/289333003
-----------------------------------------------------------------
Cc: mlamouri@chromium.org
Blockedon: chromium:377736
Blockedon: chromium:378785
Project Member

Comment 9 by bugdroid1@chromium.org, May 29 2014

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d7ff5fb6c3edd0ee36bac1b50948ce2fc9c89f94

commit d7ff5fb6c3edd0ee36bac1b50948ce2fc9c89f94
Author: jkarlin@chromium.org <jkarlin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Thu May 29 19:50:25 2014

Sends NetworkChangeNotifier connection type changes to Blink, to support NetInfo v3.

Design doc: https://docs.google.com/a/chromium.org/document/d/1LTk9uVMGi4kurzcF5ellsAJReTF31fFJMHrQwSVtBjc/

BUG=368358

Review URL: https://codereview.chromium.org/298803006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273555 0039d316-1c4b-4281-b951-d872f2087c98


Project Member

Comment 10 by bugdroid1@chromium.org, May 29 2014

------------------------------------------------------------------
r273555 | jkarlin@chromium.org | 2014-05-29T19:50:25.236203Z

Changed paths:
   A http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/net_info_helper.cc?r1=273555&r2=273554&pathrev=273555
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/net/browser_online_state_observer.cc?r1=273555&r2=273554&pathrev=273555
   A http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/net_info_helper.h?r1=273555&r2=273554&pathrev=273555
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/common/common_param_traits_macros.h?r1=273555&r2=273554&pathrev=273555
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/common/view_messages.h?r1=273555&r2=273554&pathrev=273555
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/render_view_host_impl.cc?r1=273555&r2=273554&pathrev=273555
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/render_thread_impl.cc?r1=273555&r2=273554&pathrev=273555
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/render_thread_impl.h?r1=273555&r2=273554&pathrev=273555
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/common/p2p_messages.h?r1=273555&r2=273554&pathrev=273555
   M http://src.chromium.org/viewvc/chrome/trunk/src/webkit/common/webpreferences.cc?r1=273555&r2=273554&pathrev=273555
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/content_renderer.gypi?r1=273555&r2=273554&pathrev=273555
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/web_preferences.cc?r1=273555&r2=273554&pathrev=273555
   M http://src.chromium.org/viewvc/chrome/trunk/src/webkit/common/webpreferences.h?r1=273555&r2=273554&pathrev=273555
   M http://src.chromium.org/viewvc/chrome/trunk/src/net/base/network_change_notifier.h?r1=273555&r2=273554&pathrev=273555

Sends NetworkChangeNotifier connection type changes to Blink, to support NetInfo v3.

Design doc: https://docs.google.com/a/chromium.org/document/d/1LTk9uVMGi4kurzcF5ellsAJReTF31fFJMHrQwSVtBjc/

BUG=368358

Review URL: https://codereview.chromium.org/298803006
-----------------------------------------------------------------
Project Member

Comment 11 by bugdroid1@chromium.org, May 31 2014

The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=175200

------------------------------------------------------------------
r175200 | jkarlin@chromium.org | 2014-05-31T20:20:50.553558Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/page/NetworkStateNotifier.h?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/multiple-frames-expected.txt?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/Source/platform/RuntimeEnabledFeatures.in?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/netinfo/NavigatorNetworkInformation.idl?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/gc-frame-listeners.html?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/basic-operation-expected.txt?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/netinfo/NetworkInformation.h?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/global-constructors-listing-expected.txt?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/netinfo/NavigatorNetworkInformation.cpp?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/gc-unused-listeners.html?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/netinfo?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/multiple-frames.html?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/unregister-during-event-expected.txt?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/gc-used-listeners-expected.txt?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/resources?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/page/NetworkStateNotifier.cpp?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/netinfo/NetworkInformation.idl?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/basic-operation.html?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/Window/resources/window-property-collector.js?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/EventTargetModulesFactory.in?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/modules.gypi?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/netinfo/NetworkInformation.cpp?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/resources/netinfo_common.js?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/unregister-during-event.html?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/gc-used-listeners.html?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/gc-frame-listeners-expected.txt?r1=175200&r2=175199&pathrev=175200
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/events/EventTypeNames.in?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/netinfo/NavigatorNetworkInformation.h?r1=175200&r2=175199&pathrev=175200
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/gc-unused-listeners-expected.txt?r1=175200&r2=175199&pathrev=175200

MUST LAND AFTER crrev.com/302543006

Adds Netinfo v3 to Blink.

The layout changes outside of netinfo/ are regolding.

Design doc: https://docs.google.com/a/chromium.org/document/d/1LTk9uVMGi4kurzcF5ellsAJReTF31fFJMHrQwSVtBjc/

BUG=368358

Review URL: https://codereview.chromium.org/291203002
-----------------------------------------------------------------
Project Member

Comment 12 by bugdroid1@chromium.org, Jun 2 2014

The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=175281

------------------------------------------------------------------
r175281 | jkarlin@chromium.org | 2014-06-02T14:18:47.259104Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/web-worker-expected.txt?r1=175281&r2=175280&pathrev=175281
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/netinfo/WorkerNavigatorNetworkInformation.h?r1=175281&r2=175280&pathrev=175281
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/netinfo/WorkerNavigatorNetworkInformation.idl?r1=175281&r2=175280&pathrev=175281
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/modules.gypi?r1=175281&r2=175280&pathrev=175281
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/web-worker.html?r1=175281&r2=175280&pathrev=175281
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/global-constructors-listing-dedicated-worker-expected.txt?r1=175281&r2=175280&pathrev=175281
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/global-constructors-listing-shared-worker-expected.txt?r1=175281&r2=175280&pathrev=175281
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/netinfo/resources/web-worker.js?r1=175281&r2=175280&pathrev=175281
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/netinfo/WorkerNavigatorNetworkInformation.cpp?r1=175281&r2=175280&pathrev=175281
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/netinfo/NetworkInformation.idl?r1=175281&r2=175280&pathrev=175281

Adds WebWorker support to NetInfo v3.

Design doc: https://docs.google.com/a/chromium.org/document/d/1LTk9uVMGi4kurzcF5ellsAJReTF31fFJMHrQwSVtBjc/

BUG=368358

Review URL: https://codereview.chromium.org/299883004
-----------------------------------------------------------------
At this point NetInfo is in.  As NetworkChangeNotifier improves so will the type information on the various platforms.
Blockedon: chromium:381683
'unknown' connection type has been added.  pauljensen@ added ethernet/wifi distinction on Windows. 
Project Member

Comment 16 by bugdroid1@chromium.org, Jul 29 2014

The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=179147

------------------------------------------------------------------
r179147 | jkarlin@chromium.org | 2014-07-29T14:43:14.706885Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/public/web/WebRuntimeFeatures.h?r1=179147&r2=179146&pathrev=179147
   M http://src.chromium.org/viewvc/blink/trunk/Source/web/WebRuntimeFeatures.cpp?r1=179147&r2=179146&pathrev=179147

Add enabling/disabling of NetworkInformation API via WebRuntimeFeatures.  This lets us restrict the API to the platforms that are fully implemented while we develop the others.

See https://codereview.chromium.org/424823002/ for the Chromium code that uses this.

BUG=368358

Review URL: https://codereview.chromium.org/422933003
-----------------------------------------------------------------
Project Member

Comment 18 by bugdroid1@chromium.org, Jul 30 2014

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0c40da93ddffd49e3f9cc5d78f3a9c57fe02ce13

commit 0c40da93ddffd49e3f9cc5d78f3a9c57fe02ce13
Author: jkarlin@chromium.org <jkarlin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Wed Jul 30 17:43:45 2014

Enable NetInfo only on the platforms that it has good types for (right
now Android, ChromeOS, and IOS).

Depends on Blink CL: https://codereview.chromium.org/422933003/

BUG=368358

Review URL: https://codereview.chromium.org/424823002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286553 0039d316-1c4b-4281-b951-d872f2087c98


Project Member

Comment 19 by bugdroid1@chromium.org, Jul 31 2014

The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=179308

------------------------------------------------------------------
r179308 | jkarlin@chromium.org | 2014-07-31T13:49:29.412596Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/platform/RuntimeEnabledFeatures.in?r1=179308&r2=179307&pathrev=179308

Mark Network Information as Stable.

See https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/sTtZIk4XkaY for intent to ship.

BUG=368358

Review URL: https://codereview.chromium.org/429883003
-----------------------------------------------------------------
Blockedon: chromium:416864
Blockedon: chromium:412741
Labels: Needs-Feedback
Hi jkarlin@,
  It looks like work on this issue is finished. Is it possible to close it?
Still blocked on issue 416864 so can't close it quite yet.
Labels: -Needs-Feedback
Components: -Blink Blink>Network
 Issue 119109  has been merged into this issue.
The spec link http://w3c.github.io/netinfo/ is not accessible right now (404 not found). Is it a temporary problem or it is removed intentionally?
Oh, the repo is gone?
https://github.com/w3c/netinfo
It has moved to the WICG, the new address is http://wicg.github.io/netinfo/. I've updated the Chrome Platform Status link as well.
The W3C really should have just modified the existing netinfo site to 301 to to http://wicg.github.io/netinfo/

It's more than a little ironic that the W3C broke their own documentation links... 
Thanks :)
Project Member

Comment 34 by sheriffbot@chromium.org, Jun 16 2016

Labels: Hotlist-Google
Components: -UI>OSIntegration Internals>PlatformIntegration
Deprecating UI>OSIntegration in favor of the more generic Internals>PlatformIntegration
I don't see ontypechange in the spec for NetworkInformation (https://wicg.github.io/netinfo/#the-networkinformation-interface).

Should it be? 
It used to be in the spec, and now we're deprecating it.
Blockedon: 699892
Blockedon: -699892
This API shipped in M45, should this not be closed as fixed?
Hmm, where is this enabled? In our source it's marked as stable, but the NetworkInformation interface object isn't in my Chrome stable on desktop, but I can see it on Chrome for Android.
That's why the bug isn't marked as fixed. We've only shipped on Android (as that was the most important platform to ship for).
Labels: migrated-launch-owp Type-Task
This issue has been automatically relabelled type=task because type=launch-owp issues are now officially deprecated. The deprecation is because they were creating confusion about how to get launch approvals, which should be instead done via type=launch issues.

We recommend this issue be used for implementation tracking (for public visibility), but if you already have an issue for that, you may mark this as duplicate.

For more details see here: https://docs.google.com/document/d/1JA6RohjtZQc26bTrGoIE_bSXGXUDQz8vc6G0n_sZJ2o/edit

For any questions, please contact owencm, sshruthi, larforge
I'm seeing this implemented on desktop Chrome 61 on Linux, but the data it returns seems bogus (0.1Mbps on a Google corporate network).  Chrome 61 on Android, however, returns useful data.  I'm using this sample:

https://googlechrome.github.io/samples/network-information/

I don't think I can adopt this in my application if it may be returning bogus values for desktop.  I'm considering either not using this info at all or finding some way to exclude desktop platforms.

Ideally, this would still be disabled for desktop instead of returning bad data.  Is it intended that it be enabled already on desktop?

Is there a recommended way to differentiate between the two in the mean time?  I notice that connection.type on desktop is undefined, while on Android it is returning "wifi" (which is correct for me at the moment).

Should I avoid this completely until desktop is sorted out?
I think there are still couple of issues left on desktop due to hanging GETs (e.g., from gmail or hangouts) which may keep requests open for long time. I am going to fix it this week for M-62. The rtt should definitely be more reliable on desktop, and all attributes should be reliable on Android.
I have filed  Issue 770897  for the issue reported in Comment #34 above.
Cc: jkarlin@chromium.org tbansal@chromium.org
 Issue 776229  has been merged into this issue.

Sign in to add a comment