GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28.05k stars 9.32k forks source link

core(css-usage): prevent late stylesheet additions #15865

Closed adamraine closed 4 months ago

adamraine commented 4 months ago

Fixes CSS issue in https://github.com/GoogleChrome/lighthouse/issues/15864, still need to look into the JS files

If there is enough of a gap between the end of the page load and CSSUsage.getArtifact, stylesheets that were added late in the page lifecycle can show up without a matching network request. This PR changes the behavior of CSSUsage to stop collecting new stylesheets immediately once the navigation ends.