lighthouse 12.8.2-dev.20251005 → 12.8.2-dev.20251007

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 (142) hide show
  1. package/cli/test/smokehouse/config/exclusions.js +0 -2
  2. package/core/audits/audit.js +0 -1
  3. package/core/audits/insights/cls-culprits-insight.js +1 -1
  4. package/core/audits/insights/dom-size-insight.js +11 -7
  5. package/core/audits/insights/insight-audit.d.ts +4 -2
  6. package/core/audits/insights/insight-audit.js +22 -3
  7. package/core/audits/predictive-perf.js +2 -2
  8. package/core/audits/seo/crawlable-anchors.js +2 -3
  9. package/core/audits/server-response-time.d.ts +0 -5
  10. package/core/audits/server-response-time.js +12 -26
  11. package/core/computed/metrics/lcp-breakdown.d.ts +10 -5
  12. package/core/computed/metrics/lcp-breakdown.js +50 -22
  13. package/core/computed/metrics/time-to-first-byte.js +33 -10
  14. package/core/computed/metrics/timing-summary.js +3 -2
  15. package/core/config/default-config.js +20 -63
  16. package/core/config/experimental-config.js +1 -26
  17. package/core/config/filters.js +6 -9
  18. package/core/config/lr-desktop-config.js +0 -1
  19. package/core/config/lr-mobile-config.js +0 -1
  20. package/core/gather/gatherers/anchor-elements.js +8 -24
  21. package/core/gather/gatherers/inspector-issues.js +1 -28
  22. package/core/gather/gatherers/trace-elements.d.ts +0 -9
  23. package/core/gather/gatherers/trace-elements.js +0 -35
  24. package/core/lib/network-request.d.ts +0 -7
  25. package/core/lib/network-request.js +0 -16
  26. package/core/lib/proto-preprocessor.js +5 -22
  27. package/dist/report/bundle.esm.js +10 -49
  28. package/dist/report/flow.js +12 -51
  29. package/dist/report/standalone.js +11 -50
  30. package/flow-report/src/i18n/i18n.d.ts +4 -6
  31. package/package.json +4 -5
  32. package/report/assets/styles.css +0 -39
  33. package/report/renderer/api.js +0 -1
  34. package/report/renderer/category-renderer.js +6 -0
  35. package/report/renderer/components.js +1 -1
  36. package/report/renderer/dom.d.ts +0 -13
  37. package/report/renderer/dom.js +0 -38
  38. package/report/renderer/performance-category-renderer.d.ts +0 -26
  39. package/report/renderer/performance-category-renderer.js +10 -142
  40. package/report/renderer/report-ui-features.d.ts +0 -1
  41. package/report/renderer/report-ui-features.js +3 -13
  42. package/report/renderer/report-utils.d.ts +2 -3
  43. package/report/renderer/report-utils.js +4 -6
  44. package/report/types/report-renderer.d.ts +0 -6
  45. package/shared/localization/locales/ar-XB.json +20 -341
  46. package/shared/localization/locales/ar.json +20 -341
  47. package/shared/localization/locales/bg.json +9 -330
  48. package/shared/localization/locales/ca.json +9 -330
  49. package/shared/localization/locales/cs.json +9 -330
  50. package/shared/localization/locales/da.json +9 -330
  51. package/shared/localization/locales/de.json +9 -330
  52. package/shared/localization/locales/el.json +9 -330
  53. package/shared/localization/locales/en-GB.json +9 -330
  54. package/shared/localization/locales/en-US.json +44 -293
  55. package/shared/localization/locales/en-XA.json +0 -330
  56. package/shared/localization/locales/en-XL.json +44 -293
  57. package/shared/localization/locales/es-419.json +9 -330
  58. package/shared/localization/locales/es.json +9 -330
  59. package/shared/localization/locales/fi.json +9 -330
  60. package/shared/localization/locales/fil.json +9 -330
  61. package/shared/localization/locales/fr.json +9 -330
  62. package/shared/localization/locales/he.json +31 -352
  63. package/shared/localization/locales/hi.json +9 -330
  64. package/shared/localization/locales/hr.json +9 -330
  65. package/shared/localization/locales/hu.json +9 -330
  66. package/shared/localization/locales/id.json +9 -330
  67. package/shared/localization/locales/it.json +9 -330
  68. package/shared/localization/locales/ja.json +9 -330
  69. package/shared/localization/locales/ko.json +10 -331
  70. package/shared/localization/locales/lt.json +9 -330
  71. package/shared/localization/locales/lv.json +10 -331
  72. package/shared/localization/locales/nl.json +9 -330
  73. package/shared/localization/locales/no.json +9 -330
  74. package/shared/localization/locales/pl.json +9 -330
  75. package/shared/localization/locales/pt-PT.json +9 -330
  76. package/shared/localization/locales/pt.json +9 -330
  77. package/shared/localization/locales/ro.json +10 -331
  78. package/shared/localization/locales/ru.json +9 -330
  79. package/shared/localization/locales/sk.json +9 -330
  80. package/shared/localization/locales/sl.json +9 -330
  81. package/shared/localization/locales/sr-Latn.json +9 -330
  82. package/shared/localization/locales/sr.json +9 -330
  83. package/shared/localization/locales/sv.json +9 -330
  84. package/shared/localization/locales/ta.json +9 -330
  85. package/shared/localization/locales/te.json +10 -331
  86. package/shared/localization/locales/th.json +9 -330
  87. package/shared/localization/locales/tr.json +9 -330
  88. package/shared/localization/locales/uk.json +9 -330
  89. package/shared/localization/locales/vi.json +9 -330
  90. package/shared/localization/locales/zh-HK.json +9 -330
  91. package/shared/localization/locales/zh-TW.json +10 -331
  92. package/shared/localization/locales/zh.json +9 -330
  93. package/types/artifacts.d.ts +5 -6
  94. package/types/audit.d.ts +1 -1
  95. package/types/lhr/settings.d.ts +1 -1
  96. package/core/audits/byte-efficiency/duplicated-javascript.d.ts +0 -45
  97. package/core/audits/byte-efficiency/duplicated-javascript.js +0 -223
  98. package/core/audits/byte-efficiency/efficient-animated-content.d.ts +0 -22
  99. package/core/audits/byte-efficiency/efficient-animated-content.js +0 -93
  100. package/core/audits/byte-efficiency/legacy-javascript.d.ts +0 -28
  101. package/core/audits/byte-efficiency/legacy-javascript.js +0 -144
  102. package/core/audits/byte-efficiency/modern-image-formats.d.ts +0 -38
  103. package/core/audits/byte-efficiency/modern-image-formats.js +0 -187
  104. package/core/audits/byte-efficiency/render-blocking-resources.d.ts +0 -53
  105. package/core/audits/byte-efficiency/render-blocking-resources.js +0 -312
  106. package/core/audits/byte-efficiency/uses-long-cache-ttl.d.ts +0 -59
  107. package/core/audits/byte-efficiency/uses-long-cache-ttl.js +0 -293
  108. package/core/audits/byte-efficiency/uses-optimized-images.d.ts +0 -33
  109. package/core/audits/byte-efficiency/uses-optimized-images.js +0 -146
  110. package/core/audits/byte-efficiency/uses-responsive-images-snapshot.d.ts +0 -16
  111. package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +0 -106
  112. package/core/audits/byte-efficiency/uses-responsive-images.d.ts +0 -44
  113. package/core/audits/byte-efficiency/uses-responsive-images.js +0 -202
  114. package/core/audits/byte-efficiency/uses-text-compression.d.ts +0 -14
  115. package/core/audits/byte-efficiency/uses-text-compression.js +0 -108
  116. package/core/audits/critical-request-chains.d.ts +0 -44
  117. package/core/audits/critical-request-chains.js +0 -221
  118. package/core/audits/dobetterweb/dom-size.d.ts +0 -32
  119. package/core/audits/dobetterweb/dom-size.js +0 -182
  120. package/core/audits/dobetterweb/uses-http2.d.ts +0 -72
  121. package/core/audits/dobetterweb/uses-http2.js +0 -276
  122. package/core/audits/font-display.d.ts +0 -32
  123. package/core/audits/font-display.js +0 -195
  124. package/core/audits/largest-contentful-paint-element.d.ts +0 -34
  125. package/core/audits/largest-contentful-paint-element.js +0 -181
  126. package/core/audits/lcp-lazy-loaded.d.ts +0 -22
  127. package/core/audits/lcp-lazy-loaded.js +0 -115
  128. package/core/audits/prioritize-lcp-image.d.ts +0 -74
  129. package/core/audits/prioritize-lcp-image.js +0 -297
  130. package/core/audits/third-party-summary.d.ts +0 -78
  131. package/core/audits/third-party-summary.js +0 -236
  132. package/core/audits/uses-rel-preconnect.d.ts +0 -37
  133. package/core/audits/uses-rel-preconnect.js +0 -286
  134. package/core/audits/viewport.d.ts +0 -17
  135. package/core/audits/viewport.js +0 -87
  136. package/core/audits/work-during-interaction.d.ts +0 -81
  137. package/core/audits/work-during-interaction.js +0 -287
  138. package/core/computed/critical-request-chains.d.ts +0 -42
  139. package/core/computed/critical-request-chains.js +0 -143
  140. package/core/computed/viewport-meta.d.ts +0 -37
  141. package/core/computed/viewport-meta.js +0 -71
  142. package/types/internal/metaviewport-parser.d.ts +0 -13
