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.