WorkerLocation object
Contains the location of the worker.
Syntax
self.location
DOM Information
Inheritance Hierarchy
The WorkerLocation does not inherit from any class or interface.Members
The WorkerLocation object has these types of members:
Properties
The WorkerLocation object has these properties.
| Property | Access type | Description |
|---|---|---|
|
Read-only |
Contains the anchor portion of the URL including the hash sign (#). | |
|
Read-only |
Contains the hostname and port values of the URL. | |
|
Read-only |
Contains the hostname of a URL. | |
|
Read-only |
Contains the hypertext reference (HREF) of the URL. | |
|
Read-only |
Contains the pathname of the URL. | |
|
Read-only |
Contains the port number of the URL. | |
|
Read-only |
Contains the protocol of the URL. | |
|
Read-only |
Contains the query part of the URL, including the question mark. |
Remarks
The WorkerLocation object is created by using the self.location method inside a worker thread. The self object is a reference to the WorkerGlobalScope object.
The WorkerLocation object can decompose the URL into the following component properties: href, protocol, host, hostname, port, pathname, search, and hash.The href property contains the absolute URL of the worker at its creation.