home

Shared Worker Demo

I'm a new Window

A [SharedWorker](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker) is a type of [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Work_Workers_API) that allows **multiple browser contexts** (like tabs, windows, or iframes) from the **same origin** to communicate with a **single shared script** running in the background.

Unlike a regular [`Worker`](https://developer.mozilla.org/en-US/docs/Web/API/Worker), which is scoped to a single window or tab, a `SharedWorker` creates a **shared execution context** that can be accessed by all windows of the same origin — making it ideal for coordinating state or data **across multiple browser windows**.

Key Features

Open New Window

Worker Code

This code is executed in the SharedWorker context.

Client Code