WorkerLocation: origin property
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2016.
Note: This feature is only available in Web Workers.
The origin property of a WorkerLocation object returns the worker's origin.
Value
A string.
Examples
js
// On this page, returns the origin
const result = self.location.origin; // Returns:'https://developer.mozilla.org:443'
Specifications
| Specification |
|---|
| HTML # dom-workerlocation-origin |
Browser compatibility
| desktop | mobile | server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
origin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
See also
- The
WorkerLocationinterface it belongs to.