WorkerLocation: hostname-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 hostname
-Eigenschaft eines WorkerLocation
-Objekts gibt den hostname
-Teil des Standorts des Workers zurück.
Wert
Ein Zeichenfolge.
Beispiele
js
// In a Web worker, on the page http://localhost:8080/
const result = location.hostname; // Returns 'localhost'
Spezifikationen
Specification |
---|
HTML> # dom-workerlocation-hostname> |
Browser-Kompatibilität
Loading…
Siehe auch
- Das
WorkerLocation
-Interface, zu dem es gehört.