How the HTML/CSS/JS Live Editor Renders the Preview
AnyTool gives you three CodeMirror panes — HTML, CSS, and JavaScript — and assembles them into a single document that is rendered inside a freshly created sandboxed iframe (sandbox="allow-scripts" only, with no same-origin) via srcdoc, so the framed code cannot read the parent page, cookies, or local storage and nothing is fetched from a CDN. The preview updates as you type with a debounced rebuild (~200ms), and a bootstrap injected before your JS overrides console.log/warn/error/info/debug and captures window.onerror and unhandledrejection, posting each entry back via postMessage so a captured console panel streams output and runtime errors live. You can switch layouts (split, stacked, editor-only, preview-only), load example templates, format each pane with bundled Prettier, export a single-file index.html or a ZIP, and share by encoding the sources into the URL hash. Nothing is sent to a server.
- Three HTML/CSS/JS CodeMirror panes assembled into a sandboxed srcdoc iframe
- Instant debounced live preview — no Run button needed
- Captured console output plus window.onerror and unhandledrejection
- Layout presets, examples library, and one-click Prettier formatting
- Export single-file HTML or ZIP and share-via-URL with state in the link, no backend
