JavaScript Web APIs
Reference cards for browser-exposed JavaScript Web APIs, with engine-by-engine support summaries.
-
AbortController and AbortSignal
AbortController is the platform's standard cancellation primitive. AbortSignal flows through fetch, addEventListener, streams, and most async platform APIs added since 2019.
-
Fetch API: requests, responses, streaming, and abort
Fetch is the modern HTTP client built into the platform. It exposes Request, Response, AbortSignal, ReadableStream, and FormData as primitives that compose with the rest of the platform.
-
IntersectionObserver: visibility-driven loading
IntersectionObserver fires a callback when a target element enters or leaves a viewport-relative root, with configurable thresholds. The right primitive for lazy-load, infinite-scroll, and sticky-state detection.
-
ResizeObserver: element-level layout reactivity
ResizeObserver fires a callback when an observed element's content-box, border-box, or device-pixel size changes. The right primitive for component-level responsive behaviour, replacing window-resize listeners.
-
Service workers: registration, lifecycle, fetch handling
A service worker is a programmable network proxy controlled by the page's origin. It enables offline, background sync, and push, but introduces a lifecycle that can outlive the page.
-
structuredClone() and the structured-clone algorithm
structuredClone() deep-copies almost any object, including Maps, Sets, ArrayBuffers, and cyclic graphs, in one platform-native call. Replaces the JSON.parse(JSON.stringify(x)) idiom and most third-party clone libraries.
-
Web Components: custom-element lifecycle and slots
A custom element's lifecycle is defined by four user-agent callbacks plus three observable transitions. Knowing them is the difference between a robust component and one that leaks.