Shared workers use .port because they support multiple clients (scripts or tabs) and each connection requires a unique MessagePort for bidirectional communication. The MessagePort allows the worker to distinguish messages from different clients. Dedicated workers, on the other hand, are tied to a single client, so they don't need .port. Communication with a dedicated worker happens directly through the Worker instance.