newrelic / newrelic-browser-agent

New Relic Browser Agent
Apache License 2.0
80 stars 41 forks source link

LCP continues to be reported after page is hidden #66

Closed martinkuba closed 2 years ago

martinkuba commented 3 years ago

Description

The NR agent continues to record Largest Contentful Paint after the page changes visibility. This is a different from the WebVitals library, which stops recording when the page is hidden (e.g. by switching tab). https://github.com/GoogleChrome/web-vitals/blob/main/src/getLCP.ts#L68

In order to capture the same values as the Google official library, we should change this behavior.

Effort: Small

rr0214 commented 3 years ago

Effort: Small

aubreymasten commented 2 years ago

Fixed with PR #115