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.href
read-only- : Returns a string containing the serialized
URL
for the worker's location.
- : Returns a string containing the serialized
WorkerLocation.protocol
read-only- : Returns the
protocol
part of the worker's location.
- : Returns the
WorkerLocation.host
read-only- : Returns the
host
part of the worker's location.
- : Returns the
WorkerLocation.hostname
read-only- : Returns the
hostname
part of the worker's location.
- : Returns the
WorkerLocation.origin
read-only- : Returns the worker's
origin
.
- : Returns the worker's
WorkerLocation.port
read-only- : Returns the
port
part of the worker's location.
- : Returns the
WorkerLocation.pathname
read-only- : Returns the
pathname
part of the worker's location.
- : Returns the
WorkerLocation.search
read-only- : Returns the
search
part of the worker's location.
- : Returns the
WorkerLocation.hash
read-only- : Returns the
hash
part of the worker's location.
- : Returns the
Instance methods
WorkerLocation.toString
- : Returns a string containing the serialized
URL
for the worker's location. It is a synonym forWorkerLocation.href
.
- : Returns a string containing the serialized