Skip to content

Instantly share code, notes, and snippets.

@tangoabcdelta
Created April 16, 2022 14:44
Show Gist options
  • Save tangoabcdelta/b028f9ac928815e5ce3535bec19a7c35 to your computer and use it in GitHub Desktop.
Save tangoabcdelta/b028f9ac928815e5ce3535bec19a7c35 to your computer and use it in GitHub Desktop.
determine if spdy or http2 was used to fetch website
window.performance.getEntriesByType("resource").filter(p => 'nextHopProtocol' in p)[0].nextHopProtocol // 'h2'
// deprecated
// https://chromestatus.com/feature/5637885046816768
window.chrome.loadTimes().wasFetchedViaSpdy; // true
window.chrome.loadTimes().npnNegotiatedProtocol; // 'h2'
window.chrome.loadTimes().connectionInfo; // 'h2'
// If you're in an older machine OR browser, then
// Go to chrome://net-internals/#http2
// Open the network observation component
// Then select HTTP/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment