Skip to content

Add browser example to identify DOM element for LCP metric #1943

Open
@heitortsergent

Description

@heitortsergent

The browser module shows Web Vital metrics by default, but it doesn't let the user see which DOM element is responsible for the Largest Contentful Paint / First Contentful Paint metrics, which can be useful for debugging purposes.

One way to see that information is to use the web-vitals library via the addInitScript function, and use the libraries functions to find the largest element.

We can add an example of how to do that to both the addInitScript function page and the Using k6 browser section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: OSS ContentImprovements or additions to community/oss documentationArea: browserThe browser moduleexamplesIssues about a missing exampletype/docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions