WorkerLocation
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 location property obtained by calling globalThis.location.
Instance properties
- WorkerLocation.hrefread-only- : Returns a string containing the serialized URLfor the worker's location.
 
- : Returns a string containing the serialized 
- WorkerLocation.protocolread-only- : Returns the protocolpart of the worker's location.
 
- : Returns the 
- WorkerLocation.hostread-only- : Returns the hostpart of the worker's location.
 
- : Returns the 
- WorkerLocation.hostnameread-only- : Returns the hostnamepart of the worker's location.
 
- : Returns the 
- WorkerLocation.originread-only- : Returns the worker's origin.
 
- : Returns the worker's 
- WorkerLocation.portread-only- : Returns the portpart of the worker's location.
 
- : Returns the 
- WorkerLocation.pathnameread-only- : Returns the pathnamepart of the worker's location.
 
- : Returns the 
- WorkerLocation.searchread-only- : Returns the searchpart of the worker's location.
 
- : Returns the 
- WorkerLocation.hashread-only- : Returns the hashpart of the worker's location.
 
- : Returns the 
Instance methods
- WorkerLocation.toString- : Returns a string containing the serialized URLfor the worker's location. It is a synonym forWorkerLocation.href.
 
- : Returns a string containing the serialized