Skip to content

Commit

Permalink
long
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine committed Apr 12, 2022
1 parent 9b14255 commit 00b5521
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lighthouse-core/lib/tracehouse/trace-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ class TraceProcessor {
* Returns true if the event is a navigation start event of a document whose URL seems valid.
*
* @param {LH.TraceEvent} event
* @return {boolean}
*/
static _isNavigationStartOfInterest(event) {
return event.name === 'navigationStart' &&
event.args.data?.documentLoaderURL &&
ACCEPTABLE_NAVIGATION_URL_REGEX.test(event.args.data.documentLoaderURL);
if (event.name !== 'navigationStart') return false;
if (!event.args.data?.documentLoaderURL) return false;
return ACCEPTABLE_NAVIGATION_URL_REGEX.test(event.args.data.documentLoaderURL);
}

/**
Expand Down

0 comments on commit 00b5521

Please sign in to comment.