How to get DomContentload, Onload metric using puppeeter&lighthouse? #13796
-
Hello, I want to get a DomContentload, Onload data when I go into web page. I used a example code(below).
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The values are not displayed in the report, however they are stored under the hidden const metrics = lhr.audits['metrics'].details.items[0];
const onload = metrics.observedLoad;
const dcl = metrics.observedDomContentLoaded; It should be noted that these values are not throttled by default and will not line up with the other Lighthouse metrics. If you need to get the throttled DCL and onload events, turn on DevTools throttling via the config: const config = {
extends: 'lighthouse:default',
settings: {
throttlingMethod: 'devtools',
}
} For more on throttling: https://github.com/GoogleChrome/lighthouse/blob/master/docs/throttling.md. |
Beta Was this translation helpful? Give feedback.
The values are not displayed in the report, however they are stored under the hidden
metrics
audit:It should be noted that these values are not throttled by default and will not line up with the other Lighthouse metrics. If you need to get the throttled DCL and onload events, turn on DevTools throttling via the config:
For more on throttling: https://github.com/GoogleChrome/lighthouse/blob/master/docs/throttling.md.