File System Access and Origin-Private Storage Cheat Sheet
Work safely with user-chosen files, directories, writable streams, permissions, OPFS, worker sync handles, quotas, and cleanup.
Open cheat sheetHTML · 7 guides
Protect applications and use browser storage, identity, files, and device APIs.
Focused references
Each guide includes copy-ready syntax, detailed examples, and authoritative references.
Work safely with user-chosen files, directories, writable streams, permissions, OPFS, worker sync handles, quotas, and cleanup.
Open cheat sheetSelect, inspect, validate, preview, read, and upload user-chosen files with input type=file, File, FileReader, object URLs, FormData, and server-side checks.
Open cheat sheetImplement WebAuthn passkey registration and sign-in with correct encoding, conditional UI, user verification, and mandatory server-side validation.
Open cheat sheetUse browser cryptographic primitives safely for randomness, hashing, authenticated encryption, signatures, derivation, and controlled key import and export.
Open cheat sheetRequest geolocation, camera, microphone, display capture, and motion data with secure-context checks, meaningful consent, cleanup, and fallbacks.
Open cheat sheetDeploy restrictive Content Security Policy, verify third-party resources with SRI, and reduce DOM injection risk with Trusted Types and safe sinks.
Open cheat sheetStore browser data safely with localStorage, sessionStorage, IndexedDB transactions, indexes, quota estimates, persistence, and migrations.
Open cheat sheet