justjavac / ChromeSnifferPlus

:mag: Sniff web framework and javascript libraries run on browsing website.
https://chrome.google.com/webstore/detail/library-sniffer/fhhdlnnepfjhlhilgmeepgkhjmhhhjkh
GNU General Public License v3.0
844 stars 147 forks source link

[Deprecation] chrome.loadTimes() is deprecated #94

Closed zhanglianxin closed 6 years ago

zhanglianxin commented 6 years ago
Google Chrome Version 64.0.3282.39 (Official Build) beta (64-bit)

[Deprecation] chrome.loadTimes() is deprecated, instead use standardized API: nextHopProtocol in Navigation Timing 2. https://www.chromestatus.com/features/5637885046816768. SPDY @ chrome-extension://****/js/detector.js:393

Although it's a warning message, the extension doesn't work normally.

I found this page may be helpful (Chrome 64 to deprecate the chrome.loadTimes() API).

justjavac commented 6 years ago

I will fix it https://developers.google.com/web/updates/2017/12/chrome-loadtimes-deprecated#wasfetchedviaspdy

function wasFetchedViaSpdy() {
  // SPDY is deprecated in favor of HTTP/2, but this implementation returns
  // true for HTTP/2 or HTTP2+QUIC/39 as well.
  if (window.PerformanceNavigationTiming) {
    const ntEntry = performance.getEntriesByType('navigation')[0];
    return ['h2', 'hq'].includes(ntEntry.nextHopProtocol);
  }
}