lighthouse 12.5.1 → 12.6.0-dev.20250427
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/run.js +1 -1
- package/cli/test/smokehouse/config/exclusions.js +2 -0
- package/cli/test/smokehouse/lib/concurrent-mapper.d.ts +3 -3
- package/core/audits/audit.d.ts +1 -1
- package/core/audits/audit.js +3 -2
- package/core/audits/bootup-time.d.ts +1 -1
- package/core/audits/bootup-time.js +3 -3
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +1 -1
- package/core/audits/byte-efficiency/duplicated-javascript.js +1 -1
- package/core/audits/byte-efficiency/efficient-animated-content.js +1 -1
- package/core/audits/byte-efficiency/legacy-javascript.js +2 -3
- package/core/audits/byte-efficiency/modern-image-formats.js +1 -1
- package/core/audits/byte-efficiency/offscreen-images.js +4 -4
- package/core/audits/byte-efficiency/render-blocking-resources.js +4 -4
- package/core/audits/byte-efficiency/total-byte-weight.d.ts +1 -1
- package/core/audits/byte-efficiency/total-byte-weight.js +2 -2
- package/core/audits/byte-efficiency/unminified-css.js +1 -1
- package/core/audits/byte-efficiency/unminified-javascript.js +1 -1
- package/core/audits/byte-efficiency/unused-css-rules.js +2 -2
- package/core/audits/byte-efficiency/unused-javascript.js +1 -1
- package/core/audits/byte-efficiency/uses-long-cache-ttl.d.ts +1 -1
- package/core/audits/byte-efficiency/uses-long-cache-ttl.js +2 -2
- package/core/audits/byte-efficiency/uses-optimized-images.js +2 -2
- package/core/audits/byte-efficiency/uses-responsive-images.d.ts +1 -1
- package/core/audits/byte-efficiency/uses-responsive-images.js +1 -1
- package/core/audits/byte-efficiency/uses-text-compression.js +1 -1
- package/core/audits/clickjacking-mitigation.js +2 -2
- package/core/audits/critical-request-chains.js +3 -3
- package/core/audits/csp-xss.js +2 -2
- package/core/audits/diagnostics.js +3 -3
- package/core/audits/dobetterweb/charset.js +2 -2
- package/core/audits/dobetterweb/doctype.js +2 -2
- package/core/audits/dobetterweb/dom-size.d.ts +1 -1
- package/core/audits/dobetterweb/dom-size.js +3 -3
- package/core/audits/dobetterweb/uses-http2.js +2 -2
- package/core/audits/final-screenshot.js +2 -2
- package/core/audits/font-display.js +2 -2
- package/core/audits/has-hsts.js +2 -2
- package/core/audits/image-size-responsive.d.ts +3 -2
- package/core/audits/image-size-responsive.js +30 -4
- package/core/audits/insights/{use-cache-insight.d.ts → cache-insight.d.ts} +3 -3
- package/core/audits/insights/{use-cache-insight.js → cache-insight.js} +15 -13
- package/core/audits/insights/cls-culprits-insight.js +3 -3
- package/core/audits/insights/document-latency-insight.js +1 -1
- package/core/audits/insights/dom-size-insight.js +1 -1
- package/core/audits/insights/duplicated-javascript-insight.d.ts +13 -0
- package/core/audits/insights/duplicated-javascript-insight.js +36 -9
- package/core/audits/insights/font-display-insight.js +1 -1
- package/core/audits/insights/forced-reflow-insight.js +1 -1
- package/core/audits/insights/image-delivery-insight.js +1 -1
- package/core/audits/insights/insight-audit.d.ts +11 -9
- package/core/audits/insights/insight-audit.js +37 -35
- package/core/audits/insights/interaction-to-next-paint-insight.js +3 -6
- package/core/audits/insights/lcp-discovery-insight.js +6 -3
- package/core/audits/insights/lcp-phases-insight.js +3 -6
- package/core/audits/insights/legacy-javascript-insight.d.ts +23 -0
- package/core/audits/insights/legacy-javascript-insight.js +101 -0
- package/core/audits/insights/modern-http-insight.d.ts +11 -0
- package/core/audits/insights/modern-http-insight.js +53 -0
- package/core/audits/insights/network-dependency-tree-insight.d.ts +5 -0
- package/core/audits/insights/network-dependency-tree-insight.js +35 -13
- package/core/audits/insights/render-blocking-insight.js +1 -1
- package/core/audits/insights/slow-css-selector-insight.js +3 -1
- package/core/audits/insights/third-parties-insight.d.ts +3 -3
- package/core/audits/insights/third-parties-insight.js +28 -23
- package/core/audits/insights/viewport-insight.js +1 -1
- package/core/audits/is-on-https.js +2 -2
- package/core/audits/largest-contentful-paint-element.js +3 -3
- package/core/audits/layout-shifts.js +4 -4
- package/core/audits/lcp-lazy-loaded.js +1 -1
- package/core/audits/long-tasks.d.ts +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.d.ts +1 -1
- package/core/audits/mainthread-work-breakdown.js +2 -2
- package/core/audits/manual/manual-audit.d.ts +1 -1
- package/core/audits/metrics/cumulative-layout-shift.d.ts +1 -1
- package/core/audits/metrics/cumulative-layout-shift.js +2 -2
- package/core/audits/metrics/first-contentful-paint.js +3 -3
- package/core/audits/metrics/first-meaningful-paint.js +1 -1
- package/core/audits/metrics/interaction-to-next-paint.d.ts +1 -1
- package/core/audits/metrics/interaction-to-next-paint.js +2 -2
- package/core/audits/metrics/interactive.js +3 -3
- package/core/audits/metrics/largest-contentful-paint.js +3 -3
- package/core/audits/metrics/max-potential-fid.d.ts +1 -1
- package/core/audits/metrics/max-potential-fid.js +3 -3
- package/core/audits/metrics/speed-index.js +3 -3
- package/core/audits/metrics/total-blocking-time.js +3 -3
- package/core/audits/metrics.js +3 -3
- package/core/audits/network-requests.js +2 -2
- package/core/audits/network-rtt.js +2 -2
- package/core/audits/network-server-latency.js +2 -2
- package/core/audits/origin-isolation.js +2 -2
- package/core/audits/predictive-perf.js +3 -3
- package/core/audits/preload-fonts.js +2 -2
- package/core/audits/prioritize-lcp-image.js +3 -3
- package/core/audits/redirects.js +3 -3
- package/core/audits/resource-summary.js +2 -2
- package/core/audits/screenshot-thumbnails.js +2 -2
- package/core/audits/script-treemap-data.js +32 -2
- package/core/audits/seo/canonical.js +2 -2
- package/core/audits/seo/http-status-code.js +2 -2
- package/core/audits/seo/is-crawlable.js +2 -2
- package/core/audits/server-response-time.js +2 -2
- package/core/audits/third-party-cookies.js +1 -1
- package/core/audits/third-party-facades.js +2 -2
- package/core/audits/third-party-summary.js +2 -2
- package/core/audits/user-timings.d.ts +1 -1
- package/core/audits/user-timings.js +2 -2
- package/core/audits/uses-rel-preconnect.js +3 -3
- package/core/audits/uses-rel-preload.js +3 -3
- package/core/audits/valid-source-maps.js +2 -2
- package/core/audits/work-during-interaction.js +3 -3
- package/core/computed/critical-request-chains.d.ts +1 -1
- package/core/computed/document-urls.d.ts +4 -1
- package/core/computed/entity-classification.d.ts +1 -1
- package/core/computed/image-records.d.ts +1 -1
- package/core/computed/js-bundles.d.ts +1 -1
- package/core/computed/lcp-image-record.d.ts +1 -1
- package/core/computed/load-simulator.d.ts +1 -1
- package/core/computed/main-resource.d.ts +1 -1
- package/core/computed/main-thread-tasks.d.ts +1 -1
- package/core/computed/metrics/cumulative-layout-shift.d.ts +10 -1
- package/core/computed/metrics/first-contentful-paint-all-frames.d.ts +1 -1
- package/core/computed/metrics/first-contentful-paint.d.ts +1 -1
- package/core/computed/metrics/interactive.d.ts +1 -1
- package/core/computed/metrics/lantern-first-contentful-paint.d.ts +1 -1
- package/core/computed/metrics/lantern-interactive.d.ts +1 -1
- package/core/computed/metrics/lantern-largest-contentful-paint.d.ts +1 -1
- package/core/computed/metrics/lantern-max-potential-fid.d.ts +1 -1
- package/core/computed/metrics/lantern-speed-index.d.ts +1 -1
- package/core/computed/metrics/lantern-total-blocking-time.d.ts +1 -1
- package/core/computed/metrics/largest-contentful-paint-all-frames.d.ts +1 -1
- package/core/computed/metrics/largest-contentful-paint.d.ts +1 -1
- package/core/computed/metrics/lcp-breakdown.d.ts +5 -1
- package/core/computed/metrics/max-potential-fid.d.ts +1 -1
- package/core/computed/metrics/responsiveness.d.ts +1 -1
- package/core/computed/metrics/speed-index.d.ts +1 -1
- package/core/computed/metrics/time-to-first-byte.d.ts +1 -1
- package/core/computed/metrics/timing-summary.d.ts +4 -1
- package/core/computed/metrics/total-blocking-time.d.ts +1 -1
- package/core/computed/module-duplication.d.ts +5 -1
- package/core/computed/navigation-insights.d.ts +1 -1
- package/core/computed/network-analysis.d.ts +1 -1
- package/core/computed/network-records.d.ts +1 -1
- package/core/computed/page-dependency-graph.d.ts +1 -1
- package/core/computed/processed-navigation.d.ts +1 -1
- package/core/computed/processed-trace.d.ts +1 -1
- package/core/computed/resource-summary.d.ts +1 -1
- package/core/computed/screenshots.d.ts +4 -1
- package/core/computed/speedline.d.ts +1 -1
- package/core/computed/tbt-impact-tasks.d.ts +1 -1
- package/core/computed/trace-engine-result.d.ts +1 -1
- package/core/computed/unused-css.d.ts +1 -1
- package/core/computed/unused-javascript-summary.d.ts +1 -1
- package/core/computed/user-timings.d.ts +1 -1
- package/core/computed/viewport-meta.d.ts +1 -1
- package/core/config/default-config.js +11 -6
- package/core/config/experimental-config.js +3 -2
- package/core/gather/driver/network-monitor.d.ts +1 -1
- package/core/gather/driver/network.d.ts +1 -1
- package/core/gather/driver.d.ts +1 -1
- package/core/gather/gatherers/devtools-log.d.ts +1 -1
- package/core/gather/gatherers/dobetterweb/optimized-images.js +3 -10
- package/core/gather/gatherers/trace-elements.d.ts +3 -4
- package/core/gather/gatherers/trace-elements.js +6 -8
- package/core/gather/gatherers/trace.js +0 -3
- package/core/gather/navigation-runner.d.ts +1 -1
- package/core/gather/snapshot-runner.d.ts +1 -1
- package/core/gather/timespan-runner.d.ts +1 -1
- package/core/index.d.ts +6 -6
- package/core/lib/asset-saver.d.ts +1 -1
- package/core/lib/asset-saver.js +1 -1
- package/core/lib/bf-cache-strings.js +2 -0
- package/core/lib/deprecations-strings.d.ts +71 -76
- package/core/lib/deprecations-strings.js +22 -25
- package/core/lib/i18n/README.md +1 -1
- package/core/lib/i18n/i18n.d.ts +1 -1
- package/core/lib/i18n/i18n.js +4 -4
- package/core/lib/legacy-javascript/legacy-javascript.js +4 -11
- package/core/lib/legacy-javascript/package.json +14 -0
- package/core/lib/page-functions.d.ts +1 -1
- package/core/lib/stack-packs.js +1 -1
- package/core/lib/tracehouse/cpu-profile-model.d.ts +1 -1
- package/core/lib/tracehouse/main-thread-tasks.d.ts +3 -3
- package/core/lib/tracehouse/main-thread-tasks.js +8 -0
- package/core/lib/tracehouse/trace-processor.d.ts +1 -1
- package/core/lib/traces/metric-trace-events.d.ts +2 -2
- package/core/runner.js +2 -1
- package/core/scoring.d.ts +539 -3
- package/core/user-flow.d.ts +6 -6
- package/dist/report/bundle.esm.js +89 -19
- package/dist/report/flow.js +92 -22
- package/dist/report/standalone.js +89 -19
- package/flow-report/src/i18n/i18n.d.ts +6 -2
- package/package.json +17 -16
- package/readme.md +1 -1
- package/report/README.md +1 -1
- package/report/assets/styles.css +76 -9
- package/report/assets/templates.html +3 -1
- package/report/clients/standalone.js +6 -4
- package/report/renderer/category-renderer.d.ts +2 -2
- package/report/renderer/components.js +3 -9
- package/report/renderer/crc-details-renderer.d.ts +13 -31
- package/report/renderer/crc-details-renderer.js +49 -47
- package/report/renderer/details-renderer.d.ts +1 -1
- package/report/renderer/details-renderer.js +6 -0
- package/report/renderer/dom.js +7 -0
- package/report/renderer/features-util.d.ts +1 -1
- package/report/renderer/performance-category-renderer.d.ts +28 -2
- package/report/renderer/performance-category-renderer.js +121 -3
- package/report/renderer/report-utils.d.ts +3 -1
- package/report/renderer/report-utils.js +11 -4
- package/report/renderer/topbar-features.js +1 -9
- package/shared/localization/format.d.ts +1 -1
- package/shared/localization/locales/ar-XB.json +66 -6
- package/shared/localization/locales/ar.json +66 -6
- package/shared/localization/locales/bg.json +66 -6
- package/shared/localization/locales/ca.json +66 -6
- package/shared/localization/locales/cs.json +66 -6
- package/shared/localization/locales/da.json +66 -6
- package/shared/localization/locales/de.json +66 -6
- package/shared/localization/locales/el.json +66 -6
- package/shared/localization/locales/en-GB.json +66 -6
- package/shared/localization/locales/en-US.json +87 -36
- package/shared/localization/locales/en-XA.json +0 -6
- package/shared/localization/locales/en-XL.json +87 -36
- package/shared/localization/locales/es-419.json +66 -6
- package/shared/localization/locales/es.json +67 -7
- package/shared/localization/locales/fi.json +66 -6
- package/shared/localization/locales/fil.json +66 -6
- package/shared/localization/locales/fr.json +66 -6
- package/shared/localization/locales/he.json +66 -6
- package/shared/localization/locales/hi.json +66 -6
- package/shared/localization/locales/hr.json +66 -6
- package/shared/localization/locales/hu.json +66 -6
- package/shared/localization/locales/id.json +66 -6
- package/shared/localization/locales/it.json +67 -7
- package/shared/localization/locales/ja.json +66 -6
- package/shared/localization/locales/ko.json +66 -6
- package/shared/localization/locales/lt.json +66 -6
- package/shared/localization/locales/lv.json +66 -6
- package/shared/localization/locales/nl.json +66 -6
- package/shared/localization/locales/no.json +66 -6
- package/shared/localization/locales/pl.json +66 -6
- package/shared/localization/locales/pt-PT.json +66 -6
- package/shared/localization/locales/pt.json +67 -7
- package/shared/localization/locales/ro.json +66 -6
- package/shared/localization/locales/ru.json +66 -6
- package/shared/localization/locales/sk.json +66 -6
- package/shared/localization/locales/sl.json +66 -6
- package/shared/localization/locales/sr-Latn.json +66 -6
- package/shared/localization/locales/sr.json +66 -6
- package/shared/localization/locales/sv.json +66 -6
- package/shared/localization/locales/ta.json +69 -9
- package/shared/localization/locales/te.json +66 -6
- package/shared/localization/locales/th.json +66 -6
- package/shared/localization/locales/tr.json +66 -6
- package/shared/localization/locales/uk.json +66 -6
- package/shared/localization/locales/vi.json +66 -6
- package/shared/localization/locales/zh-HK.json +67 -7
- package/shared/localization/locales/zh-TW.json +67 -7
- package/shared/localization/locales/zh.json +66 -6
- package/tsconfig-base.json +1 -1
- package/tsconfig.json +1 -0
- package/types/artifacts.d.ts +0 -2
- package/types/internal/node.d.ts +0 -16
- package/types/lhr/audit-details.d.ts +33 -1
- package/types/lhr/treemap.d.ts +5 -1
package/cli/run.js
CHANGED
|
@@ -137,7 +137,7 @@ async function saveResults(runnerResult, flags) {
|
|
|
137
137
|
const cwd = process.cwd();
|
|
138
138
|
|
|
139
139
|
if (flags.lanternDataOutputPath) {
|
|
140
|
-
const devtoolsLog = runnerResult.artifacts.
|
|
140
|
+
const devtoolsLog = runnerResult.artifacts.DevtoolsLog;
|
|
141
141
|
await assetSaver.saveLanternNetworkData(devtoolsLog, flags.lanternDataOutputPath);
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -22,7 +22,7 @@ export class ConcurrentMapper {
|
|
|
22
22
|
*/
|
|
23
23
|
static map<T, U>(values: Array<T>, callbackfn: (value: T, index: number, array: Array<T>) => Promise<U>, options?: {
|
|
24
24
|
concurrency: number;
|
|
25
|
-
}
|
|
25
|
+
}): Promise<Array<U>>;
|
|
26
26
|
/** @type {Set<Promise<unknown>>} */
|
|
27
27
|
_promisePool: Set<Promise<unknown>>;
|
|
28
28
|
/**
|
|
@@ -61,7 +61,7 @@ export class ConcurrentMapper {
|
|
|
61
61
|
*/
|
|
62
62
|
pooledMap<T, U>(values: Array<T>, callbackfn: (value: T, index: number, array: Array<T>) => Promise<U>, options?: {
|
|
63
63
|
concurrency: number;
|
|
64
|
-
}
|
|
64
|
+
}): Promise<Array<U>>;
|
|
65
65
|
/**
|
|
66
66
|
* Runs `fn` concurrent to other operations in the pool, at a max of
|
|
67
67
|
* `concurrency` at a time across all callers on this instance. Default
|
|
@@ -73,6 +73,6 @@ export class ConcurrentMapper {
|
|
|
73
73
|
*/
|
|
74
74
|
runInPool<U>(fn: () => Promise<U>, options?: {
|
|
75
75
|
concurrency: number;
|
|
76
|
-
}
|
|
76
|
+
}): Promise<U>;
|
|
77
77
|
}
|
|
78
78
|
//# sourceMappingURL=concurrent-mapper.d.ts.map
|
package/core/audits/audit.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export class Audit {
|
|
|
20
20
|
/**
|
|
21
21
|
* @return {LH.Audit.ScoreDisplayModes}
|
|
22
22
|
*/
|
|
23
|
-
static get SCORING_MODES():
|
|
23
|
+
static get SCORING_MODES(): LH.Audit.ScoreDisplayModes;
|
|
24
24
|
/**
|
|
25
25
|
* @return {LH.Audit.Meta}
|
|
26
26
|
*/
|
package/core/audits/audit.js
CHANGED
|
@@ -49,6 +49,7 @@ class Audit {
|
|
|
49
49
|
* @return {string}
|
|
50
50
|
*/
|
|
51
51
|
static get DEFAULT_PASS() {
|
|
52
|
+
// TODO(v13): remove.
|
|
52
53
|
return DEFAULT_PASS;
|
|
53
54
|
}
|
|
54
55
|
|
|
@@ -488,8 +489,8 @@ class Audit {
|
|
|
488
489
|
* @returns {LH.Artifacts.MetricComputationDataInput}
|
|
489
490
|
*/
|
|
490
491
|
static makeMetricComputationDataInput(artifacts, context) {
|
|
491
|
-
const trace = artifacts.traces[Audit.DEFAULT_PASS];
|
|
492
|
-
const devtoolsLog = artifacts.devtoolsLogs[Audit.DEFAULT_PASS];
|
|
492
|
+
const trace = artifacts.Trace ?? artifacts.traces[Audit.DEFAULT_PASS];
|
|
493
|
+
const devtoolsLog = artifacts.DevtoolsLog ?? artifacts.devtoolsLogs[Audit.DEFAULT_PASS];
|
|
493
494
|
const gatherContext = artifacts.GatherContext;
|
|
494
495
|
const {URL, SourceMaps} = artifacts;
|
|
495
496
|
// eslint-disable-next-line max-len
|
|
@@ -3,7 +3,7 @@ declare class BootupTime extends Audit {
|
|
|
3
3
|
/**
|
|
4
4
|
* @return {LH.Audit.ScoreOptions & {thresholdInMs: number}}
|
|
5
5
|
*/
|
|
6
|
-
static get defaultOptions():
|
|
6
|
+
static get defaultOptions(): LH.Audit.ScoreOptions & {
|
|
7
7
|
thresholdInMs: number;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
@@ -49,7 +49,7 @@ class BootupTime extends Audit {
|
|
|
49
49
|
description: str_(UIStrings.description),
|
|
50
50
|
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS,
|
|
51
51
|
guidanceLevel: 1,
|
|
52
|
-
requiredArtifacts: ['
|
|
52
|
+
requiredArtifacts: ['Trace', 'DevtoolsLog', 'URL', 'GatherContext', 'SourceMaps'],
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -100,8 +100,8 @@ class BootupTime extends Audit {
|
|
|
100
100
|
*/
|
|
101
101
|
static async audit(artifacts, context) {
|
|
102
102
|
const settings = context.settings || {};
|
|
103
|
-
const trace = artifacts.
|
|
104
|
-
const devtoolsLog = artifacts.
|
|
103
|
+
const trace = artifacts.Trace;
|
|
104
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
105
105
|
const networkRecords = await NetworkRecords.request(devtoolsLog, context);
|
|
106
106
|
const tasks = await MainThreadTasks.request(trace, context);
|
|
107
107
|
const multiplier = settings.throttlingMethod === 'simulate' ?
|
|
@@ -60,7 +60,7 @@ class ByteEfficiencyAudit extends Audit {
|
|
|
60
60
|
*/
|
|
61
61
|
static async audit(artifacts, context) {
|
|
62
62
|
const gatherContext = artifacts.GatherContext;
|
|
63
|
-
const devtoolsLog = artifacts.
|
|
63
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
64
64
|
const settings = context?.settings || {};
|
|
65
65
|
const simulatorOptions = {
|
|
66
66
|
devtoolsLog,
|
|
@@ -53,7 +53,7 @@ class DuplicatedJavascript extends ByteEfficiencyAudit {
|
|
|
53
53
|
description: str_(UIStrings.description),
|
|
54
54
|
scoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.METRIC_SAVINGS,
|
|
55
55
|
guidanceLevel: 2,
|
|
56
|
-
requiredArtifacts: ['
|
|
56
|
+
requiredArtifacts: ['DevtoolsLog', 'Trace', 'SourceMaps', 'Scripts',
|
|
57
57
|
'GatherContext', 'URL'],
|
|
58
58
|
};
|
|
59
59
|
}
|
|
@@ -38,7 +38,7 @@ class EfficientAnimatedContent extends ByteEfficiencyAudit {
|
|
|
38
38
|
description: str_(UIStrings.description),
|
|
39
39
|
scoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.METRIC_SAVINGS,
|
|
40
40
|
guidanceLevel: 3,
|
|
41
|
-
requiredArtifacts: ['
|
|
41
|
+
requiredArtifacts: ['DevtoolsLog', 'Trace', 'GatherContext', 'URL', 'SourceMaps'],
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
/** @typedef {LH.Audit.ByteEfficiencyItem & {subItems: {type: 'subitems', items: SubItem[]}}} Item */
|
|
16
16
|
/** @typedef {{signal: string, location: LH.Audit.Details.SourceLocationValue}} SubItem */
|
|
17
17
|
|
|
18
|
-
import {Audit} from '../audit.js';
|
|
19
18
|
import {ByteEfficiencyAudit} from './byte-efficiency-audit.js';
|
|
20
19
|
import {EntityClassification} from '../../computed/entity-classification.js';
|
|
21
20
|
import {JSBundles} from '../../computed/js-bundles.js';
|
|
@@ -48,7 +47,7 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
48
47
|
description: str_(UIStrings.description),
|
|
49
48
|
title: str_(UIStrings.title),
|
|
50
49
|
guidanceLevel: 2,
|
|
51
|
-
requiredArtifacts: ['
|
|
50
|
+
requiredArtifacts: ['DevtoolsLog', 'Trace', 'Scripts', 'SourceMaps',
|
|
52
51
|
'GatherContext', 'URL'],
|
|
53
52
|
};
|
|
54
53
|
}
|
|
@@ -60,7 +59,7 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
60
59
|
* @return {Promise<ByteEfficiencyProduct>}
|
|
61
60
|
*/
|
|
62
61
|
static async audit_(artifacts, networkRecords, context) {
|
|
63
|
-
const devtoolsLog = artifacts.
|
|
62
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
64
63
|
const classifiedEntities = await EntityClassification.request(
|
|
65
64
|
{URL: artifacts.URL, devtoolsLog}, context);
|
|
66
65
|
|
|
@@ -36,7 +36,7 @@ class ModernImageFormats extends ByteEfficiencyAudit {
|
|
|
36
36
|
description: str_(UIStrings.description),
|
|
37
37
|
scoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.METRIC_SAVINGS,
|
|
38
38
|
guidanceLevel: 3,
|
|
39
|
-
requiredArtifacts: ['OptimizedImages', '
|
|
39
|
+
requiredArtifacts: ['OptimizedImages', 'DevtoolsLog', 'Trace', 'URL', 'GatherContext',
|
|
40
40
|
'ImageElements', 'SourceMaps'],
|
|
41
41
|
};
|
|
42
42
|
}
|
|
@@ -51,8 +51,8 @@ class OffscreenImages extends ByteEfficiencyAudit {
|
|
|
51
51
|
scoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.METRIC_SAVINGS,
|
|
52
52
|
supportedModes: ['navigation'],
|
|
53
53
|
guidanceLevel: 2,
|
|
54
|
-
requiredArtifacts: ['ImageElements', 'ViewportDimensions', 'GatherContext', '
|
|
55
|
-
'
|
|
54
|
+
requiredArtifacts: ['ImageElements', 'ViewportDimensions', 'GatherContext', 'DevtoolsLog',
|
|
55
|
+
'Trace', 'URL', 'SourceMaps'],
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -167,8 +167,8 @@ class OffscreenImages extends ByteEfficiencyAudit {
|
|
|
167
167
|
const images = artifacts.ImageElements;
|
|
168
168
|
const viewportDimensions = artifacts.ViewportDimensions;
|
|
169
169
|
const gatherContext = artifacts.GatherContext;
|
|
170
|
-
const trace = artifacts.
|
|
171
|
-
const devtoolsLog = artifacts.
|
|
170
|
+
const trace = artifacts.Trace;
|
|
171
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
172
172
|
|
|
173
173
|
/** @type {string[]} */
|
|
174
174
|
const warnings = [];
|
|
@@ -113,7 +113,7 @@ class RenderBlockingResources extends Audit {
|
|
|
113
113
|
// of CSSUsage
|
|
114
114
|
requiredArtifacts:
|
|
115
115
|
// eslint-disable-next-line max-len
|
|
116
|
-
['URL', '
|
|
116
|
+
['URL', 'Trace', 'DevtoolsLog', 'Stylesheets', 'CSSUsage', 'GatherContext', 'Stacks', 'SourceMaps'],
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -125,8 +125,8 @@ class RenderBlockingResources extends Audit {
|
|
|
125
125
|
static async computeResults(artifacts, context) {
|
|
126
126
|
const settings = context.settings;
|
|
127
127
|
const gatherContext = artifacts.GatherContext;
|
|
128
|
-
const trace = artifacts.
|
|
129
|
-
const devtoolsLog = artifacts.
|
|
128
|
+
const trace = artifacts.Trace;
|
|
129
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
130
130
|
const SourceMaps = artifacts.SourceMaps;
|
|
131
131
|
const simulatorData = {devtoolsLog, settings: context.settings};
|
|
132
132
|
const simulator = await LoadSimulator.request(simulatorData, context);
|
|
@@ -263,7 +263,7 @@ class RenderBlockingResources extends Audit {
|
|
|
263
263
|
const unusedCssItems = await UnusedCSS.request({
|
|
264
264
|
Stylesheets: artifacts.Stylesheets,
|
|
265
265
|
CSSUsage: artifacts.CSSUsage,
|
|
266
|
-
devtoolsLog: artifacts.
|
|
266
|
+
devtoolsLog: artifacts.DevtoolsLog,
|
|
267
267
|
}, context);
|
|
268
268
|
for (const item of unusedCssItems) {
|
|
269
269
|
wastedBytesByUrl.set(item.url, item.wastedBytes);
|
|
@@ -3,7 +3,7 @@ declare class TotalByteWeight extends Audit {
|
|
|
3
3
|
/**
|
|
4
4
|
* @return {LH.Audit.ScoreOptions}
|
|
5
5
|
*/
|
|
6
|
-
static get defaultOptions():
|
|
6
|
+
static get defaultOptions(): LH.Audit.ScoreOptions;
|
|
7
7
|
/**
|
|
8
8
|
* @param {LH.Artifacts} artifacts
|
|
9
9
|
* @param {LH.Audit.Context} context
|
|
@@ -36,7 +36,7 @@ class TotalByteWeight extends Audit {
|
|
|
36
36
|
description: str_(UIStrings.description),
|
|
37
37
|
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS,
|
|
38
38
|
guidanceLevel: 1,
|
|
39
|
-
requiredArtifacts: ['
|
|
39
|
+
requiredArtifacts: ['DevtoolsLog'],
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -59,7 +59,7 @@ class TotalByteWeight extends Audit {
|
|
|
59
59
|
* @return {Promise<LH.Audit.Product>}
|
|
60
60
|
*/
|
|
61
61
|
static async audit(artifacts, context) {
|
|
62
|
-
const devtoolsLog = artifacts.
|
|
62
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
63
63
|
const records = await NetworkRecords.request(devtoolsLog, context);
|
|
64
64
|
|
|
65
65
|
let totalBytes = 0;
|
|
@@ -37,7 +37,7 @@ class UnminifiedCSS extends ByteEfficiencyAudit {
|
|
|
37
37
|
description: str_(UIStrings.description),
|
|
38
38
|
scoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.METRIC_SAVINGS,
|
|
39
39
|
guidanceLevel: 3,
|
|
40
|
-
requiredArtifacts: ['Stylesheets', '
|
|
40
|
+
requiredArtifacts: ['Stylesheets', 'DevtoolsLog', 'Trace', 'URL', 'GatherContext',
|
|
41
41
|
'SourceMaps'],
|
|
42
42
|
};
|
|
43
43
|
}
|
|
@@ -44,7 +44,7 @@ class UnminifiedJavaScript extends ByteEfficiencyAudit {
|
|
|
44
44
|
description: str_(UIStrings.description),
|
|
45
45
|
scoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.METRIC_SAVINGS,
|
|
46
46
|
guidanceLevel: 3,
|
|
47
|
-
requiredArtifacts: ['Scripts', '
|
|
47
|
+
requiredArtifacts: ['Scripts', 'DevtoolsLog', 'Trace', 'GatherContext', 'URL',
|
|
48
48
|
'SourceMaps'],
|
|
49
49
|
};
|
|
50
50
|
}
|
|
@@ -35,7 +35,7 @@ class UnusedCSSRules extends ByteEfficiencyAudit {
|
|
|
35
35
|
scoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.METRIC_SAVINGS,
|
|
36
36
|
guidanceLevel: 1,
|
|
37
37
|
requiredArtifacts:
|
|
38
|
-
['Stylesheets', 'CSSUsage', 'URL', '
|
|
38
|
+
['Stylesheets', 'CSSUsage', 'URL', 'DevtoolsLog', 'Trace', 'GatherContext', 'SourceMaps'],
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -49,7 +49,7 @@ class UnusedCSSRules extends ByteEfficiencyAudit {
|
|
|
49
49
|
const unusedCssItems = await UnusedCSS.request({
|
|
50
50
|
Stylesheets: artifacts.Stylesheets,
|
|
51
51
|
CSSUsage: artifacts.CSSUsage,
|
|
52
|
-
devtoolsLog: artifacts.
|
|
52
|
+
devtoolsLog: artifacts.DevtoolsLog,
|
|
53
53
|
}, context);
|
|
54
54
|
const items = unusedCssItems
|
|
55
55
|
.filter(sheet => sheet && sheet.wastedBytes > IGNORE_THRESHOLD_IN_BYTES);
|
|
@@ -69,7 +69,7 @@ class UnusedJavaScript extends ByteEfficiencyAudit {
|
|
|
69
69
|
scoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.METRIC_SAVINGS,
|
|
70
70
|
guidanceLevel: 1,
|
|
71
71
|
requiredArtifacts: ['JsUsage', 'Scripts', 'SourceMaps', 'GatherContext',
|
|
72
|
-
'
|
|
72
|
+
'DevtoolsLog', 'Trace', 'URL', 'SourceMaps'],
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -3,7 +3,7 @@ declare class CacheHeaders extends Audit {
|
|
|
3
3
|
/**
|
|
4
4
|
* @return {LH.Audit.ScoreOptions}
|
|
5
5
|
*/
|
|
6
|
-
static get defaultOptions():
|
|
6
|
+
static get defaultOptions(): LH.Audit.ScoreOptions;
|
|
7
7
|
/**
|
|
8
8
|
* Computes the percent likelihood that a return visit will be within the cache lifetime, based on
|
|
9
9
|
* Chrome UMA stats see the note below.
|
|
@@ -46,7 +46,7 @@ class CacheHeaders extends Audit {
|
|
|
46
46
|
description: str_(UIStrings.description),
|
|
47
47
|
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS,
|
|
48
48
|
guidanceLevel: 3,
|
|
49
|
-
requiredArtifacts: ['
|
|
49
|
+
requiredArtifacts: ['DevtoolsLog', 'SourceMaps'],
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -196,7 +196,7 @@ class CacheHeaders extends Audit {
|
|
|
196
196
|
* @return {Promise<LH.Audit.Product>}
|
|
197
197
|
*/
|
|
198
198
|
static async audit(artifacts, context) {
|
|
199
|
-
const devtoolsLogs = artifacts.
|
|
199
|
+
const devtoolsLogs = artifacts.DevtoolsLog;
|
|
200
200
|
const records = await NetworkRecords.request(devtoolsLogs, context);
|
|
201
201
|
const results = [];
|
|
202
202
|
let totalWastedBytes = 0;
|
|
@@ -36,8 +36,8 @@ class UsesOptimizedImages extends ByteEfficiencyAudit {
|
|
|
36
36
|
description: str_(UIStrings.description),
|
|
37
37
|
scoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.METRIC_SAVINGS,
|
|
38
38
|
guidanceLevel: 2,
|
|
39
|
-
requiredArtifacts: ['OptimizedImages', 'ImageElements', 'GatherContext', '
|
|
40
|
-
'
|
|
39
|
+
requiredArtifacts: ['OptimizedImages', 'ImageElements', 'GatherContext', 'DevtoolsLog',
|
|
40
|
+
'Trace', 'URL', 'SourceMaps'],
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -39,6 +39,6 @@ export namespace UIStrings {
|
|
|
39
39
|
let title: string;
|
|
40
40
|
let description: string;
|
|
41
41
|
}
|
|
42
|
-
export const str_: (message: string, values?: Record<string, string | number>
|
|
42
|
+
export const str_: (message: string, values?: Record<string, string | number>) => LH.IcuMessage;
|
|
43
43
|
import { ByteEfficiencyAudit } from './byte-efficiency-audit.js';
|
|
44
44
|
//# sourceMappingURL=uses-responsive-images.d.ts.map
|
|
@@ -48,7 +48,7 @@ class UsesResponsiveImages extends ByteEfficiencyAudit {
|
|
|
48
48
|
scoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.METRIC_SAVINGS,
|
|
49
49
|
guidanceLevel: 2,
|
|
50
50
|
requiredArtifacts: ['ImageElements', 'ViewportDimensions', 'GatherContext',
|
|
51
|
-
'
|
|
51
|
+
'DevtoolsLog', 'Trace', 'URL', 'SourceMaps'],
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -38,7 +38,7 @@ class ResponsesAreCompressed extends ByteEfficiencyAudit {
|
|
|
38
38
|
description: str_(UIStrings.description),
|
|
39
39
|
scoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.METRIC_SAVINGS,
|
|
40
40
|
guidanceLevel: 3,
|
|
41
|
-
requiredArtifacts: ['ResponseCompression', 'GatherContext', '
|
|
41
|
+
requiredArtifacts: ['ResponseCompression', 'GatherContext', 'DevtoolsLog', 'Trace', 'URL',
|
|
42
42
|
'SourceMaps'],
|
|
43
43
|
};
|
|
44
44
|
}
|
|
@@ -31,7 +31,7 @@ class ClickjackingMitigation extends Audit {
|
|
|
31
31
|
scoreDisplayMode: Audit.SCORING_MODES.INFORMATIVE,
|
|
32
32
|
title: str_(UIStrings.title),
|
|
33
33
|
description: str_(UIStrings.description),
|
|
34
|
-
requiredArtifacts: ['
|
|
34
|
+
requiredArtifacts: ['DevtoolsLog', 'URL'],
|
|
35
35
|
supportedModes: ['navigation'],
|
|
36
36
|
};
|
|
37
37
|
}
|
|
@@ -42,7 +42,7 @@ class ClickjackingMitigation extends Audit {
|
|
|
42
42
|
* @return {Promise<{cspHeaders: string[], xfoHeaders: string[]}>}
|
|
43
43
|
*/
|
|
44
44
|
static async getRawCspsAndXfo(artifacts, context) {
|
|
45
|
-
const devtoolsLog = artifacts.
|
|
45
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
46
46
|
const mainResource =
|
|
47
47
|
await MainResource.request({devtoolsLog, URL: artifacts.URL}, context);
|
|
48
48
|
|
|
@@ -38,7 +38,7 @@ class CriticalRequestChains extends Audit {
|
|
|
38
38
|
scoreDisplayMode: Audit.SCORING_MODES.INFORMATIVE,
|
|
39
39
|
supportedModes: ['navigation'],
|
|
40
40
|
guidanceLevel: 1,
|
|
41
|
-
requiredArtifacts: ['
|
|
41
|
+
requiredArtifacts: ['Trace', 'DevtoolsLog', 'URL', 'SourceMaps'],
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -169,8 +169,8 @@ class CriticalRequestChains extends Audit {
|
|
|
169
169
|
*/
|
|
170
170
|
static async audit(artifacts, context) {
|
|
171
171
|
const settings = context.settings;
|
|
172
|
-
const trace = artifacts.
|
|
173
|
-
const devtoolsLog = artifacts.
|
|
172
|
+
const trace = artifacts.Trace;
|
|
173
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
174
174
|
const {URL, SourceMaps} = artifacts;
|
|
175
175
|
const chains =
|
|
176
176
|
await ComputedChains.request({settings, devtoolsLog, trace, URL, SourceMaps}, context);
|
package/core/audits/csp-xss.js
CHANGED
|
@@ -44,7 +44,7 @@ class CspXss extends Audit {
|
|
|
44
44
|
scoreDisplayMode: Audit.SCORING_MODES.INFORMATIVE,
|
|
45
45
|
title: str_(UIStrings.title),
|
|
46
46
|
description: str_(UIStrings.description),
|
|
47
|
-
requiredArtifacts: ['
|
|
47
|
+
requiredArtifacts: ['DevtoolsLog', 'MetaElements', 'URL'],
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -54,7 +54,7 @@ class CspXss extends Audit {
|
|
|
54
54
|
* @return {Promise<{cspHeaders: string[], cspMetaTags: string[]}>}
|
|
55
55
|
*/
|
|
56
56
|
static async getRawCsps(artifacts, context) {
|
|
57
|
-
const devtoolsLog = artifacts.
|
|
57
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
58
58
|
const mainResource = await MainResource.request({devtoolsLog, URL: artifacts.URL}, context);
|
|
59
59
|
|
|
60
60
|
const cspMetaTags = artifacts.MetaElements
|
|
@@ -21,7 +21,7 @@ class Diagnostics extends Audit {
|
|
|
21
21
|
title: 'Diagnostics',
|
|
22
22
|
description: 'Collection of useful page vitals.',
|
|
23
23
|
supportedModes: ['navigation'],
|
|
24
|
-
requiredArtifacts: ['URL', '
|
|
24
|
+
requiredArtifacts: ['URL', 'Trace', 'DevtoolsLog'],
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -31,8 +31,8 @@ class Diagnostics extends Audit {
|
|
|
31
31
|
* @return {Promise<LH.Audit.Product>}
|
|
32
32
|
*/
|
|
33
33
|
static async audit(artifacts, context) {
|
|
34
|
-
const trace = artifacts.
|
|
35
|
-
const devtoolsLog = artifacts.
|
|
34
|
+
const trace = artifacts.Trace;
|
|
35
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
36
36
|
const tasks = await MainThreadTasks.request(trace, context);
|
|
37
37
|
const records = await NetworkRecords.request(devtoolsLog, context);
|
|
38
38
|
const analysis = await NetworkAnalysis.request(devtoolsLog, context);
|
|
@@ -45,7 +45,7 @@ class CharsetDefined extends Audit {
|
|
|
45
45
|
title: str_(UIStrings.title),
|
|
46
46
|
failureTitle: str_(UIStrings.failureTitle),
|
|
47
47
|
description: str_(UIStrings.description),
|
|
48
|
-
requiredArtifacts: ['MainDocumentContent', 'URL', '
|
|
48
|
+
requiredArtifacts: ['MainDocumentContent', 'URL', 'DevtoolsLog', 'MetaElements'],
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -55,7 +55,7 @@ class CharsetDefined extends Audit {
|
|
|
55
55
|
* @return {Promise<LH.Audit.Product>}
|
|
56
56
|
*/
|
|
57
57
|
static async audit(artifacts, context) {
|
|
58
|
-
const devtoolsLog = artifacts.
|
|
58
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
59
59
|
const mainResource = await MainResource.request({devtoolsLog, URL: artifacts.URL}, context);
|
|
60
60
|
let isCharsetSet = false;
|
|
61
61
|
// Check the http header 'content-type' to see if charset is defined there
|
|
@@ -44,7 +44,7 @@ class Doctype extends Audit {
|
|
|
44
44
|
failureTitle: str_(UIStrings.failureTitle),
|
|
45
45
|
description: str_(UIStrings.description),
|
|
46
46
|
requiredArtifacts: ['Doctype'],
|
|
47
|
-
__internalOptionalArtifacts: ['InspectorIssues', '
|
|
47
|
+
__internalOptionalArtifacts: ['InspectorIssues', 'Trace'],
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -67,7 +67,7 @@ class Doctype extends Audit {
|
|
|
67
67
|
const doctypeSystemId = artifacts.Doctype.systemId;
|
|
68
68
|
const compatMode = artifacts.Doctype.documentCompatMode;
|
|
69
69
|
|
|
70
|
-
const trace = artifacts.
|
|
70
|
+
const trace = artifacts.Trace;
|
|
71
71
|
|
|
72
72
|
/** @type {LH.Crdp.Audits.QuirksModeIssueDetails[]} */
|
|
73
73
|
let quirksModeIssues = [];
|
|
@@ -3,7 +3,7 @@ declare class DOMSize extends Audit {
|
|
|
3
3
|
/**
|
|
4
4
|
* @return {LH.Audit.ScoreOptions}
|
|
5
5
|
*/
|
|
6
|
-
static get defaultOptions():
|
|
6
|
+
static get defaultOptions(): LH.Audit.ScoreOptions;
|
|
7
7
|
/**
|
|
8
8
|
* @param {LH.Artifacts} artifacts
|
|
9
9
|
* @param {LH.Audit.Context} context
|
|
@@ -56,7 +56,7 @@ class DOMSize extends Audit {
|
|
|
56
56
|
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS,
|
|
57
57
|
guidanceLevel: 1,
|
|
58
58
|
requiredArtifacts: ['DOMStats', 'URL', 'GatherContext'],
|
|
59
|
-
__internalOptionalArtifacts: ['
|
|
59
|
+
__internalOptionalArtifacts: ['Trace', 'DevtoolsLog', 'SourceMaps'],
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -82,14 +82,14 @@ class DOMSize extends Audit {
|
|
|
82
82
|
|
|
83
83
|
// We still want to surface this audit in snapshot mode, but since we don't compute TBT
|
|
84
84
|
// the impact should always be undefined.
|
|
85
|
-
const {GatherContext,
|
|
85
|
+
const {GatherContext, DevtoolsLog, Trace} = artifacts;
|
|
86
86
|
if (GatherContext.gatherMode !== 'navigation') {
|
|
87
87
|
return undefined;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// Since the artifacts are optional, it's still possible for them to be missing in navigation mode.
|
|
91
91
|
// Navigation mode does compute TBT so we should surface a numerical savings of 0.
|
|
92
|
-
if (!
|
|
92
|
+
if (!DevtoolsLog || !Trace) {
|
|
93
93
|
return 0;
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -58,7 +58,7 @@ class UsesHTTP2Audit extends Audit {
|
|
|
58
58
|
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS,
|
|
59
59
|
guidanceLevel: 3,
|
|
60
60
|
supportedModes: ['timespan', 'navigation'],
|
|
61
|
-
requiredArtifacts: ['URL', '
|
|
61
|
+
requiredArtifacts: ['URL', 'DevtoolsLog', 'Trace', 'GatherContext', 'SourceMaps'],
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -202,7 +202,7 @@ class UsesHTTP2Audit extends Audit {
|
|
|
202
202
|
* @return {Promise<LH.Audit.Product>}
|
|
203
203
|
*/
|
|
204
204
|
static async audit(artifacts, context) {
|
|
205
|
-
const devtoolsLog = artifacts.
|
|
205
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
206
206
|
const URL = artifacts.URL;
|
|
207
207
|
const networkRecords = await NetworkRecords.request(devtoolsLog, context);
|
|
208
208
|
const classifiedEntities = await EntityClassification.request({URL, devtoolsLog}, context);
|
|
@@ -19,7 +19,7 @@ class FinalScreenshot extends Audit {
|
|
|
19
19
|
scoreDisplayMode: Audit.SCORING_MODES.INFORMATIVE,
|
|
20
20
|
title: 'Final Screenshot',
|
|
21
21
|
description: 'The last screenshot captured of the pageload.',
|
|
22
|
-
requiredArtifacts: ['
|
|
22
|
+
requiredArtifacts: ['Trace', 'GatherContext'],
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -29,7 +29,7 @@ class FinalScreenshot extends Audit {
|
|
|
29
29
|
* @return {Promise<LH.Audit.Product>}
|
|
30
30
|
*/
|
|
31
31
|
static async audit(artifacts, context) {
|
|
32
|
-
const trace = artifacts.
|
|
32
|
+
const trace = artifacts.Trace;
|
|
33
33
|
const processedTrace = await ProcessedTrace.request(trace, context);
|
|
34
34
|
const screenshots = await Screenshots.request(trace, context);
|
|
35
35
|
const {timeOrigin} = processedTrace.timestamps;
|
|
@@ -50,7 +50,7 @@ class FontDisplay extends Audit {
|
|
|
50
50
|
description: str_(UIStrings.description),
|
|
51
51
|
supportedModes: ['navigation'],
|
|
52
52
|
guidanceLevel: 3,
|
|
53
|
-
requiredArtifacts: ['
|
|
53
|
+
requiredArtifacts: ['DevtoolsLog', 'Stylesheets', 'URL'],
|
|
54
54
|
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS,
|
|
55
55
|
};
|
|
56
56
|
}
|
|
@@ -143,7 +143,7 @@ class FontDisplay extends Audit {
|
|
|
143
143
|
* @return {Promise<LH.Audit.Product>}
|
|
144
144
|
*/
|
|
145
145
|
static async audit(artifacts, context) {
|
|
146
|
-
const devtoolsLogs = artifacts.
|
|
146
|
+
const devtoolsLogs = artifacts.DevtoolsLog;
|
|
147
147
|
const networkRecords = await NetworkRecords.request(devtoolsLogs, context);
|
|
148
148
|
const {passingURLs, failingURLs} =
|
|
149
149
|
FontDisplay.findFontDisplayDeclarations(artifacts, PASSING_FONT_DISPLAY_REGEX);
|
package/core/audits/has-hsts.js
CHANGED
|
@@ -46,7 +46,7 @@ class HasHsts extends Audit {
|
|
|
46
46
|
scoreDisplayMode: Audit.SCORING_MODES.INFORMATIVE,
|
|
47
47
|
title: str_(UIStrings.title),
|
|
48
48
|
description: str_(UIStrings.description),
|
|
49
|
-
requiredArtifacts: ['
|
|
49
|
+
requiredArtifacts: ['DevtoolsLog', 'URL'],
|
|
50
50
|
supportedModes: ['navigation'],
|
|
51
51
|
};
|
|
52
52
|
}
|
|
@@ -58,7 +58,7 @@ class HasHsts extends Audit {
|
|
|
58
58
|
* @return {Promise<string[]>}
|
|
59
59
|
*/
|
|
60
60
|
static async getRawHsts(artifacts, context) {
|
|
61
|
-
const devtoolsLog = artifacts.
|
|
61
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
62
62
|
const mainResource =
|
|
63
63
|
await MainResource.request({devtoolsLog, URL: artifacts.URL}, context);
|
|
64
64
|
|
|
@@ -12,9 +12,10 @@ export type ImageWithNaturalDimensions = LH.Artifacts.ImageElement & Required<Pi
|
|
|
12
12
|
declare class ImageSizeResponsive extends Audit {
|
|
13
13
|
/**
|
|
14
14
|
* @param {LH.Artifacts} artifacts
|
|
15
|
-
* @
|
|
15
|
+
* @param {LH.Audit.Context} context
|
|
16
|
+
* @return {Promise<LH.Audit.Product>}
|
|
16
17
|
*/
|
|
17
|
-
static audit(artifacts: LH.Artifacts): LH.Audit.Product
|
|
18
|
+
static audit(artifacts: LH.Artifacts, context: LH.Audit.Context): Promise<LH.Audit.Product>;
|
|
18
19
|
}
|
|
19
20
|
export namespace UIStrings {
|
|
20
21
|
let title: string;
|