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

No compatibility data found for api.WorkerLocation.port.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.

See also