VFS HTML PreviewLive HTML preview for Visual Studio Code. Preview HTML and HTM files beside the editor with live refresh, responsive viewports, asset loading, diagnostics, Restricted Mode, and virtual workspace support for GitHub Repositories and VS Code for the Web. GitHub repository · Mylo Kaye's website Features
Quick start
Run Preview HTML again to reveal the existing preview. Use the viewport menu to switch between responsive, mobile, tablet, and desktop sizes. Preview behaviorChoose a viewport in the toolbar. Fixed widths can scroll horizontally when wider than the panel. Refresh reruns page scripts and resets form/application state; scroll position is restored where possible. Restart restoration preserves the file and viewport, not page state or scroll position. Settings
Asset saves and file-system changes refresh previews within the permitted root, including changes to files that the page may not reference. Unsaved external CSS/JavaScript edits are not included. Virtual workspace supportOpen a repository with GitHub Repositories, VS Code for the Web, or another virtual filesystem provider, then run Preview HTML. The extension uses VS Code The extension does not provide a virtual filesystem itself. The URI must already be readable through a VS Code workspace or filesystem provider. Each workspace folder remains a separate resource boundary. File-system refresh events also depend on the provider; use Refresh HTML Preview when a provider does not report changes. LimitationsThis is a static HTML preview, not a development server. Server-side templates, backend routes, root-relative site URLs and localhost HTTP/WebSocket services are not supported. Relative assets resolve against the HTML directory; existing The iframe deliberately has an opaque origin. Browser storage, service workers and some module-script/fetch requests may fail because of origin or CORS restrictions. Workspace CSP rules can also block preview scripts and diagnostics. Use webview developer tools for details when the status strip cannot report an error. Security and privacyThe preview runs in an isolated iframe without access to the VS Code API. Trusted previews allow scripts, forms and HTTPS resources. In Restricted Mode, workspace scripts, forms, nested frames and external network requests are disabled; local styles and images remain available. Scripts in trusted previews may make HTTPS network requests. Resource access defaults to the HTML directory. Selecting Development and verificationOpen this folder in VS Code and press F5 to launch an Extension Development Host. Run Before release, smoke-test local folders, a GitHub virtual workspace and VS Code for the Web: relative CSS/images/scripts, parent-directory assets in workspace mode, asset saves, manual mode, Restricted Mode, viewport sizing, diagnostics and restart restoration. Check ES modules against the documented sandbox limits. Package with Version history
See CHANGELOG.md for detailed changes. This history records project versions; Marketplace availability can lag while a package is verified. LicenseMIT. See LICENSE. Release changes are listed in CHANGELOG.md. |