The hostname property of a WorkerLocation object returns the hostname part of the worker's location.
hostname
MDN Reference