Preview HTML beside the editor
Open an HTML file and run Preview HTML from the Command Palette or Explorer. The extension opens a preview beside the editor and reuses it when you run the command again.
Refresh and responsive controls
- Choose live refresh while editing, refresh on save, or manual refresh.
- Use mobile (390px), tablet (768px), desktop (1440px), or custom viewport widths.
- Refresh when supported local assets change, restore scroll position on trusted refreshes, and reopen previews after a VS Code restart.
- See resource, script, and content-policy errors reported by the preview.
- Use previews with local files, GitHub Repositories, and VS Code for the Web.
Preview boundaries
This is a static HTML preview, not a development server. Server-side templates, backend routes, root-relative site URLs, and localhost HTTP or WebSocket services are outside its scope. Relative assets resolve from the HTML file, or from the configured workspace resource root.
The preview runs in an isolated iframe. Trusted previews allow page scripts, forms, and HTTPS resources. In Restricted Mode, workspace scripts, forms, nested frames, and external network requests are disabled. The extension itself does not collect telemetry or transmit files; scripts in trusted previews can still make HTTPS requests as directed by the page.
Documentation and verification
Read the full usage, settings, compatibility, and security notes before using the preview with a project. The current published version is v0.1.5. The repository documents automated lifecycle checks and additional host and virtual-workspace smoke checks relevant to a release.