# Peek Extensions Extensions are isolated modules that communicate with the core app via IPC and pubsub messaging. ## Hybrid Extension Architecture Peek uses a **hybrid extension loading model** that balances memory efficiency with crash isolation: ### Built-in Extensions (Consolidated) Built-in extensions (`cmd`, `groups`, `peeks`, `slides`) run as **iframes in a single extension host window**: - Share a single Electron BrowserWindow process - Memory efficient (~80-120MB vs ~200-400MB for separate windows) - Origin isolation via unique URL hosts (`peek://cmd/`, `peek://groups/`, etc.) - If one crashes, others in the same host are affected ### External Extensions (Separate Windows) External extensions (including `example` and user-installed) run in **separate BrowserWindows**: - Each has its own Electron process - Crash isolation - one extension crashing doesn't affect others - Uses `peek://ext/{id}/` URL scheme - Better for untrusted or experimental extensions ``` ┌─────────────────────────────────────────────────────────────┐ │ Extension Host Window (peek://app/extension-host.html) │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────┐ │ │ │