首页 > 解决方案 > chrome.loadTimes() 修复控制台中已弃用的 Google Chrome 代码?

问题描述

[控制台日志谷歌浏览器][1]

如何使用以下代码解决问题?谢谢

• content.js:4 [弃用] chrome.loadTimes() 已弃用,而是使用标准化 API:导航计时 2 中的 nextHopProtocol。https: //www.chromestatus.com/features/5637885046816768

// send spdy info for current page
chrome.runtime.sendMessage({
  spdy: loadTimes.wasFetchedViaSpdy,
  info: loadTimes.npnNegotiatedProtocol || loadTimes.connectionInfo
});

chrome.runtime.onMessage.addListener(function (res, sender, sendResponse) {
  chrome.runtime.sendMessage({
    spdy: loadTimes.wasFetchedViaSpdy,
    info: loadTimes.npnNegotiatedProtocol || loadTimes.connectionInfo
  });
});```


  [1]: https://i.stack.imgur.com/HcOZM.png

标签: javascriptwordpressgoogle-chrome

解决方案


推荐阅读