web api instance property
WorkerLocation: origin property
Available in workers
The origin property of a WorkerLocation object returns the worker’s origin.
Value
A string.
Examples
// On this page, returns the origin
const result = self.location.origin; // Returns:'https://developer.mozilla.org:443'
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
See also
- The
WorkerLocationinterface it belongs to.