Dev Tools · 3h ago
How to Keep WebSockets Alive in Chrome's Manifest V3
Chrome's Manifest V3 terminates service workers after ~30 seconds of inactivity, silently killing WebSocket connections. The fix requires a heartbeat to keep the worker alive, auto-reconnect with state snapshots, and try/catch around port messages. This affects any extension relying on persistent background connections.
Meridian48 take
The workaround is clever but highlights how Manifest V3's efficiency gains come at the cost of developer sanity for real-time features.
manifest-v3websocket