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

Deprecated chrome.loadTimes() even on recent Chrome versions (not always) #19

Open
GuillaumeRossolini opened this issue Nov 8, 2018 · 1 comment

Comments

@GuillaumeRossolini
Copy link

GuillaumeRossolini commented Nov 8, 2018

Hi

This looks like a repeat of #16 and I wasn't sure at first because the warning doesn't trigger for every page we collect statistics thanks to this lib.
However, I have now seen the warning in my browser. I am not sure what triggered this.

[Edit]
Actually, I have a reproduce case:

It may be an event triggered on page unload

@Romiko
Copy link
Contributor

Romiko commented Sep 28, 2020

Hi,

Any news on this one?
[Deprecation] chrome.loadTimes() is deprecated, instead use standardized API: Paint Timing

`

  (anonymous) @ rum-speedindex.js:1
  RUMSpeedIndex @ rum-speedindex.js:1
  (anonymous) @ (index):25

`
The solution for this is:
https://developers.google.com/web/updates/2017/12/chrome-loadtimes-deprecated

function startLoadTime() { // If the browser supports the Navigation Timing 2 and HR Time APIs, use // them, otherwise fall back to the Navigation Timing 1 API. if (window.PerformanceNavigationTiming && performance.timeOrigin) { const ntEntry = performance.getEntriesByType('navigation')[0]; return (ntEntry.startTime + performance.timeOrigin) / 1000; } else { return performance.timing.navigationStart / 1000; } }

and
function requestTime() { // If the browser supports the Navigation Timing 2 and HR Time APIs, use // them, otherwise fall back to the Navigation Timing 1 API. if (window.PerformanceNavigationTiming && performance.timeOrigin) { const ntEntry = performance.getEntriesByType('navigation')[0]; return (ntEntry.startTime + performance.timeOrigin) / 1000; } else { return performance.timing.navigationStart / 1000; } }

Is this possible to update. Would you like me to create a PR for this?

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

2 participants