Bug 185697 - Implement Network Information API
Summary: Implement Network Information API
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: iPhone / iPad All
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
: 172643 212936 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-05-16 14:44 PDT by Ali G
Modified: 2022-12-06 04:40 PST (History)
15 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ali G 2018-05-16 14:44:47 PDT
Network Information API is highly valuable for Web pages to tailor content based on end user's network. For instance not autoplaying videos on slow or metered connections, using lower-resolution assets on 3G vs LTE, etc...

I am sure having this API implemented on at least iOS/Safari would be very much appreciated by the web community.

https://wicg.github.io/netinfo/
https://developer.mozilla.org/en-US/docs/Web/API/Network_Information_API
https://www.chromestatus.com/feature/6338383617982464

Thank you.
Comment 1 Alexey Proskuryakov 2018-05-17 12:53:06 PDT
As the spec openly admits, this would be a privacy disaster because of fingerprinting opportunities.
Comment 2 Ali G 2018-05-17 16:33:21 PDT
Fair point but how about partial support? Just having `connectionType` can go a long way.
Comment 3 Alexey Proskuryakov 2020-06-08 17:10:51 PDT
*** Bug 212936 has been marked as a duplicate of this bug. ***
Comment 4 Justin Uberti 2020-10-15 09:18:35 PDT
+1, even having just "cellular" and "unknown" in connectionType would be extremely valuable in terms of being able to know if the user is likely on a metered connection.

If even this is seen as an unacceptable additional amount of bit of fingerprinting surface, we could require a user gesture (and this would still be valuable to most interested applications).
Comment 5 youenn fablet 2020-10-21 09:34:32 PDT
(In reply to Justin Uberti from comment #4)
> +1, even having just "cellular" and "unknown" in connectionType would be
> extremely valuable in terms of being able to know if the user is likely on a
> metered connection.
> 
> If even this is seen as an unacceptable additional amount of bit of
> fingerprinting surface, we could require a user gesture (and this would
> still be valuable to most interested applications).

Heuristics could potentially be based on public IP addresses + device type to emulate cellular.
Also, in general, exposing cellular might be an issue, for instance MacOS devices using the cellular connection of iOS devices would have cellular=false.
Comment 6 Radar WebKit Bug Importer 2020-10-21 10:03:34 PDT
<rdar://problem/70533681>
Comment 7 Justin Uberti 2020-10-21 12:35:42 PDT
I considered the private IP heuristic, but this is complicated by mDNS, and some carriers may not assign public IPs (e.g. NAT64).

The main thing we would want to avoid here is sending a high data rate stream on a metered connection, since you could burn through your entire data plan quickly at 40 Mbps. Tethering is as you mention something that this API would not cover, but that is an edge case, and one could argue that people using tethering are largely aware of the risks.
Comment 8 Thomas Steiner 2021-08-13 04:29:20 PDT
I have rebooted the Network Information API based on long-going discussions with Yoav Weiss and would appreciate you all's feedback:

- Motivational doc: https://docs.google.com/document/d/1RDA23zSNdDuIcxZTX9Xo3zlD2fxf8dZg9-e0YaJQv0g/edit?usp=sharing
- Explainer: https://github.com/tomayac/netinfo/blob/relaunch/README.md
- Spec draft: https://ghcdn.rawgit.org/tomayac/netinfo/relaunch/index.html
Comment 9 Alex Christensen 2021-08-13 12:42:02 PDT
*** Bug 172643 has been marked as a duplicate of this bug. ***