Skip to main content

6 docs tagged with "browser-api"

View all tags

Container Queries

Container queries let you style descendants based on the size of a parent container rather than the viewport. This makes components truly context-agnostic — they adapt to the space they're given, not to the overall screen.

HTML Sanitizer API

The HTML Sanitizer API sanitizes untrusted HTML before DOM insertion, removing XSS-dangerous content (scripts, event handlers) using the browser's own parser — eliminating parser-differential vulnerabilities that plague userland sanitizers.

navigator.sendBeacon

navigator.sendBeacon sends a small HTTP POST request reliably during page unload. The browser guarantees delivery without blocking navigation — making it ideal for fire-and-forget data like analytics pings.

Trusted Types API

The Trusted Types API prevents DOM-based XSS by enforcing that dangerous DOM sinks (innerHTML, eval(), document.write(), script.src, etc.) only accept typed objects instead of raw strings. When enforced via CSP, any attempt to pass a plain string to a dangerous sink throws a TypeError.

URLPattern

URLPattern lets you match URLs — or individual components of them — against patterns with wildcards and named groups. The syntax is inspired by path-to-regexp, the same library Express uses for its route definitions.