demo · v142

Vite-Style Dev Server HMR

The friction this Chrome 142 change introduced for web developers: every JS framework dev server (Vite, Next, Astro, SvelteKit) opens a hot-module-reload WebSocket from localhost. If you preview your build over a tunnel (https://your-app.ngrok.io), the WS still points at ws://localhost:5173 — a public origin → loopback request, which Chrome 142 now classifies as local network access and prompts on. Below: three deploy scenarios with the actual WebSocket attempt running live.

scenario

page space
WS target space
verdict

The Chrome 142 rule: WebSocket handshakes are now subject to the same LNA prompt as fetch. Local dev (http→loopback) is fine; the tunnel case prompts; the third-party scenario is blocked outright when in a cross-origin iframe.

relevant API

// HMR client inside a public-origin tunnel preview
const ws = new WebSocket("ws://localhost:5173/__hmr");
// Chrome 142: triggers LNA prompt before opening the socket.
// Pre-Chrome-142: connects silently.

see also