Working with shared workers

As discussed previously, shared workers are workers that multiple scripts can access, given that they follow the same origin policy (more on this in a later section named Same origin policy).

The API is a little different from dedicated workers, because these workers can be accessed by any script, so there's a need to manage all the connections via different ports baked into the SharedWorker object.

Get Learn ECMAScript - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.