WorkerLocation.hostname

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

Syntax

string = object.hostname;

Examples

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

Specifications

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

Browser compatibility

BCD tables only load in the browser

See also