Web worker

Keeping such workers from being interrupted by user activities should allow Web pages to remain responsive at the same time as they are running long tasks in the background.

[1] As envisioned by WHATWG, web workers are relatively heavy-weight and are not intended to be used in large numbers.

The simplest use of web workers is for performing a computationally expensive task without interrupting the user interface.

That object's onmessage event handler allows the code to receive messages from the web worker.

The following example code checks for web worker support on a browser Web workers are currently supported by Chrome, Opera, Edge, Internet Explorer (version 10), Mozilla Firefox, and Safari.