diff --git a/README.md b/README.md index cb29652..0c5249a 100644 --- a/README.md +++ b/README.md @@ -177,9 +177,9 @@ Obs.js also stores the following properties on the `window.obs` object: | `downlinkMax` | number (Mbps) | Max estimated downlink (if exposed) | `navigator.connection.downlinkMax` | Not used for Stances; informational only | | `connectionCapability` | `'strong' \| 'moderate' \| 'weak'` | Transport assessment | Derived from `rttCategory` and `downlinkBucket` | Strong = low RTT **and** high BW; Weak = high RTT **or** low BW | | `conservationPreference` | `'conserve' \| 'neutral'` | Frugality signal | `dataSaver === true` **or** `batteryLow === true` → `conserve` | — | -| `deliveryMode` | `'rich' \| 'cautious' \| 'lite'` | How “heavy” you should go | Derived from capability and conservation | Rich if **strong** and **not** conserving; Lite if **weak** or **conserve**; else Cautious | -| `canShowRichMedia` | boolean | Convenience: `deliveryMode === 'rich'` | Derived from `deliveryMode` | Shorthand for “go big” | -| `shouldAvoidRichMedia` | boolean | Convenience: `deliveryMode === 'lite'` | Derived from `deliveryMode` | Shorthand for “be frugal” | +| `deliveryMode` | `'rich' \| 'cautious' \| 'lite'` | How ‘heavy’ you should go | Derived from capability and conservation | Rich if **strong** and **not** conserving; Lite if **weak** or **conserve**; else Cautious | +| `canShowRichMedia` | boolean | Convenience: `deliveryMode === 'rich'` | Derived from `deliveryMode` | Shorthand for ‘go big’ | +| `shouldAvoidRichMedia` | boolean | Convenience: `deliveryMode === 'lite'` | Derived from `deliveryMode` | Shorthand for ‘be frugal’ | | `batteryLow` | boolean \| null | Battery ≤20% | Battery API | `true` when battery level is ≤20%; `null` if unknown | | `batteryCritical` | boolean \| null | Battery ≤5% | Battery API | `true` when battery level is ≤5%; `true` in addition to `batteryLow` | | `batteryCharging` | boolean \| null | On charge | Battery API | `null` if unknown | diff --git a/demo/index.html b/demo/index.html new file mode 100644 index 0000000..897fad4 --- /dev/null +++ b/demo/index.html @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + +
Obs.js uses the Navigator + and Battery APIs to get contextual information about your users’ connection + strength and battery status.
+ +It is built and maintained by Harry + Roberts under the MIT license.
+ +This page shows the .has-* classes on
+ <html> and the current window.obs object.
+ Toggle Data Saver, plug/unplug power, or change networks to see updates (where
+ supported).
html.classListwindow.obs