INTRODUCING WEB WORKERS
With Web Workers, you can split computationally expensive tasks into separate JavaScript threads and communicate to them independently from the main JavaScript program actually running in a web page.
The workers themselves are clones of the JavaScript runtime environment, so nearly all built-in methods and functions are available, but there are some restrictions on what they can do. For example, a worker cannot access the normal browser window directly, including the window and document objects, nor the DOM itself, so its perspective on the browser’s HTML rendering process is nil. Web Workers do have access to the navigator and location objects, though, so they can discover what the browser is running and its current URL; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access