WorkerLocation.href

The href property of a WorkerLocation object returns a USVString containing the serialized URL for the worker’s location.

Syntax

string = object.href;

Examples

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

Specifications

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

Browser compatibility

BCD tables only load in the browser

See also