WorkerLocation.port

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

Syntax

string = object.port;

Examples

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

Specifications

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

Browser compatibility

BCD tables only load in the browser

See also