Note: This feature is only available in Web Workers.
The origin property of a WorkerLocation object returns the worker's origin.
A string.
// On this page, returns the origin
const result = self.location.origin; // Returns:'https://developer.mozilla.org:443'WorkerLocation interface it belongs to.