lighthouse 9.5.0-dev.20221018 → 9.5.0-dev.20221020
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/core/api.js +14 -10
- package/core/audits/accessibility/axe-audit.js +1 -1
- package/core/audits/accessibility/bypass.js +1 -0
- package/core/audits/accessibility/th-has-data-cells.js +1 -0
- package/core/audits/accessibility/video-caption.js +1 -0
- package/core/audits/autocomplete.js +3 -3
- package/core/audits/bootup-time.js +5 -5
- package/core/audits/byte-efficiency/duplicated-javascript.js +1 -1
- package/core/audits/byte-efficiency/legacy-javascript.js +1 -1
- package/core/audits/byte-efficiency/total-byte-weight.js +2 -2
- package/core/audits/byte-efficiency/uses-long-cache-ttl.js +3 -3
- package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +4 -4
- package/core/audits/csp-xss.js +3 -3
- package/core/audits/deprecations.js +2 -2
- package/core/audits/dobetterweb/dom-size.js +3 -3
- package/core/audits/dobetterweb/geolocation-on-start.js +1 -1
- package/core/audits/dobetterweb/inspector-issues.js +1 -1
- package/core/audits/dobetterweb/js-libraries.js +2 -2
- package/core/audits/dobetterweb/no-document-write.js +1 -1
- package/core/audits/dobetterweb/notification-on-start.js +1 -1
- package/core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +1 -1
- package/core/audits/dobetterweb/uses-http2.js +2 -2
- package/core/audits/dobetterweb/uses-passive-event-listeners.js +1 -1
- package/core/audits/errors-in-console.js +4 -2
- package/core/audits/font-display.js +2 -2
- package/core/audits/image-aspect-ratio.js +4 -4
- package/core/audits/image-size-responsive.js +5 -5
- package/core/audits/installable-manifest.js +1 -1
- package/core/audits/is-on-https.js +2 -2
- package/core/audits/largest-contentful-paint-element.js +1 -1
- package/core/audits/layout-shift-elements.js +3 -3
- package/core/audits/lcp-lazy-loaded.js +1 -1
- package/core/audits/long-tasks.js +3 -3
- package/core/audits/main-thread-tasks.js +2 -2
- package/core/audits/mainthread-work-breakdown.js +4 -2
- package/core/audits/network-requests.js +11 -11
- package/core/audits/network-rtt.js +2 -2
- package/core/audits/network-server-latency.js +3 -3
- package/core/audits/no-unload-listeners.js +1 -1
- package/core/audits/non-composited-animations.js +2 -2
- package/core/audits/performance-budget.js +5 -5
- package/core/audits/preload-fonts.js +1 -1
- package/core/audits/resource-summary.js +3 -3
- package/core/audits/seo/crawlable-anchors.js +2 -2
- package/core/audits/seo/font-size.js +4 -4
- package/core/audits/seo/hreflang.js +3 -3
- package/core/audits/seo/is-crawlable.js +1 -1
- package/core/audits/seo/link-text.js +2 -2
- package/core/audits/seo/plugins.js +1 -1
- package/core/audits/seo/robots-txt.js +3 -3
- package/core/audits/seo/tap-targets.js +3 -3
- package/core/audits/themed-omnibox.js +6 -14
- package/core/audits/third-party-facades.js +3 -3
- package/core/audits/third-party-summary.js +3 -3
- package/core/audits/timing-budget.js +3 -3
- package/core/audits/unsized-images.js +2 -2
- package/core/audits/user-timings.js +6 -6
- package/core/audits/valid-source-maps.js +3 -3
- package/core/audits/work-during-interaction.js +6 -6
- package/core/gather/navigation-runner.js +3 -3
- package/core/gather/snapshot-runner.js +4 -3
- package/core/gather/timespan-runner.js +4 -3
- package/core/index.js +1 -1
- package/core/legacy/config/config.js +0 -26
- package/core/lib/bfcache-strings.js +655 -0
- package/core/lib/deprecations-strings.js +3 -2
- package/core/lib/manifest-parser.js +0 -16
- package/core/user-flow.js +135 -77
- package/core/util.cjs +27 -0
- package/dist/report/bundle.esm.js +38 -73
- package/dist/report/flow.js +2 -2
- package/dist/report/standalone.js +2 -2
- package/package.json +2 -3
- package/report/renderer/details-renderer.js +12 -73
- package/report/renderer/util.js +27 -0
- package/report/test/generator/report-generator-test.js +1 -1
- package/report/test/renderer/category-renderer-test.js +1 -1
- package/report/test/renderer/details-renderer-test.js +38 -38
- package/report/test/renderer/util-test.js +25 -0
- package/shared/localization/locales/en-US.json +352 -1
- package/shared/localization/locales/en-XL.json +352 -1
- package/types/lhr/audit-details.d.ts +4 -34
- package/types/user-flow.d.ts +10 -3
package/core/api.js
CHANGED
|
@@ -13,36 +13,40 @@ import {Runner} from './runner.js';
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @param {LH.Puppeteer.Page} page
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {LH.UserFlow.Options} [options]
|
|
17
17
|
*/
|
|
18
18
|
async function startFlow(page, options) {
|
|
19
19
|
return new UserFlow(page, options);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* @param
|
|
23
|
+
* @param {LH.Puppeteer.Page|undefined} page
|
|
24
|
+
* @param {LH.NavigationRequestor|undefined} requestor
|
|
25
|
+
* @param {{config?: LH.Config.Json, flags?: LH.Flags}} [options]
|
|
24
26
|
* @return {Promise<LH.RunnerResult|undefined>}
|
|
25
27
|
*/
|
|
26
|
-
async function navigation(
|
|
27
|
-
const gatherResult = await navigationGather(
|
|
28
|
+
async function navigation(page, requestor, options) {
|
|
29
|
+
const gatherResult = await navigationGather(page, requestor, options);
|
|
28
30
|
return Runner.audit(gatherResult.artifacts, gatherResult.runnerOptions);
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
/**
|
|
32
|
-
* @param
|
|
34
|
+
* @param {LH.Puppeteer.Page} page
|
|
35
|
+
* @param {{config?: LH.Config.Json, flags?: LH.Flags}} [options]
|
|
33
36
|
* @return {Promise<LH.RunnerResult|undefined>}
|
|
34
37
|
*/
|
|
35
|
-
async function snapshot(
|
|
36
|
-
const gatherResult = await snapshotGather(
|
|
38
|
+
async function snapshot(page, options) {
|
|
39
|
+
const gatherResult = await snapshotGather(page, options);
|
|
37
40
|
return Runner.audit(gatherResult.artifacts, gatherResult.runnerOptions);
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
/**
|
|
41
|
-
* @param
|
|
44
|
+
* @param {LH.Puppeteer.Page} page
|
|
45
|
+
* @param {{config?: LH.Config.Json, flags?: LH.Flags}} [options]
|
|
42
46
|
* @return {Promise<{endTimespan: () => Promise<LH.RunnerResult|undefined>}>}
|
|
43
47
|
*/
|
|
44
|
-
async function startTimespan(
|
|
45
|
-
const {endTimespanGather} = await startTimespanGather(
|
|
48
|
+
async function startTimespan(page, options) {
|
|
49
|
+
const {endTimespanGather} = await startTimespanGather(page, options);
|
|
46
50
|
const endTimespan = async () => {
|
|
47
51
|
const gatherResult = await endTimespanGather();
|
|
48
52
|
return Runner.audit(gatherResult.artifacts, gatherResult.runnerOptions);
|
|
@@ -88,7 +88,7 @@ class AxeAudit extends Audit {
|
|
|
88
88
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
89
89
|
const headings = [
|
|
90
90
|
/* eslint-disable max-len */
|
|
91
|
-
{key: 'node',
|
|
91
|
+
{key: 'node', valueType: 'node', subItemsHeading: {key: 'relatedNode', valueType: 'node'}, label: str_(UIStrings.failingElementsHeader)},
|
|
92
92
|
/* eslint-enable max-len */
|
|
93
93
|
];
|
|
94
94
|
|
|
@@ -36,6 +36,7 @@ class Bypass extends AxeAudit {
|
|
|
36
36
|
title: str_(UIStrings.title),
|
|
37
37
|
failureTitle: str_(UIStrings.failureTitle),
|
|
38
38
|
description: str_(UIStrings.description),
|
|
39
|
+
scoreDisplayMode: AxeAudit.SCORING_MODES.INFORMATIVE,
|
|
39
40
|
requiredArtifacts: ['Accessibility'],
|
|
40
41
|
};
|
|
41
42
|
}
|
|
@@ -38,6 +38,7 @@ class THHasDataCells extends AxeAudit {
|
|
|
38
38
|
title: str_(UIStrings.title),
|
|
39
39
|
failureTitle: str_(UIStrings.failureTitle),
|
|
40
40
|
description: str_(UIStrings.description),
|
|
41
|
+
scoreDisplayMode: AxeAudit.SCORING_MODES.INFORMATIVE,
|
|
41
42
|
requiredArtifacts: ['Accessibility'],
|
|
42
43
|
};
|
|
43
44
|
}
|
|
@@ -36,6 +36,7 @@ class VideoCaption extends AxeAudit {
|
|
|
36
36
|
title: str_(UIStrings.title),
|
|
37
37
|
failureTitle: str_(UIStrings.failureTitle),
|
|
38
38
|
description: str_(UIStrings.description),
|
|
39
|
+
scoreDisplayMode: AxeAudit.SCORING_MODES.INFORMATIVE,
|
|
39
40
|
requiredArtifacts: ['Accessibility'],
|
|
40
41
|
};
|
|
41
42
|
}
|
|
@@ -266,9 +266,9 @@ class AutocompleteAudit extends Audit {
|
|
|
266
266
|
|
|
267
267
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
268
268
|
const headings = [
|
|
269
|
-
{key: 'node',
|
|
270
|
-
{key: 'current',
|
|
271
|
-
{key: 'suggestion',
|
|
269
|
+
{key: 'node', valueType: 'node', label: str_(i18n.UIStrings.columnFailingElem)},
|
|
270
|
+
{key: 'current', valueType: 'text', label: str_(UIStrings.columnCurrent)},
|
|
271
|
+
{key: 'suggestion', valueType: 'text', label: str_(UIStrings.columnSuggestions)},
|
|
272
272
|
];
|
|
273
273
|
const details = Audit.makeTableDetails(headings, failingFormsData);
|
|
274
274
|
let displayValue;
|
|
@@ -121,11 +121,11 @@ class BootupTime extends Audit {
|
|
|
121
121
|
|
|
122
122
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
123
123
|
const headings = [
|
|
124
|
-
{key: 'url',
|
|
125
|
-
{key: 'total', granularity: 1,
|
|
126
|
-
{key: 'scripting', granularity: 1,
|
|
127
|
-
{key: 'scriptParseCompile', granularity: 1,
|
|
128
|
-
|
|
124
|
+
{key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
|
|
125
|
+
{key: 'total', granularity: 1, valueType: 'ms', label: str_(UIStrings.columnTotal)},
|
|
126
|
+
{key: 'scripting', granularity: 1, valueType: 'ms', label: str_(UIStrings.columnScriptEval)},
|
|
127
|
+
{key: 'scriptParseCompile', granularity: 1, valueType: 'ms',
|
|
128
|
+
label: str_(UIStrings.columnScriptParse)},
|
|
129
129
|
];
|
|
130
130
|
|
|
131
131
|
const details = BootupTime.makeTableDetails(headings, results, summary);
|
|
@@ -225,7 +225,7 @@ class DuplicatedJavascript extends ByteEfficiencyAudit {
|
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
/** @type {LH.Audit.Details.
|
|
228
|
+
/** @type {LH.Audit.Details.TableColumnHeading[]} */
|
|
229
229
|
const headings = [
|
|
230
230
|
/* eslint-disable max-len */
|
|
231
231
|
{key: 'source', valueType: 'code', subItemsHeading: {key: 'url', valueType: 'url'}, label: str_(i18n.UIStrings.columnSource)},
|
|
@@ -455,7 +455,7 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
/** @type {LH.Audit.Details.
|
|
458
|
+
/** @type {LH.Audit.Details.TableColumnHeading[]} */
|
|
459
459
|
const headings = [
|
|
460
460
|
/* eslint-disable max-len */
|
|
461
461
|
{key: 'url', valueType: 'url', subItemsHeading: {key: 'location', valueType: 'source-location'}, label: str_(i18n.UIStrings.columnURL)},
|
|
@@ -89,8 +89,8 @@ class TotalByteWeight extends Audit {
|
|
|
89
89
|
|
|
90
90
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
91
91
|
const headings = [
|
|
92
|
-
{key: 'url',
|
|
93
|
-
{key: 'totalBytes',
|
|
92
|
+
{key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
|
|
93
|
+
{key: 'totalBytes', valueType: 'bytes', label: str_(i18n.UIStrings.columnTransferSize)},
|
|
94
94
|
];
|
|
95
95
|
|
|
96
96
|
const tableDetails = Audit.makeTableDetails(headings, results);
|
|
@@ -272,11 +272,11 @@ class CacheHeaders extends Audit {
|
|
|
272
272
|
|
|
273
273
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
274
274
|
const headings = [
|
|
275
|
-
{key: 'url',
|
|
275
|
+
{key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
|
|
276
276
|
// TODO(i18n): pre-compute localized duration
|
|
277
|
-
{key: 'cacheLifetimeMs',
|
|
277
|
+
{key: 'cacheLifetimeMs', valueType: 'ms', label: str_(i18n.UIStrings.columnCacheTTL),
|
|
278
278
|
displayUnit: 'duration'},
|
|
279
|
-
{key: 'totalBytes',
|
|
279
|
+
{key: 'totalBytes', valueType: 'bytes', label: str_(i18n.UIStrings.columnTransferSize),
|
|
280
280
|
displayUnit: 'kb', granularity: 1},
|
|
281
281
|
];
|
|
282
282
|
|
|
@@ -80,10 +80,10 @@ class UsesResponsiveImagesSnapshot extends Audit {
|
|
|
80
80
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
81
81
|
const headings = [
|
|
82
82
|
/* eslint-disable max-len */
|
|
83
|
-
{key: 'node',
|
|
84
|
-
{key: 'url',
|
|
85
|
-
{key: 'displayedDimensions',
|
|
86
|
-
{key: 'actualDimensions',
|
|
83
|
+
{key: 'node', valueType: 'node', label: ''},
|
|
84
|
+
{key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
|
|
85
|
+
{key: 'displayedDimensions', valueType: 'text', label: str_(UIStrings.columnDisplayedDimensions)},
|
|
86
|
+
{key: 'actualDimensions', valueType: 'text', label: str_(UIStrings.columnActualDimensions)},
|
|
87
87
|
/* eslint-enable max-len */
|
|
88
88
|
];
|
|
89
89
|
|
package/core/audits/csp-xss.js
CHANGED
|
@@ -163,9 +163,9 @@ class CspXss extends Audit {
|
|
|
163
163
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
164
164
|
const headings = [
|
|
165
165
|
/* eslint-disable max-len */
|
|
166
|
-
{key: 'description',
|
|
167
|
-
{key: 'directive',
|
|
168
|
-
{key: 'severity',
|
|
166
|
+
{key: 'description', valueType: 'text', subItemsHeading: {key: 'description'}, label: str_(i18n.UIStrings.columnDescription)},
|
|
167
|
+
{key: 'directive', valueType: 'code', subItemsHeading: {key: 'directive'}, label: str_(UIStrings.columnDirective)},
|
|
168
|
+
{key: 'severity', valueType: 'text', subItemsHeading: {key: 'severity'}, label: str_(UIStrings.columnSeverity)},
|
|
169
169
|
/* eslint-enable max-len */
|
|
170
170
|
];
|
|
171
171
|
const details = Audit.makeTableDetails(headings, results);
|
|
@@ -92,8 +92,8 @@ class Deprecations extends Audit {
|
|
|
92
92
|
|
|
93
93
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
94
94
|
const headings = [
|
|
95
|
-
{key: 'value',
|
|
96
|
-
{key: 'source',
|
|
95
|
+
{key: 'value', valueType: 'text', label: str_(UIStrings.columnDeprecate)},
|
|
96
|
+
{key: 'source', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
|
|
97
97
|
];
|
|
98
98
|
const details = Audit.makeTableDetails(headings, deprecations);
|
|
99
99
|
|
|
@@ -85,9 +85,9 @@ class DOMSize extends Audit {
|
|
|
85
85
|
|
|
86
86
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
87
87
|
const headings = [
|
|
88
|
-
{key: 'statistic',
|
|
89
|
-
{key: 'node',
|
|
90
|
-
{key: 'value',
|
|
88
|
+
{key: 'statistic', valueType: 'text', label: str_(UIStrings.columnStatistic)},
|
|
89
|
+
{key: 'node', valueType: 'node', label: str_(i18n.UIStrings.columnElement)},
|
|
90
|
+
{key: 'value', valueType: 'numeric', label: str_(UIStrings.columnValue)},
|
|
91
91
|
];
|
|
92
92
|
|
|
93
93
|
/** @type {LH.Audit.Details.Table['items']} */
|
|
@@ -52,7 +52,7 @@ class GeolocationOnStart extends ViolationAudit {
|
|
|
52
52
|
|
|
53
53
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
54
54
|
const headings = [
|
|
55
|
-
{key: 'source',
|
|
55
|
+
{key: 'source', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
|
|
56
56
|
];
|
|
57
57
|
// TODO(bckenny): there should actually be a ts error here. results[0].stackTrace
|
|
58
58
|
// should violate the results type. Shouldn't be removed from details items regardless.
|
|
@@ -152,7 +152,7 @@ class IssuesPanelEntries extends Audit {
|
|
|
152
152
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
153
153
|
const headings = [
|
|
154
154
|
/* eslint-disable max-len */
|
|
155
|
-
{key: 'issueType',
|
|
155
|
+
{key: 'issueType', valueType: 'text', subItemsHeading: {key: 'url', valueType: 'url'}, label: str_(UIStrings.columnIssueType)},
|
|
156
156
|
/* eslint-enable max-len */
|
|
157
157
|
];
|
|
158
158
|
|
|
@@ -54,8 +54,8 @@ class JsLibrariesAudit extends Audit {
|
|
|
54
54
|
|
|
55
55
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
56
56
|
const headings = [
|
|
57
|
-
{key: 'name',
|
|
58
|
-
{key: 'version',
|
|
57
|
+
{key: 'name', valueType: 'text', label: str_(i18n.UIStrings.columnName)},
|
|
58
|
+
{key: 'version', valueType: 'text', label: str_(UIStrings.columnVersion)},
|
|
59
59
|
];
|
|
60
60
|
const details = Audit.makeTableDetails(headings, libDetails, {});
|
|
61
61
|
|
|
@@ -68,7 +68,7 @@ class NoDocWriteAudit extends ViolationAudit {
|
|
|
68
68
|
|
|
69
69
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
70
70
|
const headings = [
|
|
71
|
-
{key: 'source',
|
|
71
|
+
{key: 'source', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
|
|
72
72
|
];
|
|
73
73
|
// TODO(bckenny): see TODO in geolocation-on-start
|
|
74
74
|
const details = ViolationAudit.makeTableDetails(headings, results);
|
|
@@ -52,7 +52,7 @@ class NotificationOnStart extends ViolationAudit {
|
|
|
52
52
|
|
|
53
53
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
54
54
|
const headings = [
|
|
55
|
-
{key: 'source',
|
|
55
|
+
{key: 'source', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
|
|
56
56
|
];
|
|
57
57
|
// TODO(bckenny): see TODO in geolocation-on-start
|
|
58
58
|
const details = ViolationAudit.makeTableDetails(headings, results);
|
|
@@ -51,7 +51,7 @@ class PasswordInputsCanBePastedIntoAudit extends Audit {
|
|
|
51
51
|
|
|
52
52
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
53
53
|
const headings = [
|
|
54
|
-
{key: 'node',
|
|
54
|
+
{key: 'node', valueType: 'node', label: str_(i18n.UIStrings.columnFailingElem)},
|
|
55
55
|
];
|
|
56
56
|
|
|
57
57
|
return {
|
|
@@ -214,8 +214,8 @@ class UsesHTTP2Audit extends Audit {
|
|
|
214
214
|
if (artifacts.GatherContext.gatherMode === 'timespan') {
|
|
215
215
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
216
216
|
const headings = [
|
|
217
|
-
{key: 'url',
|
|
218
|
-
{key: 'protocol',
|
|
217
|
+
{key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
|
|
218
|
+
{key: 'protocol', valueType: 'text', label: str_(UIStrings.columnProtocol)},
|
|
219
219
|
];
|
|
220
220
|
|
|
221
221
|
const details = Audit.makeTableDetails(headings, resources);
|
|
@@ -51,7 +51,7 @@ class PassiveEventsAudit extends ViolationAudit {
|
|
|
51
51
|
|
|
52
52
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
53
53
|
const headings = [
|
|
54
|
-
{key: 'source',
|
|
54
|
+
{key: 'source', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
|
|
55
55
|
];
|
|
56
56
|
// TODO(bckenny): see TODO in geolocation-on-start
|
|
57
57
|
const details = ViolationAudit.makeTableDetails(headings, results);
|
|
@@ -100,8 +100,10 @@ class ErrorLogs extends Audit {
|
|
|
100
100
|
|
|
101
101
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
102
102
|
const headings = [
|
|
103
|
-
|
|
104
|
-
{key: '
|
|
103
|
+
/* eslint-disable max-len */
|
|
104
|
+
{key: 'sourceLocation', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
|
|
105
|
+
{key: 'description', valueType: 'code', label: str_(i18n.UIStrings.columnDescription)},
|
|
106
|
+
/* eslint-enable max-len */
|
|
105
107
|
];
|
|
106
108
|
|
|
107
109
|
const details = Audit.makeTableDetails(headings, tableRows);
|
|
@@ -175,8 +175,8 @@ class FontDisplay extends Audit {
|
|
|
175
175
|
|
|
176
176
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
177
177
|
const headings = [
|
|
178
|
-
{key: 'url',
|
|
179
|
-
{key: 'wastedMs',
|
|
178
|
+
{key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
|
|
179
|
+
{key: 'wastedMs', valueType: 'ms', label: str_(i18n.UIStrings.columnWastedMs)},
|
|
180
180
|
];
|
|
181
181
|
|
|
182
182
|
const details = Audit.makeTableDetails(headings, results);
|
|
@@ -105,10 +105,10 @@ class ImageAspectRatio extends Audit {
|
|
|
105
105
|
|
|
106
106
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
107
107
|
const headings = [
|
|
108
|
-
{key: 'node',
|
|
109
|
-
{key: 'url',
|
|
110
|
-
{key: 'displayedAspectRatio',
|
|
111
|
-
{key: 'actualAspectRatio',
|
|
108
|
+
{key: 'node', valueType: 'node', label: ''},
|
|
109
|
+
{key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
|
|
110
|
+
{key: 'displayedAspectRatio', valueType: 'text', label: str_(UIStrings.columnDisplayed)},
|
|
111
|
+
{key: 'actualAspectRatio', valueType: 'text', label: str_(UIStrings.columnActual)},
|
|
112
112
|
];
|
|
113
113
|
|
|
114
114
|
return {
|
|
@@ -264,11 +264,11 @@ class ImageSizeResponsive extends Audit {
|
|
|
264
264
|
|
|
265
265
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
266
266
|
const headings = [
|
|
267
|
-
{key: 'node',
|
|
268
|
-
{key: 'url',
|
|
269
|
-
{key: 'displayedSize',
|
|
270
|
-
{key: 'actualSize',
|
|
271
|
-
{key: 'expectedSize',
|
|
267
|
+
{key: 'node', valueType: 'node', label: ''},
|
|
268
|
+
{key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
|
|
269
|
+
{key: 'displayedSize', valueType: 'text', label: str_(UIStrings.columnDisplayed)},
|
|
270
|
+
{key: 'actualSize', valueType: 'text', label: str_(UIStrings.columnActual)},
|
|
271
|
+
{key: 'expectedSize', valueType: 'text', label: str_(UIStrings.columnExpected)},
|
|
272
272
|
];
|
|
273
273
|
|
|
274
274
|
const finalResults = sortResultsBySizeDelta(deduplicateResultsByUrl(results));
|
|
@@ -216,7 +216,7 @@ class InstallableManifest extends Audit {
|
|
|
216
216
|
|
|
217
217
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
218
218
|
const headings = [
|
|
219
|
-
{key: 'reason',
|
|
219
|
+
{key: 'reason', valueType: 'text', label: str_(UIStrings.columnValue)},
|
|
220
220
|
];
|
|
221
221
|
|
|
222
222
|
// Errors for report table.
|
|
@@ -82,8 +82,8 @@ class HTTPS extends Audit {
|
|
|
82
82
|
|
|
83
83
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
84
84
|
const headings = [
|
|
85
|
-
{key: 'url',
|
|
86
|
-
{key: 'resolution',
|
|
85
|
+
{key: 'url', valueType: 'url', label: str_(UIStrings.columnInsecureURL)},
|
|
86
|
+
{key: 'resolution', valueType: 'text', label: str_(UIStrings.columnResolution)},
|
|
87
87
|
];
|
|
88
88
|
|
|
89
89
|
for (const details of artifacts.InspectorIssues.mixedContentIssue) {
|
|
@@ -48,7 +48,7 @@ class LargestContentfulPaintElement extends Audit {
|
|
|
48
48
|
|
|
49
49
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
50
50
|
const headings = [
|
|
51
|
-
{key: 'node',
|
|
51
|
+
{key: 'node', valueType: 'node', label: str_(i18n.UIStrings.columnElement)},
|
|
52
52
|
];
|
|
53
53
|
|
|
54
54
|
const details = Audit.makeTableDetails(headings, lcpElementDetails);
|
|
@@ -49,9 +49,9 @@ class LayoutShiftElements extends Audit {
|
|
|
49
49
|
|
|
50
50
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
51
51
|
const headings = [
|
|
52
|
-
{key: 'node',
|
|
53
|
-
{key: 'score',
|
|
54
|
-
granularity: 0.001,
|
|
52
|
+
{key: 'node', valueType: 'node', label: str_(i18n.UIStrings.columnElement)},
|
|
53
|
+
{key: 'score', valueType: 'numeric',
|
|
54
|
+
granularity: 0.001, label: str_(UIStrings.columnContribution)},
|
|
55
55
|
];
|
|
56
56
|
|
|
57
57
|
const details = Audit.makeTableDetails(headings, clsElementData);
|
|
@@ -64,7 +64,7 @@ class LargestContentfulPaintLazyLoaded extends Audit {
|
|
|
64
64
|
|
|
65
65
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
66
66
|
const headings = [
|
|
67
|
-
{key: 'node',
|
|
67
|
+
{key: 'node', valueType: 'node', label: str_(i18n.UIStrings.columnElement)},
|
|
68
68
|
];
|
|
69
69
|
|
|
70
70
|
const details = Audit.makeTableDetails(headings, [
|
|
@@ -98,9 +98,9 @@ class LongTasks extends Audit {
|
|
|
98
98
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
99
99
|
const headings = [
|
|
100
100
|
/* eslint-disable max-len */
|
|
101
|
-
{key: 'url',
|
|
102
|
-
{key: 'startTime',
|
|
103
|
-
{key: 'duration',
|
|
101
|
+
{key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
|
|
102
|
+
{key: 'startTime', valueType: 'ms', granularity: 1, label: str_(i18n.UIStrings.columnStartTime)},
|
|
103
|
+
{key: 'duration', valueType: 'ms', granularity: 1, label: str_(i18n.UIStrings.columnDuration)},
|
|
104
104
|
/* eslint-enable max-len */
|
|
105
105
|
];
|
|
106
106
|
|
|
@@ -42,8 +42,8 @@ class MainThreadTasks extends Audit {
|
|
|
42
42
|
|
|
43
43
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
44
44
|
const headings = [
|
|
45
|
-
{key: 'startTime',
|
|
46
|
-
{key: 'duration',
|
|
45
|
+
{key: 'startTime', valueType: 'ms', granularity: 1, label: 'Start Time'},
|
|
46
|
+
{key: 'duration', valueType: 'ms', granularity: 1, label: 'End Time'},
|
|
47
47
|
];
|
|
48
48
|
|
|
49
49
|
const tableDetails = Audit.makeTableDetails(headings, results);
|
|
@@ -107,8 +107,10 @@ class MainThreadWorkBreakdown extends Audit {
|
|
|
107
107
|
|
|
108
108
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
109
109
|
const headings = [
|
|
110
|
-
|
|
111
|
-
{key: '
|
|
110
|
+
/* eslint-disable max-len */
|
|
111
|
+
{key: 'groupLabel', valueType: 'text', label: str_(UIStrings.columnCategory)},
|
|
112
|
+
{key: 'duration', valueType: 'ms', granularity: 1, label: str_(i18n.UIStrings.columnTimeSpent)},
|
|
113
|
+
/* eslint-enable max-len */
|
|
112
114
|
];
|
|
113
115
|
|
|
114
116
|
results.sort((a, b) => categoryTotals[b.group] - categoryTotals[a.group]);
|
|
@@ -85,27 +85,27 @@ class NetworkRequests extends Audit {
|
|
|
85
85
|
// NOTE(i18n): this audit is only for debug info in the LHR and does not appear in the report.
|
|
86
86
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
87
87
|
const headings = [
|
|
88
|
-
{key: 'url',
|
|
89
|
-
{key: 'protocol',
|
|
90
|
-
{key: 'startTime',
|
|
91
|
-
{key: 'endTime',
|
|
88
|
+
{key: 'url', valueType: 'url', label: 'URL'},
|
|
89
|
+
{key: 'protocol', valueType: 'text', label: 'Protocol'},
|
|
90
|
+
{key: 'startTime', valueType: 'ms', granularity: 1, label: 'Start Time'},
|
|
91
|
+
{key: 'endTime', valueType: 'ms', granularity: 1, label: 'End Time'},
|
|
92
92
|
{
|
|
93
93
|
key: 'transferSize',
|
|
94
|
-
|
|
94
|
+
valueType: 'bytes',
|
|
95
95
|
displayUnit: 'kb',
|
|
96
96
|
granularity: 1,
|
|
97
|
-
|
|
97
|
+
label: 'Transfer Size',
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
key: 'resourceSize',
|
|
101
|
-
|
|
101
|
+
valueType: 'bytes',
|
|
102
102
|
displayUnit: 'kb',
|
|
103
103
|
granularity: 1,
|
|
104
|
-
|
|
104
|
+
label: 'Resource Size',
|
|
105
105
|
},
|
|
106
|
-
{key: 'statusCode',
|
|
107
|
-
{key: 'mimeType',
|
|
108
|
-
{key: 'resourceType',
|
|
106
|
+
{key: 'statusCode', valueType: 'text', label: 'Status Code'},
|
|
107
|
+
{key: 'mimeType', valueType: 'text', label: 'MIME Type'},
|
|
108
|
+
{key: 'resourceType', valueType: 'text', label: 'Resource Type'},
|
|
109
109
|
];
|
|
110
110
|
|
|
111
111
|
const tableDetails = Audit.makeTableDetails(headings, results);
|
|
@@ -69,8 +69,8 @@ class NetworkRTT extends Audit {
|
|
|
69
69
|
|
|
70
70
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
71
71
|
const headings = [
|
|
72
|
-
{key: 'origin',
|
|
73
|
-
{key: 'rtt',
|
|
72
|
+
{key: 'origin', valueType: 'text', label: str_(i18n.UIStrings.columnURL)},
|
|
73
|
+
{key: 'rtt', valueType: 'ms', granularity: 1, label: str_(i18n.UIStrings.columnTimeSpent)},
|
|
74
74
|
];
|
|
75
75
|
|
|
76
76
|
const tableDetails = Audit.makeTableDetails(headings, results);
|
|
@@ -67,9 +67,9 @@ class NetworkServerLatency extends Audit {
|
|
|
67
67
|
|
|
68
68
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
69
69
|
const headings = [
|
|
70
|
-
{key: 'origin',
|
|
71
|
-
{key: 'serverResponseTime',
|
|
72
|
-
|
|
70
|
+
{key: 'origin', valueType: 'text', label: str_(i18n.UIStrings.columnURL)},
|
|
71
|
+
{key: 'serverResponseTime', valueType: 'ms', granularity: 1,
|
|
72
|
+
label: str_(i18n.UIStrings.columnTimeSpent)},
|
|
73
73
|
];
|
|
74
74
|
|
|
75
75
|
const tableDetails = Audit.makeTableDetails(headings, results);
|
|
@@ -50,7 +50,7 @@ class NoUnloadListeners extends Audit {
|
|
|
50
50
|
|
|
51
51
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
52
52
|
const headings = [
|
|
53
|
-
{key: 'source',
|
|
53
|
+
{key: 'source', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
|
|
54
54
|
];
|
|
55
55
|
|
|
56
56
|
/** @type {Array<{source: LH.Audit.Details.ItemValue}>} */
|
|
@@ -173,14 +173,14 @@ class NonCompositedAnimations extends Audit {
|
|
|
173
173
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
174
174
|
const headings = [
|
|
175
175
|
/* eslint-disable max-len */
|
|
176
|
-
{key: 'node',
|
|
176
|
+
{key: 'node', valueType: 'node', subItemsHeading: {key: 'failureReason', valueType: 'text'}, label: str_(i18n.UIStrings.columnElement)},
|
|
177
177
|
/* eslint-enable max-len */
|
|
178
178
|
];
|
|
179
179
|
|
|
180
180
|
if (shouldAddAnimationNameColumn) {
|
|
181
181
|
headings.push(
|
|
182
182
|
/* eslint-disable max-len */
|
|
183
|
-
{key: null,
|
|
183
|
+
{key: null, valueType: 'text', subItemsHeading: {key: 'animation', valueType: 'text'}, label: str_(i18n.UIStrings.columnName)}
|
|
184
184
|
/* eslint-enable max-len */
|
|
185
185
|
);
|
|
186
186
|
}
|
|
@@ -135,11 +135,11 @@ class ResourceBudget extends Audit {
|
|
|
135
135
|
|
|
136
136
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
137
137
|
const headers = [
|
|
138
|
-
{key: 'label',
|
|
139
|
-
{key: 'requestCount',
|
|
140
|
-
{key: 'transferSize',
|
|
141
|
-
{key: 'countOverBudget',
|
|
142
|
-
{key: 'sizeOverBudget',
|
|
138
|
+
{key: 'label', valueType: 'text', label: str_(i18n.UIStrings.columnResourceType)},
|
|
139
|
+
{key: 'requestCount', valueType: 'numeric', label: str_(i18n.UIStrings.columnRequests)},
|
|
140
|
+
{key: 'transferSize', valueType: 'bytes', label: str_(i18n.UIStrings.columnTransferSize)},
|
|
141
|
+
{key: 'countOverBudget', valueType: 'text', label: ''},
|
|
142
|
+
{key: 'sizeOverBudget', valueType: 'bytes', label: str_(i18n.UIStrings.columnOverBudget)},
|
|
143
143
|
];
|
|
144
144
|
|
|
145
145
|
return {
|
|
@@ -82,7 +82,7 @@ class PreloadFontsAudit extends Audit {
|
|
|
82
82
|
|
|
83
83
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
84
84
|
const headings = [
|
|
85
|
-
{key: 'url',
|
|
85
|
+
{key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
|
|
86
86
|
];
|
|
87
87
|
|
|
88
88
|
return {
|