Skip to content

Commit

Permalink
Merge pull request #2457 from pmeenan/lcp
Browse files Browse the repository at this point in the history
Add support to LCP vitals page for "url" based LCP images
  • Loading branch information
scottjehl authored Oct 14, 2022
2 parents 7696881 + 80bf71d commit 2e45b97
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions www/vitals.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ function InsertWebVitalsHTML_LCP($stepResult)
} elseif (isset($lcp['element']['src']) || isset($lcp['element']['currentSrc'])) {
$lcpSource = isset($lcp['element']['currentSrc']) ? $lcp['element']['currentSrc'] : $lcp['element']['src'];
echo "<tr><th align='left'>Src</th><td>{$lcpSource}</td></tr>";
} elseif (!empty($lcp['url'])) {
$lcpSource = $lcp['url'];
echo "<tr><th align='left'>Url</th><td>{$lcpSource}</td></tr>";
}
if (isset($lcp['element']['background-image'])) {
echo "<tr><th align='left'>Background Image</th><td>{$lcp['element']['background-image']}</td></tr>";
Expand Down

0 comments on commit 2e45b97

Please sign in to comment.