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.
- package/cli/test/smokehouse/config/exclusions.js +0 -2
- package/core/audits/audit.js +0 -1
- package/core/audits/insights/cls-culprits-insight.js +1 -1
- package/core/audits/insights/dom-size-insight.js +11 -7
- package/core/audits/insights/insight-audit.d.ts +4 -2
- package/core/audits/insights/insight-audit.js +22 -3
- package/core/audits/predictive-perf.js +2 -2
- package/core/audits/seo/crawlable-anchors.js +2 -3
- package/core/audits/server-response-time.d.ts +0 -5
- package/core/audits/server-response-time.js +12 -26
- package/core/computed/metrics/lcp-breakdown.d.ts +10 -5
- package/core/computed/metrics/lcp-breakdown.js +50 -22
- package/core/computed/metrics/time-to-first-byte.js +33 -10
- package/core/computed/metrics/timing-summary.js +3 -2
- package/core/config/default-config.js +20 -63
- package/core/config/experimental-config.js +1 -26
- package/core/config/filters.js +6 -9
- package/core/config/lr-desktop-config.js +0 -1
- package/core/config/lr-mobile-config.js +0 -1
- package/core/gather/gatherers/anchor-elements.js +8 -24
- package/core/gather/gatherers/inspector-issues.js +1 -28
- package/core/gather/gatherers/trace-elements.d.ts +0 -9
- package/core/gather/gatherers/trace-elements.js +0 -35
- package/core/lib/network-request.d.ts +0 -7
- package/core/lib/network-request.js +0 -16
- package/core/lib/proto-preprocessor.js +5 -22
- package/dist/report/bundle.esm.js +10 -49
- package/dist/report/flow.js +12 -51
- package/dist/report/standalone.js +11 -50
- package/flow-report/src/i18n/i18n.d.ts +4 -6
- package/package.json +4 -5
- package/report/assets/styles.css +0 -39
- package/report/renderer/api.js +0 -1
- package/report/renderer/category-renderer.js +6 -0
- package/report/renderer/components.js +1 -1
- package/report/renderer/dom.d.ts +0 -13
- package/report/renderer/dom.js +0 -38
- package/report/renderer/performance-category-renderer.d.ts +0 -26
- package/report/renderer/performance-category-renderer.js +10 -142
- package/report/renderer/report-ui-features.d.ts +0 -1
- package/report/renderer/report-ui-features.js +3 -13
- package/report/renderer/report-utils.d.ts +2 -3
- package/report/renderer/report-utils.js +4 -6
- package/report/types/report-renderer.d.ts +0 -6
- package/shared/localization/locales/ar-XB.json +20 -341
- package/shared/localization/locales/ar.json +20 -341
- package/shared/localization/locales/bg.json +9 -330
- package/shared/localization/locales/ca.json +9 -330
- package/shared/localization/locales/cs.json +9 -330
- package/shared/localization/locales/da.json +9 -330
- package/shared/localization/locales/de.json +9 -330
- package/shared/localization/locales/el.json +9 -330
- package/shared/localization/locales/en-GB.json +9 -330
- package/shared/localization/locales/en-US.json +44 -293
- package/shared/localization/locales/en-XA.json +0 -330
- package/shared/localization/locales/en-XL.json +44 -293
- package/shared/localization/locales/es-419.json +9 -330
- package/shared/localization/locales/es.json +9 -330
- package/shared/localization/locales/fi.json +9 -330
- package/shared/localization/locales/fil.json +9 -330
- package/shared/localization/locales/fr.json +9 -330
- package/shared/localization/locales/he.json +31 -352
- package/shared/localization/locales/hi.json +9 -330
- package/shared/localization/locales/hr.json +9 -330
- package/shared/localization/locales/hu.json +9 -330
- package/shared/localization/locales/id.json +9 -330
- package/shared/localization/locales/it.json +9 -330
- package/shared/localization/locales/ja.json +9 -330
- package/shared/localization/locales/ko.json +10 -331
- package/shared/localization/locales/lt.json +9 -330
- package/shared/localization/locales/lv.json +10 -331
- package/shared/localization/locales/nl.json +9 -330
- package/shared/localization/locales/no.json +9 -330
- package/shared/localization/locales/pl.json +9 -330
- package/shared/localization/locales/pt-PT.json +9 -330
- package/shared/localization/locales/pt.json +9 -330
- package/shared/localization/locales/ro.json +10 -331
- package/shared/localization/locales/ru.json +9 -330
- package/shared/localization/locales/sk.json +9 -330
- package/shared/localization/locales/sl.json +9 -330
- package/shared/localization/locales/sr-Latn.json +9 -330
- package/shared/localization/locales/sr.json +9 -330
- package/shared/localization/locales/sv.json +9 -330
- package/shared/localization/locales/ta.json +9 -330
- package/shared/localization/locales/te.json +10 -331
- package/shared/localization/locales/th.json +9 -330
- package/shared/localization/locales/tr.json +9 -330
- package/shared/localization/locales/uk.json +9 -330
- package/shared/localization/locales/vi.json +9 -330
- package/shared/localization/locales/zh-HK.json +9 -330
- package/shared/localization/locales/zh-TW.json +10 -331
- package/shared/localization/locales/zh.json +9 -330
- package/types/artifacts.d.ts +5 -6
- package/types/audit.d.ts +1 -1
- package/types/lhr/settings.d.ts +1 -1
- package/core/audits/byte-efficiency/duplicated-javascript.d.ts +0 -45
- package/core/audits/byte-efficiency/duplicated-javascript.js +0 -223
- package/core/audits/byte-efficiency/efficient-animated-content.d.ts +0 -22
- package/core/audits/byte-efficiency/efficient-animated-content.js +0 -93
- package/core/audits/byte-efficiency/legacy-javascript.d.ts +0 -28
- package/core/audits/byte-efficiency/legacy-javascript.js +0 -144
- package/core/audits/byte-efficiency/modern-image-formats.d.ts +0 -38
- package/core/audits/byte-efficiency/modern-image-formats.js +0 -187
- package/core/audits/byte-efficiency/render-blocking-resources.d.ts +0 -53
- package/core/audits/byte-efficiency/render-blocking-resources.js +0 -312
- package/core/audits/byte-efficiency/uses-long-cache-ttl.d.ts +0 -59
- package/core/audits/byte-efficiency/uses-long-cache-ttl.js +0 -293
- package/core/audits/byte-efficiency/uses-optimized-images.d.ts +0 -33
- package/core/audits/byte-efficiency/uses-optimized-images.js +0 -146
- package/core/audits/byte-efficiency/uses-responsive-images-snapshot.d.ts +0 -16
- package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +0 -106
- package/core/audits/byte-efficiency/uses-responsive-images.d.ts +0 -44
- package/core/audits/byte-efficiency/uses-responsive-images.js +0 -202
- package/core/audits/byte-efficiency/uses-text-compression.d.ts +0 -14
- package/core/audits/byte-efficiency/uses-text-compression.js +0 -108
- package/core/audits/critical-request-chains.d.ts +0 -44
- package/core/audits/critical-request-chains.js +0 -221
- package/core/audits/dobetterweb/dom-size.d.ts +0 -32
- package/core/audits/dobetterweb/dom-size.js +0 -182
- package/core/audits/dobetterweb/uses-http2.d.ts +0 -72
- package/core/audits/dobetterweb/uses-http2.js +0 -276
- package/core/audits/font-display.d.ts +0 -32
- package/core/audits/font-display.js +0 -195
- package/core/audits/largest-contentful-paint-element.d.ts +0 -34
- package/core/audits/largest-contentful-paint-element.js +0 -181
- package/core/audits/lcp-lazy-loaded.d.ts +0 -22
- package/core/audits/lcp-lazy-loaded.js +0 -115
- package/core/audits/prioritize-lcp-image.d.ts +0 -74
- package/core/audits/prioritize-lcp-image.js +0 -297
- package/core/audits/third-party-summary.d.ts +0 -78
- package/core/audits/third-party-summary.js +0 -236
- package/core/audits/uses-rel-preconnect.d.ts +0 -37
- package/core/audits/uses-rel-preconnect.js +0 -286
- package/core/audits/viewport.d.ts +0 -17
- package/core/audits/viewport.js +0 -87
- package/core/audits/work-during-interaction.d.ts +0 -81
- package/core/audits/work-during-interaction.js +0 -287
- package/core/computed/critical-request-chains.d.ts +0 -42
- package/core/computed/critical-request-chains.js +0 -143
- package/core/computed/viewport-meta.d.ts +0 -37
- package/core/computed/viewport-meta.js +0 -71
- 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-
|
|
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: [
|
package/core/config/filters.js
CHANGED
|
@@ -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
|
-
*
|
|
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
|
|
184
|
+
function errorOnUnknownOnlyCategories(allCategories, onlyCategories) {
|
|
187
185
|
if (!onlyCategories) return;
|
|
188
186
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
-
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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
|
-
//
|
|
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
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|