VS HTML PreviewLive HTML previews beside the editor in VS Code, with responsive viewports, asset refresh, diagnostics and GitHub workspace support. GitHub repository · Mylo Kaye's website Features
UseOpen an HTML file and run Preview HTML, or right-click it in Explorer. The preview opens beside the editor. Running the command again brings the existing preview into view. Choose 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. File-system monitoring depends on the workspace provider; use Refresh if a virtual provider does not report changes. GitHub repositories and VS Code for the WebOpen a repository with GitHub Repositories or in VS Code for the Web, then run Preview HTML. Resource access uses VS Code URIs rather than local disk paths. Each workspace folder remains a separate resource boundary. CompatibilityThis 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. |
