Network / 05

Connection type.

Reads the NetworkInformation API: effective type, downlink Mbps, RTT estimate, save-data mode. The browser's own opinion of your network quality.

Notes

Chromium-only. Safari and Firefox return 'not exposed' here, even though the underlying connection works fine.

How it works

We read navigator.connection (with vendor fallbacks) and dump every field: effectiveType, downlink, downlinkMax, rtt, type, saveData.

Effective type is the most useful single field — sites can branch on it to skip heavy assets. The 'type' field (wifi / cellular / ethernet) is hidden in most browsers for privacy.

Frequently asked

What does 'effective type' mean?

A coarse classification of perceived network quality: slow-2g, 2g, 3g, 4g. It's based on measured downlink + RTT, not the radio technology underneath — a strong LTE connection reports '4g', a congested 5G connection might report '3g'. Useful for adaptive loading (skip videos on slow connections).

Why does Safari say 'not exposed'?

Safari and Firefox don't ship the NetworkInformation API for privacy / fingerprinting reasons. Only Chromium-based browsers expose it. For cross-browser detection of slow connections, fall back to timing your own resource loads.

Is save-data mode worth respecting?

Strongly yes. When users enable Data Saver in Chrome (or Lite mode on Android), they're telling sites they care about every megabyte. Respecting it (skipping autoplay video, lower-res images) is a quick accessibility + perf win that costs almost nothing to implement.

Why is the reported downlink different from a speed test?

The NetworkInformation downlink is an estimate based on recently observed throughput — it's a hint, not a measurement. A real speed test (/network/speed) actively saturates the connection and reads the result. Use this for adaptive loading hints; use speed test for ground truth.