Last Updated:
The HTML Web Workers is a JavaScript executed from an HTML page that runs in the background, independently without affecting the performance of the page.
The HTML Web Workers is useful in performing a computationally expensive task without interrupting the user interface.
Note: Web workers are often able to utilize multi-core CPUs more effectively.
The following is your web-worker.js file. In the below code postMessage()
method is used to post a message back to the HTML page.
Device | ![]() | ![]() | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Browser | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
web workers | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ? | Yes | Yes | Yes | Yes | ? |