Probes a URL on an interval and reports a three-state connection status.
Detection rules:
A probe that resolves within slowThreshold ms → resets all counters, status online.
A probe that resolves but exceeded slowThreshold, or aborted at hardTimeout → counts as slow.
Status flips to slow only after slowAfter consecutive slow probes.
A probe rejected with a real network error (not an abort) → counts as a network failure.
Status flips to offline only after offlineAfter consecutive network failures.
navigator.onLine === false (or the offline window event) is trusted as an immediate
offline signal; the online event clears it back to online.
Polling pauses while the tab is hidden to avoid accumulating failures from a throttled tab.
Probes a URL on an interval and reports a three-state connection status.
Detection rules:
slowThresholdms → resets all counters, statusonline.slowThreshold, or aborted athardTimeout→ counts as slow. Status flips toslowonly afterslowAfterconsecutive slow probes.offlineonly afterofflineAfterconsecutive network failures.navigator.onLine === false(or theofflinewindow event) is trusted as an immediateofflinesignal; theonlineevent clears it back toonline.