W3cubDocs

/Web APIs

WorkerLocation: origin property

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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
origin 38 14 29 No 25 10 38 38 29 25 10 3.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation/origin