lighthouse 13.0.3 → 13.1.0

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.
Files changed (46) hide show
  1. package/CONTRIBUTING.md +1 -1
  2. package/cli/test/smokehouse/__snapshots__/report-assert-test.js.snap +10 -10
  3. package/cli/test/smokehouse/config/exclusions.js +44 -0
  4. package/cli/test/smokehouse/frontends/smokehouse-bin.js +5 -4
  5. package/cli/test/smokehouse/lighthouse-runners/devtools-mcp.d.ts +14 -0
  6. package/cli/test/smokehouse/lighthouse-runners/devtools-mcp.js +141 -0
  7. package/core/audits/baseline.d.ts +25 -0
  8. package/core/audits/baseline.js +190 -0
  9. package/core/computed/document-urls.js +5 -2
  10. package/core/computed/main-resource.js +7 -3
  11. package/core/computed/network-analysis.js +4 -1
  12. package/core/config/default-config.js +2 -0
  13. package/core/gather/driver/wait-for-condition.js +11 -1
  14. package/core/gather/gatherers/trace.js +3 -0
  15. package/core/lib/baseline/web-features-metadata.json +3 -0
  16. package/core/lib/deprecations-strings.d.ts +169 -89
  17. package/core/lib/deprecations-strings.js +119 -24
  18. package/core/lib/navigation-error.js +11 -2
  19. package/core/lib/network-recorder.js +2 -1
  20. package/core/lib/network-request.js +1 -0
  21. package/core/scoring.d.ts +24 -0
  22. package/dist/report/bundle.esm.js +31 -3
  23. package/dist/report/flow.js +32 -4
  24. package/dist/report/standalone.js +32 -4
  25. package/package.json +11 -10
  26. package/report/assets/styles.css +28 -0
  27. package/report/renderer/components.js +1 -1
  28. package/report/renderer/details-renderer.d.ts +5 -0
  29. package/report/renderer/details-renderer.js +16 -0
  30. package/report/types/report-renderer.d.ts +1 -1
  31. package/report/types/report-result.d.ts +1 -1
  32. package/shared/localization/locales/en-US.json +12 -0
  33. package/shared/localization/locales/en-XL.json +12 -0
  34. package/tsconfig.json +2 -0
  35. package/types/artifacts.d.ts +33 -30
  36. package/types/audit.d.ts +1 -1
  37. package/types/config.d.ts +1 -1
  38. package/types/gatherer.d.ts +1 -1
  39. package/types/lhr/audit-details.d.ts +10 -4
  40. package/types/lhr/flow-result.d.ts +1 -1
  41. package/types/lhr/lhr.d.ts +1 -1
  42. package/types/lhr/treemap.d.ts +1 -1
  43. package/types/protocol.d.ts +1 -1
  44. package/types/puppeteer.d.ts +1 -1
  45. package/types/user-flow.d.ts +1 -1
  46. package/types/utility-types.d.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  // auto-generated by build/build-cdt-strings.js
2
2
  /* eslint-disable */
3
- // Copyright 2025 The Chromium Authors
3
+ // Copyright 2026 The Chromium Authors
4
4
  // Use of this source code is governed by a BSD-style license that can be
5
5
  // found in the LICENSE file.
6
6
 
@@ -8,6 +8,10 @@
8
8
 
9
9
 
