
Browser DevTools extension for debugging HTMX applications.
Works with both htmx 2.x and htmx 4.0 alpha.
Capture the full HTMX request lifecycle with timing breakdown, headers, request/response body, and event trace.
Live DOM tree showing all HTMX elements with their hierarchy, attributes, and resolved targets. Auto-refreshes in real time.
hx-* attributes, resolved targets, internal dataFilterable timeline of all HTMX events with category color coding and expandable detail payloads.
event.detail JSONRecord DOM swaps with before/after snapshots and LCS-based diff view.
Surface silent HTMX failures grouped by error type with badge counts.
Version 0.2.0 adds full support for the htmx 4.0 alpha. The extension auto-detects which version is running and adapts transparently.
| htmx 2.x | htmx 4.0 | |
|---|---|---|
| Event format | htmx:configRequest |
htmx:config:request |
| Request tracking | XHR WeakMap | ctx object WeakMap |
| Detail structure | detail.elt, detail.xhr |
detail.ctx.sourceElement, detail.ctx.response |
| Error events | 10 separate events | Unified htmx:error + synthetic HTTP errors |
| Attributes | hx-ext, hx-request |
hx-action, hx-method, hx-config, hx-status |
| Version badge | Blue pill | Purple pill |
Both versions work simultaneously. No configuration needed.
git clone https://github.com/atoolz/htmx-devtools.git
cd htmx-devtools
npm install
npm run build:chrome
Chrome / Edge / Brave / Arc:
chrome://extensionsdist/ folderFirefox:
npm run build:firefox
about:debugging#/runtime/this-firefoxdist/manifest.jsonTry the extension with interactive demo pages (no server needed):
Install the extension, open a demo, press F12, and go to the HTMX tab.
Page Script Content Script Service Worker DevTools Panel
(MAIN world) (isolated) (background) (Preact UI)
Captures htmx -> Relays via -> Routes messages, -> Renders 5 tabs
events on postMessage + maintains state with real-time
document runtime.sendMessage per tab updates
"world": "MAIN" content script. Listens to all htmx:* events (both 2.x and 4.x names), serializes element data, tracks requests via XHR/ctx WeakMaps, and batches messages every 50ms.window.postMessage and chrome.runtime.sendMessage.chrome.devtools.panels.create().npm run dev # Watch mode (rebuilds on changes)
npm run build # Production build
npm run build:chrome # Build + copy Chrome manifest + icons
npm run build:firefox # Build + copy Firefox manifest + icons
npm run typecheck # TypeScript type check
node test/e2e/fixtures/test-server.js
# Open http://localhost:3456
Covers: GET/POST/PUT/DELETE, error scenarios (404, 500, timeout), all swap strategies, OOB swaps, polling, search with delay, contact editor (click-to-edit), and todo list.
| Language | TypeScript |
| Build | Vite (multi-entry, IIFE outputs for content/page/background scripts) |
| UI | Preact + @preact/signals (3KB gzipped) |
| Manifest | Chrome MV3 (also Firefox MV3 128+) |
| Target | Chrome, Edge, Brave, Arc, Opera, Firefox |
| Dependencies | 7 devDependencies, 0 runtime dependencies |
MIT
$ claude mcp add htmx-devtools \
-- python -m otcore.mcp_server <graph>