Back to Content

WorkerLocation: origin property

files/en-us/web/api/workerlocation/origin/index.md

latest504 B
Original Source

{{ApiRef("WorkerLocation")}}{{AvailableInWorkers("worker")}}

The origin property of a {{domxref("WorkerLocation")}} object returns the worker's {{domxref("URL.origin", "origin")}}.

Value

A string.

Examples

js
// On this page, returns the origin
const result = self.location.origin; // Returns:'https://developer.mozilla.org:443'

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • The {{domxref("WorkerLocation")}} interface it belongs to.