WorkerLocation: origin property

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 Standard
# dom-workerlocation-origin

Browser compatibility

BCD tables only load in the browser

See also