Is it possible to determine the version of the HTTP protocol using JavaScript? I need to determine if the user is using the HTTP / 2 protocol (and congratulate him if that is the case).
Only works in Chrome at the moment, but other browsers should be available soon.
console.log(performance.getEntries()[0].nextHopProtocol)
if (location.protocol == "http/2"){ alert('congratulations!'); }