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