Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation of chrome.loadtimes() #38

Open
kav2k opened this issue Dec 14, 2017 · 4 comments
Open

Deprecation of chrome.loadtimes() #38

kav2k opened this issue Dec 14, 2017 · 4 comments

Comments

@kav2k
Copy link
Contributor

kav2k commented Dec 14, 2017

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.

@tbroyer
Copy link

tbroyer commented Jan 28, 2018

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

@Jxck
Copy link
Contributor

Jxck commented Oct 28, 2018

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

fixing are welcome !

@rauchg
Copy link
Owner

rauchg commented Dec 19, 2018

Let's fix!

@Risgit
Copy link

Risgit commented Oct 25, 2020

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;
}
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants