WorkerLocation: port-Eigenschaft
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since Juli 2015.
Hinweis: Diese Funktion ist nur in Web Workers verfügbar.
Die port
-Eigenschaft eines WorkerLocation
Objekts gibt den port
Teil des Standorts des Workers zurück.
Wert
Ein String.
Beispiele
js
// In a Web worker, on the page http://localhost:8080/
const result = location.port; // Returns '8080'
Spezifikationen
Specification |
---|
HTML> # dom-workerlocation-port> |
Browser-Kompatibilität
Loading…
Siehe auch
- Das
WorkerLocation
Interface, zu dem es gehört.