WorkerLocation:host 属性
注意:此功能仅在 Web Workers 中可用。
host 属性是 WorkerLocation 对象的一个属性,它返回 worker 位置的 host 部分。
值
字符串。
示例
js
// In a Web worker, on the page https://:8080/
const result = location.host; // Returns 'localhost:8080'
规范
| 规范 |
|---|
| HTML # dom-workerlocation-host |
浏览器兼容性
加载中…
另见
- 它所属的
WorkerLocation接口。