Skip to content

Browser Support

Browser Lifecycle uses capability detection instead of user-agent sniffing.

Capability helpers

ts
import {
  detectBrowserLifecycleCapabilities,
  supportsVisibility,
  supportsFocus,
  supportsConnectivity,
  supportsBroadcastChannel,
  supportsPageLifecycle,
  supportsRequestIdleCallback,
  supportsAbortController,
} from "@jayoncode/browser-lifecycle";

const capabilities = detectBrowserLifecycleCapabilities();

Module requirements

ModulePrimary APIsNotes
Visibilitydocument.visibilityState, visibilitychangeWidely supported
Focuswindow focus/blurWidely supported
Connectivitynavigator.onLine, online/offlineAdvisory only
Idleuser input events, timersConfigurable thresholds
Cross TabBroadcastChannelOptional; degrades when unavailable

Disable modules when capabilities are missing rather than branching in application code.

Testing unsupported environments

Use detectBrowserLifecycleCapabilities() in unit tests and mock browser globals in jsdom when needed.

An ecosystem of independent, headless TypeScript libraries engineered for modern web development. Every package includes interactive playgrounds and documentation that evolves alongside the code.