Questions with this tag should be about the "Web Workers" technology. Workers provide a simple means for web content to run scripts in background threads. Once created, a worker can send messages to the spawning task by posting messages to an event handler specified by the creator.
Web Workers are external JavaScript scripts which run in the background of a browser, useful for performing client-side CPU intensive tasks without disrupting the foreground tasks.
Only a subset of the JavaScript API is available in these scripts. Workers can include other scripts using the importScripts()
method.
Web workers are a WHATWG specification and are available in most browsers.
Support can be checked looking for a window.Worker
property:
function checkSupportForWebWorkers() {
return typeof window.Worker === "function";
}
References
- MDN: Using Web Workers
- MDN: Worker Interface
- HTML5 Rocks: The Basics of Web Workers
- W3C: Web Workers Working Draft
- W3Schools: HTML5 Web Workers