lighthouse 9.5.0-dev.20220413 → 9.5.0-dev.20220414
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -82,11 +82,15 @@ class TraceProcessor {
|
|
|
82
82
|
* Returns true if the event is a navigation start event of a document whose URL seems valid.
|
|
83
83
|
*
|
|
84
84
|
* @param {LH.TraceEvent} event
|
|
85
|
+
* @return {boolean}
|
|
85
86
|
*/
|
|
86
87
|
static _isNavigationStartOfInterest(event) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
if (event.name !== 'navigationStart') return false;
|
|
89
|
+
// COMPAT: support pre-m67 test traces before `args.data` added to all navStart events.
|
|
90
|
+
// TODO: remove next line when old test traces (e.g. progressive-app-m60.json) are updated.
|
|
91
|
+
if (event.args.data?.documentLoaderURL === undefined) return true;
|
|
92
|
+
if (!event.args.data?.documentLoaderURL) return false;
|
|
93
|
+
return ACCEPTABLE_NAVIGATION_URL_REGEX.test(event.args.data.documentLoaderURL);
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
/**
|
|
@@ -462,8 +466,9 @@ class TraceProcessor {
|
|
|
462
466
|
// If we can't find either TracingStarted event, then we'll fallback to the first navStart that
|
|
463
467
|
// looks like it was loading the main frame with a real URL. Because the schema for this event
|
|
464
468
|
// has changed across Chrome versions, we'll be extra defensive about finding this case.
|
|
465
|
-
const navStartEvt = events.find(e =>
|
|
466
|
-
e
|
|
469
|
+
const navStartEvt = events.find(e =>
|
|
470
|
+
this._isNavigationStartOfInterest(e) && e.args.data?.isLoadingMainFrame
|
|
471
|
+
);
|
|
467
472
|
// Find the first resource that was requested and make sure it agrees on the id.
|
|
468
473
|
const firstResourceSendEvt = events.find(e => e.name === 'ResourceSendRequest');
|
|
469
474
|
// We know that these properties exist if we found the events, but TSC doesn't.
|
package/package.json
CHANGED