IT lexicon › Web › SharedWorker

SharedWorker

Web På svenska → Updated: 2026-05-24

JS worker shared by multiple tabs/iframes from the same origin — a single instance, many clients, communication via MessagePort.

Good for centralising state across tabs: a single shared WebSocket, coordinated caching, throttling of API calls. Lives as long as at least one client is open.

Caveats: no iOS Safari support for years (now fixed), debugging is clumsy (separate DevTools route via chrome://inspect), not available inside service workers themselves. For pure messaging, BroadcastChannel is often simpler.

← Back to the lexicon