10
10
  export const UIStrings = {
11
+ /**
12
+ * @description This warning occurs when the website uses Attribution Reporting.
13
+ */
14
+ AttributionReporting: "Attribution Reporting is deprecated and will be removed. See https://goo.gle/ps-status for details.",
11
15
  /**
12
16
  * @description We show this warning when 1) an 'authorization' header is attached to the request by scripts, 2) there is no 'authorization' in the 'access-control-allow-headers' header in the response, and 3) there is a wildcard symbol ('*') in the 'access-control-allow-header' header in the response. This is allowed now, but we're planning to reject such responses and require responses to have an 'access-control-allow-headers' containing 'authorization'.
13
17
  */
@@ -28,10 +32,6 @@ export const UIStrings = {
28
32
  * @description This warning occurs when the website attempts to invoke the deprecated `chrome.loadTimes().wasAlternateProtocolAvailable` API.
29
33
  */
30
34
  ChromeLoadTimesWasAlternateProtocolAvailable: "`chrome.loadTimes()` is deprecated, instead use standardized API: `nextHopProtocol` in Navigation Timing 2.",
31
- /**
32
- * @description This warning occurs when the browser attempts to store a cookie containing a banned character. Rather than the cookie string being truncated at the banned character, the entire cookie will be rejected now.
33
- */
34
- CookieWithTruncatingChar: "Cookies containing a `(0|r|n)` character will be rejected instead of truncated.",
35
35
  /**
36
36
  * @description This warning occurs when a frame accesses another frame's data after having set `document.domain` without having set the `Origin-Agent-Cluster` http header. This is a companion warning to `documentDomainSettingWithoutOriginAgentClusterHeader`, where that warning occurs when `document.domain` is set, and this warning occurs when an access has been made, based on that previous `document.domain` setting.
37
37
  */
@@ -56,6 +56,22 @@ export const UIStrings = {
56
56
  * @description Warning displayed to developers when a data: URL is assigned to SVGUseElement to let them know that the support is deprecated.
57
57
  */
58
58
  DataUrlInSvgUse: "Support for data: URLs in SVGUseElement is deprecated and it will be removed in the future.",
59
+ /**
60
+ * @description Warning displayed to developers when document.createEvent() is called with 'KeyboardEvents', which is a non-standard event interface that will be removed.
61
+ */
62
+ DocumentCreateEventKeyboardEvents: "document.createEvent('KeyboardEvents') is deprecated and will be removed. Use `new KeyboardEvent()` instead.",
63
+ /**
64
+ * @description Warning displayed to developers when document.createEvent() is called with 'TransitionEvent', which is a non-standard event interface that will be removed.
65
+ */
66
+ DocumentCreateEventTransitionEvent: "document.createEvent('TransitionEvent') is deprecated and will be removed. Use `new TransitionEvent()` instead.",
67
+ /**
68
+ * @description Translation is not needed, this will never be exposed in production code.
69
+ */
70
+ ExampleBrowserProcessDeprecation: "This is an example for showing the code required for a browser process reported deprecation.",
71
+ /**
72
+ * @description A deprecation warning shown in the DevTools Issues tab. It's shown when one of the Protected Audience APIs like `navigator.joinAdInterestGroup`, `navigator.getInterestGroupAdAuctionData` or `navigator.runAdAuction` are called.
73
+ */
74
+ Fledge: "The Protected Audience API is deprecated and will be removed in a future release.",
59
75
  /**
60
76
  * @description Warning displayed to developers when the Geolocation API is used from an insecure origin (one that isn't localhost or doesn't use HTTPS) to notify them that this use is no longer supported.
61
77
  */
@@ -89,17 +105,37 @@ export const UIStrings = {
89
105
  */
90
106
  IntlV8BreakIterator: "`Intl.v8BreakIterator` is deprecated. Please use `Intl.Segmenter` instead.",
91
107
  /**
92
- * @description This warning occurs when a stylesheet loaded from a local file directive does not end in the file type `.css`.
108
+ * @description Warning for using deprecated 'inputQuota' attribute.
93
109
  */
94
- LocalCSSFileExtensionRejected: "CSS cannot be loaded from `file:` URLs unless they end in a `.css` file extension.",
110
+ LanguageModel_InputQuota: "LanguageModel.inputQuota is deprecated. Please use LanguageModel.contextWindow instead. This alias is only available in extensions.",
95
111
  /**
96
- * @description This is a deprecation warning to developers that occurs when the script attempts to use the Media Source Extensions API in a way that is no longer supported by the specification for the API. The usage that is problematic is when the script calls the `SourceBuffer.abort()` method at a time when there is still processing happening in response to a previous `SourceBuffer.remove()` call for the same SourceBuffer object. More precisely, we show this warning to developers when script calls the SourceBuffer abort() method while the asynchronous processing of a remove() call on that SourceBuffer is not yet complete. Early versions of the Media Source Extensions specification allowed such aborts, but standardization of the specification resulted in disallowing the aborts. The script should instead wait for the asynchronous remove() operation to complete, which is observable by listening for the associated 'updateend' event from the SourceBuffer. A note is also included in the warning, describing when abort() is meaningful and allowed by the specification for purposes other than interrupting a remove() operation's asynchronous steps. Those supported purposes include using abort() to interrupt processing that may still be happening in response to a previous appendBuffer() call on that SourceBuffer, or using abort() to clear the internal of any unprocessed data remaining from previous appendBuffer() calls. See https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-abort for the currently specified behavior, which would throw an exception once the deprecated removal abort is no longer supported. See https://github.com/w3c/media-source/issues/19 for the discussion that led to the specification change.
112
+ * @description Warning for using deprecated 'inputUsage' attribute.
97
113
  */
98
- MediaSourceAbortRemove: "Using `SourceBuffer.abort()` to abort `remove()`'s asynchronous range removal is deprecated due to specification change. Support will be removed in the future. You should listen to the `updateend` event instead. `abort()` is intended to only abort an asynchronous media append or reset parser state.",
114
+ LanguageModel_InputUsage: "LanguageModel.inputUsage is deprecated. Please use LanguageModel.contextUsage instead. This alias is only available in extensions.",
99
115
  /**
100
- * @description This is a deprecation warning to developers that occurs when the script attempts to use the Media Source Extensions API in a way that is no longer supported by the specification for the API. The usage that is problematic is when the script sets the duration attribute of a MediaSource object too low. The duration attribute of a MediaSource must be longer than the actual duration of any media (audio or video) already in the MediaSource. When set too low, the MediaSource must remove audio and video content that is beyond the time indicated by the new duration. Content removal that is caused by setting the duration attribute too low is no longer allowed by the specification. The message describes the minimum allowable duration value as the 'highest presentation timestamp of any buffered coded frames' as a more precise way of describing the duration of content already in the MediaSource: 'coded frames' are the specification's way of describing compressed audio frames or compressed video frames, and they each have a 'presentation timestamp' that describes precisely when that frame's playback occurs in the overall media presentation. Early versions of the Media Source Extensions specification allowed this to happen, but standardization of the specification resulted in disallowing this behavior. The underlying issue leading to this specification change was that setting the duration attribute should be synchronous, but setting it lower than the timestamp of something currently buffered would cause confusing removal of media between that new duration and the previous, larger, duration. The script should instead explicitly remove that range of media first, before lowering the duration. See https://www.w3.org/TR/media-source-2/#dom-mediasource-duration and https://www.w3.org/TR/media-source-2/#dom-mediasource-duration for the currently specified behavior, which would throw an exception once support is removed for deprecated implicit asynchronous range removal when duration is truncated. See both https://github.com/w3c/media-source/issues/20 and https://github.com/w3c/media-source/issues/26 for the discussion that led to the specification change.
116
+ * @description Warning for using deprecated 'measureInputUsage' method.
101
117
  */
102
- MediaSourceDurationTruncatingBuffered: "Setting `MediaSource.duration` below the highest presentation timestamp of any buffered coded frames is deprecated due to specification change. Support for implicit removal of truncated buffered media will be removed in the future. You should instead perform explicit `remove(newDuration, oldDuration)` on all `sourceBuffers`, where `newDuration < oldDuration`.",
118
+ LanguageModel_MeasureInputUsage: "LanguageModel.measureInputUsage() is deprecated. Please use LanguageModel.measureContextUsage() instead. This alias is only available in extensions.",
119
+ /**
120
+ * @description Warning for using deprecated 'onquotaoverflow' event handler.
121
+ */
122
+ LanguageModel_OnQuotaOverflow: "LanguageModel.onquotaoverflow is deprecated. Please use LanguageModel.oncontextoverflow instead. The LanguageModel.onquotaoverflow alias is only available in extensions.",
123
+ /**
124
+ * @description Warning message for web developers when they call the deprecated LanguageModel.params() method.
125
+ */
126
+ LanguageModelParams: "LanguageModel.params() is deprecated and now only available in extension contexts. The topK and temperature related fields within its result are also deprecated.",
127
+ /**
128
+ * @description Warning message for web developers when they use the deprecated 'temperature' option in LanguageModel.create() or access the .temperature attribute.
129
+ */
130
+ LanguageModelTemperature: "The 'temperature' parameter/attribute for LanguageModel is deprecated. It is only functional within extensions and may be removed in the future.",
131
+ /**
132
+ * @description Warning message for web developers when they use the deprecated 'topK' option in LanguageModel.create() or access the .topK attribute.
133
+ */
134
+ LanguageModelTopK: "The 'topK' parameter/attribute for LanguageModel is deprecated. It is only functional within extensions and may be removed in the future.",
135
+ /**
136
+ * @description This warning occurs when a stylesheet loaded from a local file directive does not end in the file type `.css`.
137
+ */
138
+ LocalCSSFileExtensionRejected: "CSS cannot be loaded from `file:` URLs unless they end in a `.css` file extension.",
103
139
  /**
104
140
  * @description This warning occurs when the browser requests Web MIDI access as sysex (system exclusive messages) can be allowed via prompt even if the browser did not specifically request it.
105
141
  */
@@ -176,14 +212,14 @@ export const UIStrings = {
176
212
  * @description Standard message when one web API is deprecated in favor of another.
177
213
  */
178
214
  PrefixedVideoSupportsFullscreen: "HTMLVideoElement.webkitSupportsFullscreen is deprecated. Please use Document.fullscreenEnabled instead.",
179
- /**
180
- * @description Warning displayed to developers that the API `chrome.privacy.websites.privacySandboxEnabled` is being deprecated in favour of three new more granular APIs: topicsEnabled, FledgeEnabled and adMeasurementEnabled. The `privacySandboxEnabled` API allowed extensions to control the homologous Chrome Setting. The existing Chrome Setting for Privacy Sandbox is also going away in favor of more granular settings that are matched by the new extensions APIs- topicsEnabled, FledgeEnabled and adMeasurementEnabled.
181
- */
182
- PrivacySandboxExtensionsAPI: "We're deprecating the API `chrome.privacy.websites.privacySandboxEnabled`, though it will remain active for backward compatibility until release M113. Instead, please use `chrome.privacy.websites.topicsEnabled`, `chrome.privacy.websites.fledgeEnabled` and `chrome.privacy.websites.adMeasurementEnabled`. See https://developer.chrome.com/docs/extensions/reference/privacy/#property-websites-privacySandboxEnabled.",
183
215
  /**
184
216
  * @description Standard message when one web API is deprecated in favor of another.
185
217
  */
186
218
  RangeExpand: "Range.expand() is deprecated. Please use Selection.modify() instead.",
219
+ /**
220
+ * @description A deprecation warning shown in the DevTools Issues tab. It's shown when the Storage Access API is automatically granted by Related Website Sets. The placeholder will always be the string `Related Website Sets`.
221
+ */
222
+ RelatedWebsiteSets: "`Related Website Sets` is deprecated and will be removed. See https://privacysandbox.com/news/update-on-plans-for-privacy-sandbox-technologies/ for more details.",
187
223
  /**
188
224
  * @description This warning occurs when a subresource loaded by a page has a URL with an authority portion. These are disallowed.
189
225
  */
@@ -208,10 +244,22 @@ export const UIStrings = {
208
244
  * @description A deprecation warning shown in the DevTools Issues tab. The placeholder is always the noun 'SharedArrayBuffer' which refers to a JavaScript construct.
209
245
  */
210
246
  SharedArrayBufferConstructedWithoutIsolation: "`SharedArrayBuffer` will require cross-origin isolation. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details.",
247
+ /**
248
+ * @description A deprecation warning shown in the DevTools Issues tab. It's shown when one of the Shared Storage APIs like `sharedStorage.set()`, `sharedStorage.worklet.addModule()`, `sharedStorage.selectURL()`, etc., along with `<img sharedstoragewritable>`, `<iframe sharedstoragewritable>`, or `fetch(url, {sharedStorageWritable: true})` are used.
249
+ */
250
+ SharedStorage: "The Shared Storage API is deprecated and will be removed in a future release.",
251
+ /**
252
+ * @description A deprecation warning shown in the DevTools Issues tab. It's shown when the `document.requestStorageAccessFor` API is called. The placeholder will always be the string `document.requestStorageAccessFor`.
253
+ */
254
+ StorageAccessAPI_requestStorageAccessFor_Method: "`document.requestStorageAccessFor` is deprecated and will be removed. See https://privacysandbox.com/news/update-on-plans-for-privacy-sandbox-technologies/ for more details.",
211
255
  /**
212
256
  * @description A deprecation warning shown in the DevTools Issues tab. It's shown when the speech synthesis API is called before the page receives a user activation.
213
257
  */
214
258
  TextToSpeech_DisallowedByAutoplay: "`speechSynthesis.speak()` without user activation is deprecated and will be removed.",
259
+ /**
260
+ * @description A deprecation warning shown in the DevTools Issues tab. It's shown when one of the Topics APIs like `document.browsingTopics()`, `<img browsingtopics>`, `<iframe browsingtopics>`, or `fetch(url, {browsingTopics: true})` are used.
261
+ */
262
+ Topics: "The Topics API is deprecated and will be removed in a future release.",
215
263
  /**
216
264
  * @description A deprecation warning shown in the DevTools Issues tab. It's shown when a listener for the `unload` event is added.
217
265
  */
@@ -220,6 +268,10 @@ export const UIStrings = {
220
268
  * @description A deprecation warning shown in the DevTools Issues tab. The placeholder is always the noun 'SharedArrayBuffer' which refers to a JavaScript construct. 'Extensions' refers to Chrome extensions. The warning is shown when Chrome Extensions attempt to use 'SharedArrayBuffer's under insecure circumstances.
221
269
  */
222
270
  V8SharedArrayBufferConstructedInExtensionWithoutIsolation: "Extensions should opt into cross-origin isolation to continue using `SharedArrayBuffer`. See https://developer.chrome.com/docs/extensions/mv3/cross-origin-isolation/.",
271
+ /**
272
+ * @description This warning occurs when the deprecated `BluetoothRemoteGATTCharacteristic.writeValue()` method is used. Developers should use `writeValueWithResponse()` or `writeValueWithoutResponse()` instead.
273
+ */
274
+ WebBluetoothRemoteCharacteristicWriteValue: "`BluetoothRemoteGATTCharacteristic.writeValue()` is deprecated. Use `writeValueWithResponse()` or `writeValueWithoutResponse()` instead.",
223
275
  /**
224
276
  * @description Warning displayed to developers that they are using `XMLHttpRequest` API in a way that they expect an unsupported character encoding `UTF-16` could be used in the server reply.
225
277
  */
@@ -228,6 +280,10 @@ export const UIStrings = {
228
280
  * @description Warning displayed to developers. It is shown when the `XMLHttpRequest` API is used in a way that it slows down the page load of the next page. The `main thread` refers to an operating systems thread used to run most of the processing of HTML documents, so please use a consistent wording.
229
281
  */
230
282
  XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload: "Synchronous `XMLHttpRequest` on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.",
283
+ /**
284
+ * @description Warning displayed to developers that they are using either the XSLTProcessor API, or XSLT processing instructions, both of which have been deprecated and are scheduled to be removed.
285
+ */
286
+ XSLT: "XSLTProcessor and XSLT Processing Instructions have been deprecated by all browsers. These features will be removed from this browser soon.",
231
287
  };
232
288
 
233
289
 
@@ -235,6 +291,9 @@ export const UIStrings = {
235
291
 
236
292
 
237
293
  export const DEPRECATIONS_METADATA = {
294
+ "AttributionReporting": {
295
+ "chromeStatusFeature": 6320639375966208
296
+ },
238
297
  "AuthorizationCoveredByWildcard": {
239
298
  "milestone": 97
240
299
  },
@@ -256,9 +315,6 @@ export const DEPRECATIONS_METADATA = {
256
315
  "ChromeLoadTimesWasAlternateProtocolAvailable": {
257
316
  "chromeStatusFeature": 5637885046816768
258
317
  },
259
- "CookieWithTruncatingChar": {
260
- "milestone": 103
261
- },
262
318
  "CrossOriginAccessBasedOnDocumentDomain": {
263
319
  "milestone": 115
264
320
  },
@@ -266,6 +322,14 @@ export const DEPRECATIONS_METADATA = {
266
322
  "chromeStatusFeature": 5128825141198848,
267
323
  "milestone": 119
268
324
  },
325
+ "DocumentCreateEventKeyboardEvents": {
326
+ "chromeStatusFeature": 5095987863486464,
327
+ "milestone": 151
328
+ },
329
+ "DocumentCreateEventTransitionEvent": {
330
+ "chromeStatusFeature": 5095987863486464,
331
+ "milestone": 151
332
+ },
269
333
  "IdentityInCanMakePaymentEvent": {
270
334
  "chromeStatusFeature": 5190978431352832
271
335
  },
@@ -273,14 +337,29 @@ export const DEPRECATIONS_METADATA = {
273
337
  "chromeStatusFeature": 5436853517811712,
274
338
  "milestone": 92
275
339
  },
276
- "LocalCSSFileExtensionRejected": {
277
- "milestone": 64
340
+ "LanguageModelParams": {
341
+ "chromeStatusFeature": 5134603979063296
342
+ },
343
+ "LanguageModelTemperature": {
344
+ "chromeStatusFeature": 5134603979063296
345
+ },
346
+ "LanguageModelTopK": {
347
+ "chromeStatusFeature": 5134603979063296
348
+ },
349
+ "LanguageModel_InputQuota": {
350
+ "chromeStatusFeature": 5134603979063296
351
+ },
352
+ "LanguageModel_InputUsage": {
353
+ "chromeStatusFeature": 5134603979063296
354
+ },
355
+ "LanguageModel_MeasureInputUsage": {
356
+ "chromeStatusFeature": 5134603979063296
278
357
  },
279
- "MediaSourceAbortRemove": {
280
- "chromeStatusFeature": 6107495151960064
358
+ "LanguageModel_OnQuotaOverflow": {
359
+ "chromeStatusFeature": 5134603979063296
281
360
  },
282
- "MediaSourceDurationTruncatingBuffered": {
283
- "chromeStatusFeature": 6107495151960064
361
+ "LocalCSSFileExtensionRejected": {
362
+ "milestone": 64
284
363
  },
285
364
  "NoSysexWebMIDIWithoutPermission": {
286
365
  "chromeStatusFeature": 5138066234671104,
@@ -322,6 +401,9 @@ export const DEPRECATIONS_METADATA = {
322
401
  "chromeStatusFeature": 4631626228695040,
323
402
  "milestone": 117
324
403
  },
404
+ "RelatedWebsiteSets": {
405
+ "chromeStatusFeature": 5194473869017088
406
+ },
325
407
  "RequestedSubresourceWithEmbeddedCredentials": {
326
408
  "chromeStatusFeature": 5669008342777856
327
409
  },
@@ -332,6 +414,12 @@ export const DEPRECATIONS_METADATA = {
332
414
  "SharedArrayBufferConstructedWithoutIsolation": {
333
415
  "milestone": 106
334
416
  },
417
+ "SharedStorage": {
418
+ "chromeStatusFeature": 5076349064708096
419
+ },
420
+ "StorageAccessAPI_requestStorageAccessFor_Method": {
421
+ "chromeStatusFeature": 5162221567082496
422
+ },
335
423
  "TextToSpeech_DisallowedByAutoplay": {
336
424
  "chromeStatusFeature": 5687444770914304,
337
425
  "milestone": 71
@@ -342,7 +430,14 @@ export const DEPRECATIONS_METADATA = {
342
430
  "V8SharedArrayBufferConstructedInExtensionWithoutIsolation": {
343
431
  "milestone": 96
344
432
  },
433
+ "WebBluetoothRemoteCharacteristicWriteValue": {
434
+ "chromeStatusFeature": 5088568590598144
435
+ },
345
436
  "XHRJSONEncodingDetection": {
346
437
  "milestone": 93
438
+ },
439
+ "XSLT": {
440
+ "chromeStatusFeature": 4709671889534976,
441
+ "milestone": 143
347
442
  }
348
443
  };
@@ -130,8 +130,12 @@ function getNonHtmlError(finalRecord) {
130
130
  */
131
131
  function getPageLoadError(navigationError, context) {
132
132
  const {url, networkRecords} = context;
133
- /** @type {LH.Artifacts.NetworkRequest|undefined} */
134
- let mainRecord = Lantern.Core.NetworkAnalyzer.findResourceForUrl(networkRecords, url);
133
+ const mainRecordLantern = Lantern.Core.NetworkAnalyzer.findResourceForUrl(
134
+ // @ts-expect-error - trace engine types for InitiatorType are outdated
135
+ networkRecords,
136
+ url
137
+ );
138
+ let mainRecord = mainRecordLantern;
135
139
 
136
140
  // If the url doesn't give us a network request, it's possible we landed on a chrome-error:// page
137
141
  // In this case, just get the first document request.
@@ -140,6 +144,7 @@ function getPageLoadError(navigationError, context) {
140
144
  record.resourceType === NetworkRequest.TYPES.Document
141
145
  );
142
146
  if (documentRequests.length) {
147
+ // @ts-expect-error - mainRecord is inferred as a Lantern request from findResourceForUrl, but we assign a raw record here.
143
148
  mainRecord = documentRequests.reduce((min, r) => {
144
149
  return r.networkRequestTime < min.networkRequestTime ? r : min;
145
150
  });
@@ -159,8 +164,12 @@ function getPageLoadError(navigationError, context) {
159
164
  context.warnings.push(str_(UIStrings.warningXhtml));
160
165
  }
161
166
 
167
+ // @ts-expect-error - mainRecord may be typed as a Lantern request, but functions expect a raw record.
162
168
  const networkError = getNetworkError(mainRecord, context);
169
+ // @ts-expect-error - mainRecord may be typed as a Lantern request, but functions expect a raw record.
163
170
  const interstitialError = getInterstitialError(mainRecord, networkRecords);
171
+ // @ts-expect-error - finalRecord may be a Lantern request, which is compatible enough
172
+ // for getNonHtmlError.
164
173
  const nonHtmlError = getNonHtmlError(finalRecord);
165
174
 
166
175
  // We want to special-case the interstitial beyond FAILED_DOCUMENT_REQUEST. See https://github.com/GoogleChrome/lighthouse/pull/8865#issuecomment-497507618
@@ -253,7 +253,8 @@ class NetworkRecorder extends RequestEventEmitter {
253
253
  return record.redirectSource;
254
254
  }
255
255
 
256
- const initiatorURL = Lantern.Graph.PageDependencyGraph.getNetworkInitiators(record)[0];
256
+ const lanternReq = NetworkRequest.asLanternNetworkRequest(record);
257
+ const initiatorURL = Lantern.Graph.PageDependencyGraph.getNetworkInitiators(lanternReq)[0];
257
258
  let candidates = recordsByURL.get(initiatorURL) || [];
258
259
  // The (valid) initiator must come before the initiated request.
259
260
  candidates = candidates.filter(c => {
@@ -592,6 +592,7 @@ class NetworkRequest {
592
592
 
593
593
  record.fromWorker = record.sessionTargetType === 'worker';
594
594
 
595
+ // @ts-expect-error - trace engine types for InitiatorType are outdated
595
596
  return {
596
597
  rawRequest: record,
597
598
  ...record,
package/core/scoring.d.ts CHANGED
@@ -202,6 +202,10 @@ export class ReportScoring {
202
202
  type: "numeric";
203
203
  value: number;
204
204
  granularity?: number | undefined;
205
+ } | {
206
+ type: "baseline-status";
207
+ status: string | import("./index.js").IcuMessage;
208
+ displayString: import("./index.js").IcuMessage | string;
205
209
  } | undefined;
206
210
  debugData?: {
207
211
  [x: string]: any;
@@ -346,6 +350,10 @@ export class ReportScoring {
346
350
  type: "numeric";
347
351
  value: number;
348
352
  granularity?: number | undefined;
353
+ } | {
354
+ type: "baseline-status";
355
+ status: string | import("./index.js").IcuMessage;
356
+ displayString: import("./index.js").IcuMessage | string;
349
357
  } | undefined;
350
358
  debugData?: {
351
359
  [x: string]: any;
@@ -481,6 +489,10 @@ export class ReportScoring {
481
489
  type: "numeric";
482
490
  value: number;
483
491
  granularity?: number | undefined;
492
+ } | {
493
+ type: "baseline-status";
494
+ status: string | import("./index.js").IcuMessage;
495
+ displayString: import("./index.js").IcuMessage | string;
484
496
  } | undefined;
485
497
  debugData?: {
486
498
  [x: string]: any;
@@ -514,6 +526,10 @@ export class ReportScoring {
514
526
  type: "numeric";
515
527
  value: number;
516
528
  granularity?: number | undefined;
529
+ } | {
530
+ type: "baseline-status";
531
+ status: string | import("./index.js").IcuMessage;
532
+ displayString: import("./index.js").IcuMessage | string;
517
533
  } | undefined;
518
534
  url: string | import("./index.js").IcuMessage;
519
535
  wastedBytes?: number | undefined;
@@ -574,6 +590,10 @@ export class ReportScoring {
574
590
  type: "numeric";
575
591
  value: number;
576
592
  granularity?: number | undefined;
593
+ } | {
594
+ type: "baseline-status";
595
+ status: string | import("./index.js").IcuMessage;
596
+ displayString: import("./index.js").IcuMessage | string;
577
597
  } | undefined;
578
598
  debugData?: {
579
599
  [x: string]: any;
@@ -680,6 +700,10 @@ export class ReportScoring {
680
700
  type: "numeric";
681
701
  value: number;
682
702
  granularity?: number | undefined;
703
+ } | {
704
+ type: "baseline-status";
705
+ status: string | import("./index.js").IcuMessage;
706
+ displayString: import("./index.js").IcuMessage | string;
683
707
  } | undefined;
684
708
  debugData?: {
685
709
  [x: string]: any;