@@ -16,32 +16,7 @@ const config = {
16
16
  'autocomplete',
17
17
  ],
18
18
  categories: {
19
- // @ts-ignore: `title` is required in CategoryJson. setting to the same value as the default
20
- // config is awkward - easier to omit the property here. Will defer to default config.
21
- 'performance': {
22
- auditRefs: [
23
- // TODO: Remove this when insights aren't hidden by default
24
- // Insight audits.
25
- {id: 'cache-insight', weight: 0, group: 'insights'},
26
- {id: 'cls-culprits-insight', weight: 0, group: 'insights'},
27
- {id: 'document-latency-insight', weight: 0, group: 'insights'},
28
- {id: 'dom-size-insight', weight: 0, group: 'insights'},
29
- {id: 'duplicated-javascript-insight', weight: 0, group: 'insights'},
30
- {id: 'font-display-insight', weight: 0, group: 'insights'},
31
- {id: 'forced-reflow-insight', weight: 0, group: 'insights'},
32
- {id: 'image-delivery-insight', weight: 0, group: 'insights'},
33
- {id: 'inp-breakdown-insight', weight: 0, group: 'insights'},
34
- {id: 'lcp-breakdown-insight', weight: 0, group: 'insights'},
35
- {id: 'lcp-discovery-insight', weight: 0, group: 'insights'},
36
- {id: 'legacy-javascript-insight', weight: 0, group: 'insights'},
37
- {id: 'modern-http-insight', weight: 0, group: 'insights'},
38
- {id: 'network-dependency-tree-insight', weight: 0, group: 'insights'},
39
- {id: 'render-blocking-insight', weight: 0, group: 'insights'},
40
- {id: 'third-parties-insight', weight: 0, group: 'insights'},
41
- {id: 'viewport-insight', weight: 0, group: 'insights'},
42
- ],
43
- },
44
- // @ts-ignore: `title` is required in CategoryJson. setting to the same value as the default
19
+ // @ts-expect-error: `title` is required in CategoryJson. setting to the same value as the default
45
20
  // config is awkward - easier to omit the property here. Will defer to default config.
46
21
  'best-practices': {
47
22
  auditRefs: [
@@ -4,8 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
9
7
  import {Audit} from '../audits/audit.js';
10
8
 
11
9
  /** @type {Record<keyof LH.BaseArtifacts, string>} */
@@ -176,20 +174,19 @@ function filterCategoriesByExplicitFilters(categories, onlyCategories) {
176
174
  }
177
175
 
178
176
  /**
179
- * Logs a warning if any specified onlyCategory is not a known category that can
177
+ * Throw an error if any specified onlyCategory is not a known category that can
180
178
  * be included.
181
179
  *
182
180
  * @param {LH.Config.ResolvedConfig['categories']} allCategories
183
181
  * @param {string[] | null} onlyCategories
184
182
  * @return {void}
185
183
  */
186
- function warnOnUnknownOnlyCategories(allCategories, onlyCategories) {
184
+ function errorOnUnknownOnlyCategories(allCategories, onlyCategories) {
187
185
  if (!onlyCategories) return;
188
186
 
189
- for (const onlyCategoryId of onlyCategories) {
190
- if (!allCategories?.[onlyCategoryId]) {
191
- log.warn('config', `unrecognized category in 'onlyCategories': ${onlyCategoryId}`);
192
- }
187
+ const unknown = onlyCategories.filter(c => !allCategories?.[c]);
188
+ if (unknown.length) {
189
+ throw new Error(`unrecognized category in 'onlyCategories': ${unknown.join(', ')}`);
193
190
  }
194
191
  }
195
192
 
@@ -271,7 +268,7 @@ function filterConfigByExplicitFilters(resolvedConfig, filters) {
271
268
  throw new Error(`onlyCategories cannot be an empty array.`);
272
269
  }
273
270
 
274
- warnOnUnknownOnlyCategories(resolvedConfig.categories, onlyCategories);
271
+ errorOnUnknownOnlyCategories(resolvedConfig.categories, onlyCategories);
275
272
 
276
273
  let baseAuditIds = getAuditIdsInCategories(resolvedConfig.categories, undefined);
277
274
  if (onlyCategories) {
@@ -18,7 +18,6 @@ const config = {
18
18
  emulatedUserAgent: constants.userAgents.desktop,
19
19
  skipAudits: [
20
20
  // Skip the h2 audit so it doesn't lie to us. See https://github.com/GoogleChrome/lighthouse/issues/6539
21
- 'uses-http2',
22
21
  'modern-http-insight',
23
22
  // There are always bf-cache failures when testing in headless. Reenable when headless can give us realistic bf-cache insights.
24
23
  'bf-cache',
@@ -17,7 +17,6 @@ const config = {
17
17
  },
18
18
  skipAudits: [
19
19
  // Skip the h2 audit so it doesn't lie to us. See https://github.com/GoogleChrome/lighthouse/issues/6539
20
- 'uses-http2',
21
20
  'modern-http-insight',
22
21
  // There are always bf-cache failures when testing in headless. Reenable when headless can give us realistic bf-cache insights.
23
22
  'bf-cache',
@@ -157,33 +157,17 @@ class AnchorElements extends BaseGatherer {
157
157
 
158
158
  // DOM.getDocument is necessary for pushNodesByBackendIdsToFrontend to properly retrieve nodeIds if the `DOM` domain was enabled before this gatherer, invoke it to be safe.
159
159
  await session.sendCommand('DOM.getDocument', {depth: -1, pierce: true});
160
- const anchorsWithEventListeners = anchors.map(async anchor => {
161
- const listeners = await getEventListeners(session, anchor.node.devtoolsNodePath);
162
-
163
- /** @type {Set<{type: string}>} */
164
- const ancestorListeners = new Set();
165
- const splitPath = anchor.node.devtoolsNodePath.split(',');
166
- const ancestorListenerPromises = [];
167
- while (splitPath.length >= 2) {
168
- splitPath.length -= 2;
169
- const path = splitPath.join(',');
170
- const promise = getEventListeners(session, path).then(listeners => {
171
- for (const listener of listeners) {
172
- ancestorListeners.add(listener);
173
- }
174
- }).catch(() => {});
175
- ancestorListenerPromises.push(promise);
176
- }
177
-
178
- await Promise.all(ancestorListenerPromises);
179
160
 
180
- return {
181
- ...anchor,
182
- listeners,
183
- ancestorListeners: Array.from(ancestorListeners),
184
- };
161
+ const anchorsWithEventListeners = anchors.map( anchor => {
162
+ return getEventListeners(session, anchor.node.devtoolsNodePath).then(listeners => {
163
+ return {
164
+ ...anchor,
165
+ listeners,
166
+ };
167
+ });
185
168
  });
186
169
 
170
+
187
171
  const result = await Promise.all(anchorsWithEventListeners);
188
172
  await session.sendCommand('DOM.disable');
189
173
  return result;
@@ -61,34 +61,7 @@ class InspectorIssues extends BaseGatherer {
61
61
  const networkRecords = await NetworkRecords.request(devtoolsLog, context);
62
62
 
63
63
  /** @type {LH.Artifacts.InspectorIssues} */
64
- const artifact = {
65
- // TODO(v13): remove empty arrays.
66
- attributionReportingIssue: [],
67
- blockedByResponseIssue: [],
68
- bounceTrackingIssue: [],
69
- clientHintIssue: [],
70
- contentSecurityPolicyIssue: [],
71
- cookieDeprecationMetadataIssue: [],
72
- corsIssue: [],
73
- deprecationIssue: [],
74
- federatedAuthRequestIssue: [],
75
- genericIssue: [],
76
- heavyAdIssue: [],
77
- lowTextContrastIssue: [],
78
- mixedContentIssue: [],
79
- navigatorUserAgentIssue: [],
80
- partitioningBlobURLIssue: [],
81
- propertyRuleIssue: [],
82
- quirksModeIssue: [],
83
- cookieIssue: [],
84
- elementAccessibilityIssue: [],
85
- sharedArrayBufferIssue: [],
86
- sharedDictionaryIssue: [],
87
- stylesheetLoadingIssue: [],
88
- sriMessageSignatureIssue: [],
89
- federatedAuthUserInfoRequestIssue: [],
90
- userReidentificationIssue: [],
91
- };
64
+ const artifact = {};
92
65
 
93
66
  for (const issue of this._issues) {
94
67
  const detailsKey = /** @type {keyof LH.Crdp.Audits.InspectorIssueDetails} */(
@@ -45,15 +45,6 @@ declare class TraceElements extends BaseGatherer {
45
45
  * @return {Promise<TraceElementData|undefined>}
46
46
  */
47
47
  static getResponsivenessElement(trace: LH.Trace, context: LH.Gatherer.Context): Promise<TraceElementData | undefined>;
48
- /**
49
- * @param {LH.Trace} trace
50
- * @param {LH.Gatherer.Context} context
51
- * @return {Promise<{nodeId: number, type: string} | undefined>}
52
- */
53
- static getLcpElement(trace: LH.Trace, context: LH.Gatherer.Context): Promise<{
54
- nodeId: number;
55
- type: string;
56
- } | undefined>;
57
48
  /** @type {LH.Gatherer.GathererMeta<'Trace'|'SourceMaps'>} */
58
49
  meta: LH.Gatherer.GathererMeta<"Trace" | "SourceMaps">;
59
50
  /** @type {Map<string, string>} */
@@ -18,8 +18,6 @@ import {pageFunctions} from '../../lib/page-functions.js';
18
18
  import {Sentry} from '../../lib/sentry.js';
19
19
  import Trace from './trace.js';
20
20
  import {ProcessedTrace} from '../../computed/processed-trace.js';
21
- import {ProcessedNavigation} from '../../computed/processed-navigation.js';
22
- import {LighthouseError} from '../../lib/lh-error.js';
23
21
  import {Responsiveness} from '../../computed/metrics/responsiveness.js';
24
22
  import {CumulativeLayoutShift} from '../../computed/metrics/cumulative-layout-shift.js';
25
23
  import {ExecutionContext} from '../driver/execution-context.js';
@@ -276,35 +274,6 @@ class TraceElements extends BaseGatherer {
276
274
  return animatedElementData;
277
275
  }
278
276
 
279
- /**
280
- * @param {LH.Trace} trace
281
- * @param {LH.Gatherer.Context} context
282
- * @return {Promise<{nodeId: number, type: string} | undefined>}
283
- */
284
- static async getLcpElement(trace, context) {
285
- let processedNavigation;
286
- try {
287
- processedNavigation = await ProcessedNavigation.request(trace, context);
288
- } catch (err) {
289
- // If we were running in timespan mode and there was no paint, treat LCP as missing.
290
- if (context.gatherMode === 'timespan' && err.code === LighthouseError.errors.NO_FCP.code) {
291
- return;
292
- }
293
-
294
- throw err;
295
- }
296
-
297
- // Use main-frame-only LCP to match the metric value.
298
- const lcpData = processedNavigation.largestContentfulPaintEvt?.args?.data;
299
- // These should exist, but trace types are loose.
300
- if (lcpData?.nodeId === undefined || !lcpData.type) return;
301
-
302
- return {
303
- nodeId: lcpData.nodeId,
304
- type: lcpData.type,
305
- };
306
- }
307
-
308
277
  /**
309
278
  * @param {LH.Gatherer.Context} context
310
279
  */
@@ -372,19 +341,15 @@ class TraceElements extends BaseGatherer {
372
341
 
373
342
  const traceEngineData = await TraceElements.getTraceEngineElements(
374
343
  traceEngineResult, navigationId);
375
- const lcpNodeData = await TraceElements.getLcpElement(trace, context);
376
344
  const shiftsData = await TraceElements.getTopLayoutShifts(
377
345
  trace, traceEngineResult, context);
378
346
  const animatedElementData = await this.getAnimatedElements(mainThreadEvents);
379
- const responsivenessElementData = await TraceElements.getResponsivenessElement(trace, context);
380
347
 
381
348
  /** @type {Map<string, TraceElementData[]>} */
382
349
  const backendNodeDataMap = new Map([
383
350
  ['trace-engine', traceEngineData],
384
- ['largest-contentful-paint', lcpNodeData ? [lcpNodeData] : []],
385
351
  ['layout-shift', shiftsData],
386
352
  ['animation', animatedElementData],
387
- ['responsiveness', responsivenessElementData ? [responsivenessElementData] : []],
388
353
  ]);
389
354
 
390
355
  /** @type {Map<number, LH.Crdp.Runtime.CallFunctionOnResponse | null>} */
@@ -241,13 +241,6 @@ export class NetworkRequest {
241
241
  * LR loses protocol information.
242
242
  */
243
243
  _updateProtocolForLightrider(): void;
244
- /**
245
- * TODO(compat): remove M116.
246
- * `timing.receiveHeadersStart` was added recently, and will be in M116. Until then,
247
- * set it to receiveHeadersEnd, which is close enough, to allow consumers of NetworkRequest
248
- * to use the new field without accounting for this backcompat.
249
- */
250
- _backfillReceiveHeaderStartTiming(): void;
251
244
  /**
252
245
  * LR gets additional, accurate timing information from its underlying fetch infrastructure. This
253
246
  * is passed in via X-Headers similar to 'X-TotalFetchedSize'.
@@ -286,7 +286,6 @@ class NetworkRequest {
286
286
  }
287
287
 
288
288
  this._updateResponseHeadersEndTimeIfNecessary();
289
- this._backfillReceiveHeaderStartTiming();
290
289
  this._updateTransferSizeForLightrider();
291
290
  this._updateTimingsForLightrider();
292
291
  }
@@ -306,7 +305,6 @@ class NetworkRequest {
306
305
  this.localizedFailDescription = data.errorText;
307
306
 
308
307
  this._updateResponseHeadersEndTimeIfNecessary();
309
- this._backfillReceiveHeaderStartTiming();
310
308
  this._updateTransferSizeForLightrider();
311
309
  this._updateTimingsForLightrider();
312
310
  }
@@ -329,7 +327,6 @@ class NetworkRequest {
329
327
  this.networkEndTime = data.timestamp * 1000;
330
328
 
331
329
  this._updateResponseHeadersEndTimeIfNecessary();
332
- this._backfillReceiveHeaderStartTiming();
333
330
  }
334
331
 
335
332
  /**
@@ -463,19 +460,6 @@ class NetworkRequest {
463
460
  }
464
461
  }
465
462
 
466
- /**
467
- * TODO(compat): remove M116.
468
- * `timing.receiveHeadersStart` was added recently, and will be in M116. Until then,
469
- * set it to receiveHeadersEnd, which is close enough, to allow consumers of NetworkRequest
470
- * to use the new field without accounting for this backcompat.
471
- */
472
- _backfillReceiveHeaderStartTiming() {
473
- // Do nothing if a value is already present!
474
- if (!this.timing || this.timing.receiveHeadersStart !== undefined) return;
475
-
476
- this.timing.receiveHeadersStart = this.timing.receiveHeadersEnd;
477
- }
478
-
479
463
  /**
480
464
  * LR gets additional, accurate timing information from its underlying fetch infrastructure. This
481
465
  * is passed in via X-Headers similar to 'X-TotalFetchedSize'.
@@ -22,29 +22,12 @@ function processForProto(lhr) {
22
22
  /** @type {LH.Result} */
23
23
  const reportJson = JSON.parse(JSON.stringify(lhr));
24
24
 
25
- // Clean up the configSettings
26
- // Note: This is not strictly required for conversion if protobuf parsing is set to
27
- // 'ignore unknown fields' in the language of conversion.
25
+ // Drop these fields as we've omitted them from the proto for simplicity
28
26
  if (reportJson.configSettings) {
29
- // The settings that are in both proto and LHR
30
- const {
31
- formFactor,
32
- locale,
33
- onlyCategories,
34
- channel,
35
- throttling,
36
- screenEmulation,
37
- throttlingMethod} = reportJson.configSettings;
38
-
39
- // @ts-expect-error - intentionally only a subset of settings.
40
- reportJson.configSettings = {
41
- formFactor,
42
- locale,
43
- onlyCategories,
44
- channel,
45
- throttling,
46
- screenEmulation,
47
- throttlingMethod};
27
+ // @ts-expect-error Removing non-optional field.
28
+ delete reportJson.configSettings.auditMode;
29
+ // @ts-expect-error Removing non-optional field.
30
+ delete reportJson.configSettings.gatherMode;
48
31
  }
49
32
 
50
33
  // Remove runtimeError if it is NO_ERROR