nextHopProtocol read-only property is a string 表示 network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301) .

When a proxy is used, if a tunnel connection is established, this property returns the ALPN Protocol ID of the tunneled protocol. Otherwise, this property returns the ALPN Protocol ID of the first hop to the proxy.

注意: 此特征可用于 Web 工作者 .

句法

resource.nextHopProtocol;
					

返回值

A string 表示 network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301) .

范例

以下范例使用 nextHopProtocol 特性。

function print_PerformanceEntries() {
  // Use getEntriesByType() to just get the "resource" events
  var p = performance.getEntriesByType("resource");
  for (var i=0; i < p.length; i++) {
    print_nextHopProtocol(p[i]);
  }
}
function print_nextHopProtocol(perfEntry) {
  var value = "nextHopProtocol" in perfEntry;
  if (value)
    console.log("nextHopProtocol = " + perfEntry.nextHopProtocol);
  else
    console.log("nextHopProtocol = NOT supported");
}
					

规范

规范 状态 注释
Resource Timing Level 2
The definition of 'nextHopProtocol' in that specification.
工作草案 初始定义。

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
nextHopProtocol Chrome 61 Edge 17 Firefox 45 IE No Opera No Safari No WebView Android 61 Chrome Android 61 Firefox Android 45 Opera Android No Safari iOS No Samsung Internet Android 8.0

图例

完整支持

完整支持

不支持

不支持

元数据

  • 最后修改: