Comments (7)
What purpose does the ConnectionType part of this API provide? What can I do with the information that a user is on WiFi vs cellular vs Ethernet? That information is completely useless to me as any of these connection types can be either metered or unmetered.
It allows websites to add preferences. Such as, "auto-play video on cellular connections".
from netinfo.
Metered / unmetered is separate and independent signal - e.g. both network types may be metered but user may prefer one vs the other for some type of functionality.
I would love to provide metered/unmetered signal to applications. The problem is, getting this reliably and in a cross-platform way is very tricky.
from netinfo.
I was asking what use is ConnectionType, because metered information cannot be determined.
auto-play video on cellular connections
Why should I get a different experience from someone on WiFi just because it is common (but not universal) to have metered cellular data? Your example is acting on an assumption that a certain connection type is metered. If you can't expose if a connection is metered with this API, people like @jkarlin are going to make websites that discriminate features (auto-playing videos, asset resolutions) based on my connection type.
My question for you is what possible use is ConnectionType for when you don't assume certain types of connections are metered? The API already exposes connection max speed, which I can use to default to lower quality video playback for example.
I can't think of a single use of ConnectionType that doesn't have to do with assuming some are metered. Please help me understand.
I have >100 Mbps unlimited/unmetered LTE from Verizon and slower, limited/metered WiFi from Comcast. Not all cellular connections are metered and slow.
from netinfo.
It's perfectly reasonable for an application to expose a user preference that modifies behavior based on ConnectionType. Whether the user toggles such setting because they're on metered connection is a completely separate concern, and one deferred to the user.
from netinfo.
@igrigorik How can you expect API users to use this API in the manner you suggest when even the official MDN demo of the NetInfo API assumes meteredness of some connections.
Notice how there's "wifi-only", "wifi and cellular-only", but no "cellular-only"? This user tried to follow your recommended usage of presenting it in settings and still forgot to include "cellular-only" because they probably assumed most cellular connections are metered, and most wifi connections are unmetered. That demo from MDN isn't sufficient for me with my metered wifi and unmetered cellular data.
Now think about random one-man dev teams working on websites. They're likely going to make the same mistakes or even just copy the options from the MDN demo.
I hope this helps illustrate my issue to you better. I think the max speed part of the NetInfo API can be beneficial, but ConnectionType is going to harm me because people are going to accidentally assume meteredness (even if they didn't intend to), which will affect their use of this API nonetheless.
from netinfo.
@eligrey good catch on MDN article -- I agree that it needs to be updated.
Re, "one man dev-teams": bad developers will always find a way to shoot themselves in the foot, regardless of team size, project, or API. However, that should not prevent good developers from building richer and better experiences for the users, and ConnectionType
is a building block for such features.
from netinfo.
Ok then. I just hope that maybe 2-3 years from now, if the majority of websites end up abusing this feature in a manner against your recommendations, that the W3C re-evaluates its usefulness. If it ends up mostly being used as you intended, that will be great and I would definitely appreciate devs using the API correctly.
See you in 2-3 years.
from netinfo.
Related Issues (20)
- Update the thresholds for different effective connection types HOT 7
- IANA section with registrations HOT 2
- Somewhat mangled IDL for NetworkInfomation HOT 2
- Fix indent in EXAMPLE 1
- Support .toJSON() on NetworkInformation interface
- Remove [NoInterfaceObject] HOT 2
- Include a separate “metered network” property in addition to “save data” HOT 1
- Netinfo status
- Should we archive this? HOT 21
- Can we just do metered? HOT 3
- Should `effectiveConnectionType` be a fixed set of values? HOT 15
- Revise use cases
- Privacy review and standards track plan HOT 1
- Should ontypechange be added again?
- compatibilité d'affichage mobile HOT 1
- Update repo and spec to show this is no longer being actively incubated HOT 6
- [tomayac/netinfo 🍴] `isMetered` should be `metered` HOT 1
- [tomayac/netinfo 🍴] Remove typedef HOT 1
- [tomayac/netinfo 🍴] Need to document why `sustainedSpeed` can be `Infinity` HOT 1
- Client Hints should get Sec-CH- prefixes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netinfo.