WorkerLocation: origin property
        
        
          
                Baseline
                
                  Widely available
                
                
              
        
        
        
          
                
              
                
              
                
              
        
        
      
      This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2016.
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> # dom-workerlocation-origin>  | 
            
Browser compatibility
Loading…
See also
- The 
WorkerLocationinterface it belongs to.