Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: fix for page reload #14518

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,9 @@ class NetworkAnalyzer {
// Try to find an exact match with the final URL first if we have one
if (finalURL) {
// equalWithExcludedFragments is expensive, so check that the finalUrl starts with the request first
const mainResource = records.find(request => finalURL.startsWith(request.url) &&
const mainResources = records.filter(request => finalURL.startsWith(request.url) &&
URL.equalWithExcludedFragments(request.url, finalURL));
if (mainResource) return mainResource;
if (mainResources.length > 0) return mainResources[mainResources.length - 1];
// TODO: beacon !mainResource to Sentry, https://github.com/GoogleChrome/lighthouse/issues/7041
}

Expand Down