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