WorkerLocation.host

The host property of a WorkerLocation object returns the host part of the worker’s location.

Syntax

string = object.host;

Examples

// In a Web worker, on the page https://developer.mozilla.org/en-US/WorkerLocation.host
var result = window.self.host; // Returns:'developer.mozilla.org:80'

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'WorkerLocation.host' in that specification.
Living Standard Initial definition.

Browser compatibility

BCD tables only load in the browser

See also