Added example about offline mode (#75) · WICG/netinfo@a241166
f0rmat1k
·
2018-11-02
·
via Recent Commits to netinfo:gh-pages
| Original file line number | Diff line number | Diff line change |
|---|
@@ -120,6 +120,7 @@
|
120 | 120 | * A web application whose primary purpose is to stream media could check `navigator.connection.type` prior to playback. When it's set to `'cellular'`, it could advise users that their mobile network operator might be charging for the bandwidth, and only start automatic playback of previously cached content. |
121 | 121 | * A web application that makes use of a service worker to [cache](https://w3c.github.io/ServiceWorker/v1/#cache-objects) resources during [installation](https://w3c.github.io/ServiceWorker/v1/#installation-algorithm) might have different bundles of assets that it might cache: a list of crucial assets that are cached unconditionally, and a bundle of larger, optional assets that are only cached ahead of time when `navigator.connection.type` is `'ethernet'` or `'wifi'`. |
122 | 122 | * A web application that uses a service worker with a [background sync](https://github.com/WICG/BackgroundSync/blob/master/explainer.md) handler might check the current `navigator.connection.type` value, and only transfer data inside the `sync` event handler if it is is `'ethernet'` or `'wifi'`. |
| 123 | +* A web application might make decision to enable offline mode based on network condition (e.g., when EDGE is not enough). |
123 | 124 | |
124 | 125 | ### Provide a way for scripts to be notified if the connection type changes. |
125 | 126 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。