Note: This feature is only available in Web Workers.
The WorkerLocation interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.location property obtained by calling self.location.
This interface is only visible from inside a JavaScript script executed in the context of a Web worker.
WorkerLocation.href Read onlyReturns a string containing the serialized URL for the worker's location.
WorkerLocation.protocol Read onlyReturns the protocol part of the worker's location.
WorkerLocation.host Read onlyReturns the host part of the worker's location.
WorkerLocation.hostname Read onlyReturns the hostname part of the worker's location.
WorkerLocation.origin Read onlyReturns the worker's origin.
WorkerLocation.port Read onlyReturns the port part of the worker's location.
WorkerLocation.pathname Read onlyReturns the pathname part of the worker's location.
WorkerLocation.search Read onlyReturns the search part of the worker's location.
WorkerLocation.hash Read onlyReturns the hash part of the worker's location.
WorkerLocation.toString()Returns a string containing the serialized URL for the worker's location. It is a synonym for WorkerLocation.href.
Worker, WorkerNavigator, and WorkerGlobalScope