Skip to content

onLCP may report even page was hidden previously #325

Closed
@zuoaoyuan

Description

@zuoaoyuan

Some metrics like LCP & FID only report if the page wasn't hidden prior to the metrics.
FID: https://github.com/GoogleChrome/web-vitals/blob/main/src/onFID.ts#L59
LCP: https://github.com/GoogleChrome/web-vitals/blob/main/src/onLCP.ts#L63-L66

However, in case ActivationStart has a non-zero value like pre-render, LCP compare with the page hidden time after subtracting the activation time . Shouldn't we compare before substract?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions