WorkerLocation.href
The href property of a WorkerLocation object returns a USVString containing the serialized URL for the worker's location.
Syntax
string = location.href;
Examples
// In a Web worker, on the page https://developer.mozilla.org/en-US/docs/Web
var result = location.href; // Returns 'https://developer.mozilla.org/en-US/docs/Web'
Specifications
| Specification |
|---|
| HTML Standard # dom-workerlocation-href |
Browser compatibility
BCD tables only load in the browser
See also
- The
WorkerLocationinterface it belongs to.