Skip to content

Paint metrics are reported when page starts off in a hidden state #153

@karadaisy

Description

@karadaisy

Hi! I noticed a bug in my own application's metric tracking this morning, went to check how Perfume solved it, and I think I found that Perfume has the same bug:

If I open a link in a new tab, wait a few seconds, and then switch to the tab, FCP and LCP are still reported, but the duration is the time I waited before switching to the tab.

I believe this is because visibility.isHidden is only set to true by a visibilitychange event, and in this case there is no event fired until I switch to the tab and page becomes visible.

Here's a simple example demonstrating the issue: https://kylewm.github.io/perfume-demo/

Jan-29-2021 11-21-57

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions