const observer = new PerformanceObserver((list) => {
list.getEntries().forEach((entry) => {
const protocol = entry.nextHopProtocol;
if (protocol && !(protocol === "h2" || protocol === "h3")) {
console.log(`${entry.name} uses ${protocol}.`);
}
});
});
observer.observe({ type: "resource", buffered: true });PerformanceResourceTiming: nextHopProtocol property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const resources = performance.getEntriesByType("resource");
resources.forEach((entry) => {
const protocol = entry.nextHopProtocol;
if (protocol && !(protocol === "h2" || protocol === "h3")) {
console.log(`${entry.name} uses ${protocol}.`);
}
});