Detect browser if capable/enabled for http2 via javascript or php
问题 I've checked on similar questions and found two options I can proceed with, however both have problematic issues. if ( performance && performance.timing.nextHopProtocol ) { console.log('Protocol:' + performance.timing.nextHopProtocol); } else if ( window.chrome && window.chrome.loadTimes ) { console.log('Protocol:' + window.chrome.loadTimes().connectionInfo); } else { console.log("Browser does not expose connection protocol"); } The above code does return the protocol however, while using my