chrome-spdy-indicator icon indicating copy to clipboard operation
chrome-spdy-indicator copied to clipboard

Deprecation of chrome.loadtimes()

Open kav2k opened this issue 7 years ago • 4 comments

The API this extension is built upon is being deprecated starting Chrome 64.

A rewrite is needed to use nextHopProtocol of Resource Timing Level 2 API.

kav2k avatar Dec 14 '17 08:12 kav2k

Chrome 64 is out, meaning that everyone using this extension starts seeing deprecation warnings in the console.

image

cf. https://www.chromestatus.com/features/5637885046816768

tbroyer avatar Jan 28 '18 12:01 tbroyer

@rauchg I'm gathering Reporting endpoint from ReportingObserver on my service, and I got tons of DeprecationReport caused by this issue.

fixing are welcome !

Jxck avatar Oct 28 '18 08:10 Jxck

Let's fix!

rauchg avatar Dec 19 '18 05:12 rauchg

Fixing for Deprecation of chrome.loadtimes. \User Data\Default\Extensions\mpbpobfflnpcgagjijhmgnchggcjblin\1.0.0_0\content.js

`document.addEventListener("DOMContentLoaded", ready); // send spdy info for current page function ready(){ chrome.runtime.sendMessage({ spdy: wasFetchedViaSpdy(), info: npnNegotiatedProtocol() || connectionInfo() });

chrome.runtime.onMessage.addListener(function (res, sender, sendResponse) { chrome.runtime.sendMessage({ spdy: wasFetchedViaSpdy(), info: npnNegotiatedProtocol() || connectionInfo() }); }); } 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); } } function npnNegotiatedProtocol() { // NPN is deprecated in favor of ALPN, but this implementation returns the // HTTP/2 or HTTP2+QUIC/39 requests negotiated via ALPN. if (window.PerformanceNavigationTiming) { const ntEntry = performance.getEntriesByType('navigation')[0]; return ['h2', 'hq'].includes(ntEntry.nextHopProtocol) ? ntEntry.nextHopProtocol : 'unknown'; } } function connectionInfo() { if (window.PerformanceNavigationTiming) { const ntEntry = performance.getEntriesByType('navigation')[0]; return ntEntry.nextHopProtocol; } }`

Risgit avatar Oct 25 '20 21:10 Risgit