lighthouse 9.5.0-dev.20220607 → 9.6.2
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/dist/report/bundle.esm.js +467 -520
- package/dist/report/flow.js +22 -22
- package/dist/report/standalone.js +19 -19
- package/flow-report/src/summary/category.tsx +1 -1
- package/flow-report/src/topbar.tsx +2 -10
- package/flow-report/src/util.ts +1 -1
- package/flow-report/test/topbar-test.tsx +8 -7
- package/jest.config.js +1 -1
- package/lighthouse-cli/.eslintrc.cjs +4 -3
- package/lighthouse-cli/bin.js +1 -0
- package/lighthouse-cli/cli-flags.js +4 -3
- package/lighthouse-cli/commands/commands.js +1 -0
- package/lighthouse-cli/commands/list-audits.js +1 -0
- package/lighthouse-cli/commands/list-locales.js +1 -0
- package/lighthouse-cli/commands/list-trace-categories.js +1 -0
- package/lighthouse-cli/index.js +1 -0
- package/lighthouse-cli/printer.js +1 -0
- package/lighthouse-cli/run.js +24 -9
- package/lighthouse-cli/sentry-prompt.js +1 -0
- package/lighthouse-cli/test/smokehouse/core-tests.js +1 -0
- package/lighthouse-cli/test/smokehouse/frontends/back-compat-util.js +1 -0
- package/lighthouse-cli/test/smokehouse/frontends/lib.js +1 -0
- package/lighthouse-cli/test/smokehouse/frontends/node.js +1 -0
- package/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js +1 -0
- package/lighthouse-cli/test/smokehouse/lib/child-process-error.js +1 -0
- package/lighthouse-cli/test/smokehouse/lib/concurrent-mapper.js +1 -0
- package/lighthouse-cli/test/smokehouse/lib/local-console.js +1 -0
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/bundle.js +23 -109
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/cli.js +3 -2
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/devtools.js +19 -28
- package/lighthouse-cli/test/smokehouse/report-assert.js +4 -3
- package/lighthouse-cli/test/smokehouse/smokehouse.js +1 -1
- package/lighthouse-cli/test/smokehouse/version-check-test.js +3 -0
- package/lighthouse-cli/test/smokehouse/version-check.js +1 -0
- package/lighthouse-core/audits/accessibility/accesskeys.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-allowed-attr.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-command-name.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-hidden-body.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-hidden-focus.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-input-field-name.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-meter-name.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-progressbar-name.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-required-attr.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-required-children.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-required-parent.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-roles.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-toggle-field-name.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-tooltip-name.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-treeitem-name.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-valid-attr-value.js +1 -1
- package/lighthouse-core/audits/accessibility/aria-valid-attr.js +1 -1
- package/lighthouse-core/audits/accessibility/button-name.js +1 -1
- package/lighthouse-core/audits/accessibility/bypass.js +1 -1
- package/lighthouse-core/audits/accessibility/color-contrast.js +1 -1
- package/lighthouse-core/audits/accessibility/definition-list.js +1 -1
- package/lighthouse-core/audits/accessibility/dlitem.js +1 -1
- package/lighthouse-core/audits/accessibility/document-title.js +1 -1
- package/lighthouse-core/audits/accessibility/duplicate-id-active.js +1 -1
- package/lighthouse-core/audits/accessibility/duplicate-id-aria.js +1 -1
- package/lighthouse-core/audits/accessibility/form-field-multiple-labels.js +1 -1
- package/lighthouse-core/audits/accessibility/frame-title.js +1 -1
- package/lighthouse-core/audits/accessibility/heading-order.js +1 -1
- package/lighthouse-core/audits/accessibility/html-has-lang.js +1 -1
- package/lighthouse-core/audits/accessibility/html-lang-valid.js +1 -1
- package/lighthouse-core/audits/accessibility/image-alt.js +1 -1
- package/lighthouse-core/audits/accessibility/input-image-alt.js +1 -1
- package/lighthouse-core/audits/accessibility/label.js +1 -1
- package/lighthouse-core/audits/accessibility/link-name.js +1 -1
- package/lighthouse-core/audits/accessibility/list.js +1 -1
- package/lighthouse-core/audits/accessibility/listitem.js +5 -5
- package/lighthouse-core/audits/accessibility/meta-refresh.js +1 -1
- package/lighthouse-core/audits/accessibility/meta-viewport.js +1 -1
- package/lighthouse-core/audits/accessibility/object-alt.js +1 -1
- package/lighthouse-core/audits/accessibility/tabindex.js +1 -1
- package/lighthouse-core/audits/accessibility/td-headers-attr.js +1 -1
- package/lighthouse-core/audits/accessibility/th-has-data-cells.js +1 -1
- package/lighthouse-core/audits/accessibility/valid-lang.js +1 -1
- package/lighthouse-core/audits/accessibility/video-caption.js +1 -1
- package/lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js +1 -2
- package/lighthouse-core/audits/byte-efficiency/duplicated-javascript.js +12 -11
- package/lighthouse-core/audits/byte-efficiency/efficient-animated-content.js +1 -1
- package/lighthouse-core/audits/byte-efficiency/legacy-javascript.js +24 -22
- package/lighthouse-core/audits/byte-efficiency/offscreen-images.js +2 -3
- package/lighthouse-core/audits/byte-efficiency/render-blocking-resources.js +3 -2
- package/lighthouse-core/audits/byte-efficiency/unminified-css.js +5 -3
- package/lighthouse-core/audits/byte-efficiency/unminified-javascript.js +11 -10
- package/lighthouse-core/audits/byte-efficiency/unused-css-rules.js +1 -0
- package/lighthouse-core/audits/byte-efficiency/unused-javascript.js +8 -11
- package/lighthouse-core/audits/byte-efficiency/uses-responsive-images.js +1 -1
- package/lighthouse-core/audits/byte-efficiency/uses-text-compression.js +1 -1
- package/lighthouse-core/audits/deprecations.js +598 -8
- package/lighthouse-core/audits/diagnostics.js +3 -4
- package/lighthouse-core/audits/dobetterweb/doctype.js +9 -20
- package/lighthouse-core/audits/dobetterweb/geolocation-on-start.js +1 -1
- package/lighthouse-core/audits/dobetterweb/no-document-write.js +1 -1
- package/lighthouse-core/audits/dobetterweb/notification-on-start.js +1 -1
- package/lighthouse-core/audits/dobetterweb/uses-http2.js +1 -2
- package/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js +1 -1
- package/lighthouse-core/audits/errors-in-console.js +2 -2
- package/lighthouse-core/audits/long-tasks.js +2 -3
- package/lighthouse-core/audits/metrics/first-contentful-paint-3g.js +2 -2
- package/lighthouse-core/audits/metrics/first-contentful-paint.js +2 -3
- package/lighthouse-core/audits/metrics/first-meaningful-paint.js +2 -3
- package/lighthouse-core/audits/metrics/interactive.js +2 -3
- package/lighthouse-core/audits/metrics/largest-contentful-paint.js +2 -3
- package/lighthouse-core/audits/metrics/max-potential-fid.js +2 -3
- package/lighthouse-core/audits/metrics/speed-index.js +2 -3
- package/lighthouse-core/audits/metrics/total-blocking-time.js +2 -3
- package/lighthouse-core/audits/metrics.js +2 -3
- package/lighthouse-core/audits/no-unload-listeners.js +15 -7
- package/lighthouse-core/audits/predictive-perf.js +1 -2
- package/lighthouse-core/audits/preload-lcp-image.js +3 -3
- package/lighthouse-core/audits/redirects.js +1 -1
- package/lighthouse-core/audits/script-treemap-data.js +45 -45
- package/lighthouse-core/audits/seo/http-status-code.js +4 -2
- package/lighthouse-core/audits/seo/link-text.js +0 -2
- package/lighthouse-core/audits/server-response-time.js +17 -2
- package/lighthouse-core/audits/service-worker.js +2 -7
- package/lighthouse-core/audits/timing-budget.js +2 -3
- package/lighthouse-core/audits/uses-rel-preconnect.js +1 -1
- package/lighthouse-core/audits/uses-rel-preload.js +1 -1
- package/lighthouse-core/audits/valid-source-maps.js +14 -12
- package/lighthouse-core/audits/violation-audit.js +1 -1
- package/lighthouse-core/audits/work-during-interaction.js +2 -2
- package/lighthouse-core/computed/critical-request-chains.js +9 -5
- package/lighthouse-core/computed/js-bundles.js +11 -11
- package/lighthouse-core/computed/main-resource.js +2 -3
- package/lighthouse-core/computed/metrics/first-contentful-paint-all-frames.js +1 -1
- package/lighthouse-core/computed/metrics/first-contentful-paint.js +1 -1
- package/lighthouse-core/computed/metrics/first-meaningful-paint.js +1 -1
- package/lighthouse-core/computed/metrics/interactive.js +1 -1
- package/lighthouse-core/computed/metrics/lantern-first-contentful-paint.js +1 -1
- package/lighthouse-core/computed/metrics/lantern-first-meaningful-paint.js +1 -1
- package/lighthouse-core/computed/metrics/lantern-interactive.js +1 -1
- package/lighthouse-core/computed/metrics/lantern-largest-contentful-paint.js +1 -1
- package/lighthouse-core/computed/metrics/lantern-max-potential-fid.js +1 -1
- package/lighthouse-core/computed/metrics/lantern-metric.js +5 -3
- package/lighthouse-core/computed/metrics/lantern-speed-index.js +1 -1
- package/lighthouse-core/computed/metrics/lantern-total-blocking-time.js +1 -1
- package/lighthouse-core/computed/metrics/largest-contentful-paint-all-frames.js +1 -1
- package/lighthouse-core/computed/metrics/largest-contentful-paint.js +1 -1
- package/lighthouse-core/computed/metrics/max-potential-fid.js +1 -1
- package/lighthouse-core/computed/metrics/metric.js +0 -1
- package/lighthouse-core/computed/metrics/speed-index.js +1 -1
- package/lighthouse-core/computed/metrics/timing-summary.js +6 -13
- package/lighthouse-core/computed/metrics/total-blocking-time.js +1 -1
- package/lighthouse-core/computed/module-duplication.js +5 -6
- package/lighthouse-core/computed/page-dependency-graph.js +28 -55
- package/lighthouse-core/computed/resource-summary.js +5 -5
- package/lighthouse-core/computed/unused-css.js +7 -6
- package/lighthouse-core/computed/unused-javascript-summary.js +36 -16
- package/lighthouse-core/config/budget.js +2 -2
- package/lighthouse-core/config/default-config.js +1 -2
- package/lighthouse-core/fraggle-rock/api.js +1 -1
- package/lighthouse-core/fraggle-rock/config/default-config.js +0 -3
- package/lighthouse-core/fraggle-rock/gather/base-artifacts.js +3 -6
- package/lighthouse-core/fraggle-rock/gather/driver.js +2 -2
- package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +26 -51
- package/lighthouse-core/fraggle-rock/gather/runner-helpers.js +3 -0
- package/lighthouse-core/fraggle-rock/gather/session.js +22 -23
- package/lighthouse-core/fraggle-rock/gather/snapshot-runner.js +4 -5
- package/lighthouse-core/fraggle-rock/gather/timespan-runner.js +6 -6
- package/lighthouse-core/gather/connections/cri.js +1 -5
- package/lighthouse-core/gather/driver/execution-context.js +2 -5
- package/lighthouse-core/gather/driver/navigation.js +10 -13
- package/lighthouse-core/gather/driver/network-monitor.js +3 -16
- package/lighthouse-core/gather/driver.js +1 -6
- package/lighthouse-core/gather/fetcher.js +210 -34
- package/lighthouse-core/gather/gather-runner.js +17 -13
- package/lighthouse-core/gather/gatherers/accessibility.js +4 -16
- package/lighthouse-core/gather/gatherers/console-messages.js +2 -4
- package/lighthouse-core/gather/gatherers/dobetterweb/doctype.js +2 -4
- package/lighthouse-core/gather/gatherers/full-page-screenshot.js +2 -3
- package/lighthouse-core/gather/gatherers/iframe-elements.js +1 -4
- package/lighthouse-core/gather/gatherers/image-elements.js +0 -2
- package/lighthouse-core/gather/gatherers/js-usage.js +87 -12
- package/lighthouse-core/gather/gatherers/link-elements.js +14 -12
- package/lighthouse-core/gather/gatherers/main-document-content.js +8 -8
- package/lighthouse-core/gather/gatherers/script-elements.js +56 -7
- package/lighthouse-core/gather/gatherers/seo/robots-txt.js +30 -2
- package/lighthouse-core/gather/gatherers/source-maps.js +1 -8
- package/lighthouse-core/gather/gatherers/web-app-manifest.js +2 -2
- package/lighthouse-core/index.js +2 -26
- package/lighthouse-core/lib/cdt/generated/SourceMap.js +1 -1
- package/lighthouse-core/lib/dependency-graph/simulator/network-analyzer.js +29 -8
- package/lighthouse-core/lib/navigation-error.js +4 -13
- package/lighthouse-core/lib/page-functions.js +1 -3
- package/lighthouse-core/lib/script-helpers.js +6 -11
- package/lighthouse-core/lib/url-shim.js +2 -2
- package/lighthouse-core/runner.js +5 -0
- package/lighthouse-core/scripts/manual-chrome-launcher.js +1 -0
- package/lighthouse-core/util-commonjs.js +6 -8
- package/package.json +13 -13
- package/readme.md +1 -1
- package/report/.eslintrc.cjs +1 -3
- package/report/assets/styles.css +5 -10
- package/report/assets/templates.html +9 -10
- package/report/clients/bundle.js +1 -0
- package/report/clients/standalone.js +1 -0
- package/report/generator/report-generator.js +21 -46
- package/report/renderer/api.js +2 -0
- package/report/renderer/category-renderer.js +24 -20
- package/report/renderer/components.js +304 -303
- package/report/renderer/crc-details-renderer.js +24 -21
- package/report/renderer/details-renderer.js +12 -12
- package/report/renderer/dom.js +7 -6
- package/report/renderer/drop-down-menu.js +1 -0
- package/report/renderer/element-screenshot-renderer.js +5 -1
- package/report/renderer/features-util.js +1 -0
- package/report/renderer/i18n.js +62 -118
- package/report/renderer/logger.js +1 -0
- package/report/renderer/open-tab.js +3 -1
- package/report/renderer/performance-category-renderer.js +11 -10
- package/report/renderer/pwa-category-renderer.js +4 -3
- package/report/renderer/report-renderer.js +17 -17
- package/report/renderer/report-ui-features.js +1 -0
- package/report/renderer/snippet-renderer.js +3 -2
- package/report/renderer/swap-locale-feature.js +1 -0
- package/report/renderer/text-encoding.js +1 -0
- package/report/renderer/topbar-features.js +1 -0
- package/report/renderer/util.js +6 -7
- package/report/test/clients/bundle-test.js +5 -0
- package/report/test/generator/file-namer-test.js +1 -0
- package/report/test/generator/report-generator-test.js +20 -25
- package/report/test/renderer/category-renderer-test.js +4 -3
- package/report/test/renderer/components-test.js +3 -0
- package/report/test/renderer/crc-details-renderer-test.js +3 -0
- package/report/test/renderer/details-renderer-test.js +3 -49
- package/report/test/renderer/dom-test.js +3 -0
- package/report/test/renderer/element-screenshot-renderer-test.js +6 -3
- package/report/test/renderer/i18n-test.js +25 -70
- package/report/test/renderer/performance-category-renderer-test.js +5 -14
- package/report/test/renderer/pwa-category-renderer-test.js +4 -3
- package/report/test/renderer/report-renderer-axe-test.js +4 -3
- package/report/test/renderer/report-renderer-test.js +4 -3
- package/report/test/renderer/report-ui-features-test.js +4 -3
- package/report/test/renderer/snippet-renderer-test.js +3 -0
- package/report/test/renderer/text-encoding-test.js +3 -0
- package/report/test/renderer/util-test.js +5 -4
- package/report/test-assets/faux-psi.js +1 -2
- package/shared/localization/format.js +3 -7
- package/shared/localization/locales/en-US.json +238 -55
- package/shared/localization/locales/en-XL.json +238 -55
- package/shared/test/localization/format-test.js +2 -8
- package/shared/test/localization/locales-test.js +2 -0
- package/shared/test/localization/swap-locale-test.js +2 -0
- package/third-party/chromium-synchronization/inspector-issueAdded-types-test.js +2 -0
- package/third-party/chromium-synchronization/installability-errors-test.js +2 -0
- package/tsconfig.json +0 -1
- package/types/artifacts.d.ts +8 -47
- package/types/config.d.ts +0 -2
- package/types/externs.d.ts +2 -3
- package/types/gatherer.d.ts +2 -1
- package/types/global-lh.d.ts +0 -3
- package/types/lhr/lhr.d.ts +2 -2
- package/types/lhr/treemap.d.ts +1 -0
- package/changelog.md +0 -5902
- package/lighthouse-core/audits/script-elements-test-audit.js +0 -30
- package/lighthouse-core/gather/gatherers/scripts.js +0 -154
- package/lighthouse-core/scripts/package.json +0 -4
- package/report/test/.eslintrc.cjs +0 -11
- package/shared/test/localization/.eslintrc.cjs +0 -11
|
@@ -12,6 +12,8 @@ const i18n = require('../../../lighthouse-core/lib/i18n/i18n.js');
|
|
|
12
12
|
const constants = require('../../../lighthouse-core/config/constants.js');
|
|
13
13
|
const locales = require('../../localization/locales.js');
|
|
14
14
|
|
|
15
|
+
/* eslint-env jest */
|
|
16
|
+
|
|
15
17
|
describe('format', () => {
|
|
16
18
|
describe('DEFAULT_LOCALE', () => {
|
|
17
19
|
it('is the same as the default config locale', () => {
|
|
@@ -400,14 +402,6 @@ describe('format', () => {
|
|
|
400
402
|
.toThrow(`Provided value "sirNotAppearingInThisString" does not match any placeholder in ICU message "Hello {timeInMs, number, seconds} World"`);
|
|
401
403
|
});
|
|
402
404
|
|
|
403
|
-
it('throws an error if a value is provided for a message with no placeholders', () => {
|
|
404
|
-
expect(_ => str_(UIStrings.helloWorld, {
|
|
405
|
-
extraCreditValue: 100,
|
|
406
|
-
}))
|
|
407
|
-
// eslint-disable-next-line max-len
|
|
408
|
-
.toThrow(`Provided value "extraCreditValue" does not match any placeholder in ICU message "Hello World"`);
|
|
409
|
-
});
|
|
410
|
-
|
|
411
405
|
it('formats correctly with NaN and Infinity numeric values', () => {
|
|
412
406
|
const helloInfinityStr = str_(UIStrings.helloBytesWorld, {in: Infinity});
|
|
413
407
|
expect(helloInfinityStr).toBeDisplayString('Hello ∞ World');
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
const locales = require('../../localization/locales.js');
|
|
9
9
|
const assert = require('assert').strict;
|
|
10
10
|
|
|
11
|
+
/* eslint-env jest */
|
|
12
|
+
|
|
11
13
|
describe('locales', () => {
|
|
12
14
|
it('has only canonical (or expected-deprecated) language tags', () => {
|
|
13
15
|
// Map of deprecated codes to their canonical version. Depending on the ICU
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
const swapLocale = require('../../localization/swap-locale.js');
|
|
9
9
|
|
|
10
10
|
const lhr = require('../../../lighthouse-core/test/results/sample_v2.json');
|
|
11
|
+
|
|
12
|
+
/* eslint-env jest */
|
|
11
13
|
describe('swap-locale', () => {
|
|
12
14
|
it('does not mutate the original lhr', () => {
|
|
13
15
|
/** @type {LH.Result} */
|
|
@@ -13,6 +13,8 @@ const inspectorIssuesGathererPath = LH_ROOT +
|
|
|
13
13
|
'/lighthouse-core/gather/gatherers/inspector-issues.js';
|
|
14
14
|
const inspectorIssuesGathererSource = fs.readFileSync(inspectorIssuesGathererPath, 'utf-8');
|
|
15
15
|
|
|
16
|
+
/* eslint-env jest */
|
|
17
|
+
|
|
16
18
|
describe('issueAdded types', () => {
|
|
17
19
|
/** @type {Array<LH.Crdp.Audits.InspectorIssueDetails>} */
|
|
18
20
|
let inspectorIssueDetailsTypes;
|
package/tsconfig.json
CHANGED
package/types/artifacts.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ interface UniversalBaseArtifacts {
|
|
|
66
66
|
*/
|
|
67
67
|
interface ContextualBaseArtifacts {
|
|
68
68
|
/** The URL initially requested and the post-redirects URL that was actually loaded. */
|
|
69
|
-
URL:
|
|
69
|
+
URL: {requestedUrl: string, finalUrl: string};
|
|
70
70
|
/** If loading the page failed, value is the error that caused it. Otherwise null. */
|
|
71
71
|
PageLoadError: LighthouseError | null;
|
|
72
72
|
}
|
|
@@ -147,9 +147,8 @@ export interface GathererArtifacts extends PublicGathererArtifacts,LegacyBaseArt
|
|
|
147
147
|
GlobalListeners: Array<Artifacts.GlobalListener>;
|
|
148
148
|
/** The issues surfaced in the devtools Issues panel */
|
|
149
149
|
InspectorIssues: Artifacts.InspectorIssues;
|
|
150
|
-
/** JS coverage information for code used during
|
|
151
|
-
|
|
152
|
-
JsUsage: Record<string, Omit<LH.Crdp.Profiler.ScriptCoverage, 'url'>>;
|
|
150
|
+
/** JS coverage information for code used during page load. Keyed by network URL. */
|
|
151
|
+
JsUsage: Record<string, Array<Omit<LH.Crdp.Profiler.ScriptCoverage, 'url'>>>;
|
|
153
152
|
/** Parsed version of the page's Web App Manifest, or null if none found. */
|
|
154
153
|
Manifest: Artifacts.Manifest | null;
|
|
155
154
|
/** The URL loaded with interception */
|
|
@@ -162,8 +161,6 @@ export interface GathererArtifacts extends PublicGathererArtifacts,LegacyBaseArt
|
|
|
162
161
|
ResponseCompression: {requestId: string, url: string, mimeType: string, transferSize: number, resourceSize: number, gzipSize?: number}[];
|
|
163
162
|
/** Information on fetching and the content of the /robots.txt file. */
|
|
164
163
|
RobotsTxt: {status: number|null, content: string|null, errorMessage?: string};
|
|
165
|
-
/** Information on all scripts in the page. */
|
|
166
|
-
Scripts: Artifacts.Script[];
|
|
167
164
|
/** Version information for all ServiceWorkers active after the first page load. */
|
|
168
165
|
ServiceWorker: {versions: LH.Crdp.ServiceWorker.ServiceWorkerVersion[], registrations: LH.Crdp.ServiceWorker.ServiceWorkerRegistration[]};
|
|
169
166
|
/** Source maps of scripts executed in the page. */
|
|
@@ -187,27 +184,6 @@ declare module Artifacts {
|
|
|
187
184
|
type TaskNode = _TaskNode;
|
|
188
185
|
type MetaElement = Artifacts['MetaElements'][0];
|
|
189
186
|
|
|
190
|
-
interface URL {
|
|
191
|
-
/** URL of the main frame before Lighthouse starts. */
|
|
192
|
-
initialUrl: string;
|
|
193
|
-
/**
|
|
194
|
-
* URL of the initially requested URL during a Lighthouse navigation.
|
|
195
|
-
* Will be `undefined` in timespan/snapshot.
|
|
196
|
-
*/
|
|
197
|
-
requestedUrl?: string;
|
|
198
|
-
/**
|
|
199
|
-
* URL of the last document request during a Lighthouse navigation.
|
|
200
|
-
* Will be `undefined` in timespan/snapshot.
|
|
201
|
-
*/
|
|
202
|
-
mainDocumentUrl?: string;
|
|
203
|
-
/**
|
|
204
|
-
* Will be the same as `mainDocumentUrl` in navigation mode.
|
|
205
|
-
* Wil be the URL of the main frame after Lighthouse finishes in timespan/snapshot.
|
|
206
|
-
* TODO: Use the main frame URL in navigation mode as well.
|
|
207
|
-
*/
|
|
208
|
-
finalUrl: string;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
187
|
interface NodeDetails {
|
|
212
188
|
lhId: string,
|
|
213
189
|
devtoolsNodePath: string,
|
|
@@ -238,7 +214,6 @@ declare module Artifacts {
|
|
|
238
214
|
interface Accessibility {
|
|
239
215
|
violations: Array<AxeRuleResult>;
|
|
240
216
|
notApplicable: Array<Pick<AxeRuleResult, 'id'>>;
|
|
241
|
-
passes: Array<Pick<AxeRuleResult, 'id'>>;
|
|
242
217
|
incomplete: Array<AxeRuleResult>;
|
|
243
218
|
version: string;
|
|
244
219
|
}
|
|
@@ -252,7 +227,6 @@ declare module Artifacts {
|
|
|
252
227
|
name: string;
|
|
253
228
|
publicId: string;
|
|
254
229
|
systemId: string;
|
|
255
|
-
documentCompatMode: string;
|
|
256
230
|
}
|
|
257
231
|
|
|
258
232
|
interface DOMStats {
|
|
@@ -313,16 +287,6 @@ declare module Artifacts {
|
|
|
313
287
|
|
|
314
288
|
interface PasswordInputsWithPreventedPaste {node: NodeDetails}
|
|
315
289
|
|
|
316
|
-
interface Script extends Omit<LH.Crdp.Debugger.ScriptParsedEvent, 'url'|'embedderName'> {
|
|
317
|
-
/**
|
|
318
|
-
* Set by a sourceURL= magic comment if present, otherwise this is the same as the URL.
|
|
319
|
-
* Use this field for presentational purposes only.
|
|
320
|
-
*/
|
|
321
|
-
name: string;
|
|
322
|
-
url: string;
|
|
323
|
-
content?: string;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
290
|
interface ScriptElement {
|
|
327
291
|
type: string | null
|
|
328
292
|
src: string | null
|
|
@@ -334,6 +298,10 @@ declare module Artifacts {
|
|
|
334
298
|
node: NodeDetails | null
|
|
335
299
|
/** Where the script was discovered, either in the head, the body, or network records. */
|
|
336
300
|
source: 'head'|'body'|'network'
|
|
301
|
+
/** The content of the inline script or the network record with the matching URL, null if the script had a src and no network record could be found. */
|
|
302
|
+
content: string | null
|
|
303
|
+
/** The ID of the network request that matched the URL of the src or the main document if inline, null if no request could be found. */
|
|
304
|
+
requestId: string | null
|
|
337
305
|
}
|
|
338
306
|
|
|
339
307
|
/** @see https://sourcemaps.info/spec.html#h.qz3o9nc69um5 */
|
|
@@ -365,8 +333,6 @@ declare module Artifacts {
|
|
|
365
333
|
* parsing the map, errorMessage will be defined instead of map.
|
|
366
334
|
*/
|
|
367
335
|
type SourceMap = {
|
|
368
|
-
/** The DevTools protocol script identifier. */
|
|
369
|
-
scriptId: string;
|
|
370
336
|
/** URL of code that source map applies to. */
|
|
371
337
|
scriptUrl: string
|
|
372
338
|
/** URL of the source map. undefined if from data URL. */
|
|
@@ -374,8 +340,6 @@ declare module Artifacts {
|
|
|
374
340
|
/** Source map data structure. */
|
|
375
341
|
map: RawSourceMap
|
|
376
342
|
} | {
|
|
377
|
-
/** The DevTools protocol script identifier. */
|
|
378
|
-
scriptId: string;
|
|
379
343
|
/** URL of code that source map applies to. */
|
|
380
344
|
scriptUrl: string
|
|
381
345
|
/** URL of the source map. undefined if from data URL. */
|
|
@@ -388,7 +352,7 @@ declare module Artifacts {
|
|
|
388
352
|
|
|
389
353
|
interface Bundle {
|
|
390
354
|
rawMap: RawSourceMap;
|
|
391
|
-
script:
|
|
355
|
+
script: ScriptElement;
|
|
392
356
|
map: TextSourceMap;
|
|
393
357
|
sizes: {
|
|
394
358
|
// TODO(cjamcl): Rename to `sources`.
|
|
@@ -642,7 +606,6 @@ declare module Artifacts {
|
|
|
642
606
|
settings: Immutable<Config.Settings>;
|
|
643
607
|
gatherContext: Artifacts['GatherContext'];
|
|
644
608
|
simulator?: InstanceType<typeof LanternSimulator>;
|
|
645
|
-
URL: Artifacts['URL'];
|
|
646
609
|
}
|
|
647
610
|
|
|
648
611
|
interface MetricComputationData extends MetricComputationDataInput {
|
|
@@ -885,8 +848,6 @@ declare module Artifacts {
|
|
|
885
848
|
stackTrace?: LH.Crdp.Runtime.StackTrace;
|
|
886
849
|
/** The URL of the log/exception, if known. */
|
|
887
850
|
url?: string;
|
|
888
|
-
/** The script id of the log/exception, if known. */
|
|
889
|
-
scriptId?: string;
|
|
890
851
|
/** Line number in the script (0-indexed), if known. */
|
|
891
852
|
lineNumber?: number;
|
|
892
853
|
/** Column number in the script (0-indexed), if known. */
|
package/types/config.d.ts
CHANGED
package/types/externs.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ declare global {
|
|
|
23
23
|
__nativeFetch: typeof fetch,
|
|
24
24
|
__nativeURL: typeof URL;
|
|
25
25
|
__ElementMatches: Element['matches'];
|
|
26
|
-
__HTMLElementBoundingClientRect: HTMLElement['getBoundingClientRect'];
|
|
27
26
|
|
|
28
27
|
/** Used for monitoring long tasks in the test page. */
|
|
29
28
|
____lastLongTask?: number;
|
|
@@ -150,8 +149,8 @@ export interface CliFlags extends Flags {
|
|
|
150
149
|
quiet: boolean;
|
|
151
150
|
/** A flag to print the normalized config for the given config and options, then exit. */
|
|
152
151
|
printConfig: boolean;
|
|
153
|
-
/** Use the
|
|
154
|
-
|
|
152
|
+
/** Use the new Fraggle Rock navigation runner to gather CLI results. */
|
|
153
|
+
fraggleRock: boolean;
|
|
155
154
|
/** Path to the file where precomputed lantern data should be read from. */
|
|
156
155
|
precomputedLanternDataPath?: string;
|
|
157
156
|
/** Path to the file where precomputed lantern data should be written to. */
|
package/types/gatherer.d.ts
CHANGED
|
@@ -42,11 +42,12 @@ declare module Gatherer {
|
|
|
42
42
|
defaultSession: FRProtocolSession;
|
|
43
43
|
executionContext: ExecutionContext;
|
|
44
44
|
fetcher: Fetcher;
|
|
45
|
-
url: () => Promise<string>;
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
/** The limited context interface shared between pre and post Fraggle Rock Lighthouse. */
|
|
49
48
|
interface FRTransitionalContext<TDependencies extends DependencyKey = DefaultDependenciesKey> {
|
|
49
|
+
/** The URL of the page that is currently active. Might be `about:blank` in the before phases */
|
|
50
|
+
url: string;
|
|
50
51
|
/** The gather mode Lighthouse is currently in. */
|
|
51
52
|
gatherMode: GatherMode;
|
|
52
53
|
/** The connection to the page being analyzed. */
|
package/types/global-lh.d.ts
CHANGED
|
@@ -22,7 +22,6 @@ import * as Settings from './lhr/settings';
|
|
|
22
22
|
import StructuredData_ from './structured-data';
|
|
23
23
|
import Treemap_ from './lhr/treemap';
|
|
24
24
|
import UserFlow_ from './user-flow';
|
|
25
|
-
import puppeteer from 'puppeteer-core';
|
|
26
25
|
|
|
27
26
|
// Construct hierarchy of global types under the LH namespace.
|
|
28
27
|
declare global {
|
|
@@ -30,8 +29,6 @@ declare global {
|
|
|
30
29
|
export type ArbitraryEqualityMap = ArbitraryEqualityMap_;
|
|
31
30
|
export type NavigationRequestor = string | (() => Promise<void> | void);
|
|
32
31
|
|
|
33
|
-
export import Puppeteer = puppeteer;
|
|
34
|
-
|
|
35
32
|
// artifacts.d.ts
|
|
36
33
|
export import Artifacts = Artifacts_.Artifacts;
|
|
37
34
|
export import BaseArtifacts = Artifacts_.BaseArtifacts;
|
package/types/lhr/lhr.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ import {ConfigSettings} from './settings';
|
|
|
13
13
|
interface Result {
|
|
14
14
|
/** Gather mode used to collect artifacts for this result. */
|
|
15
15
|
gatherMode: Result.GatherMode;
|
|
16
|
-
/** The URL that
|
|
17
|
-
requestedUrl
|
|
16
|
+
/** The URL that was supplied to Lighthouse and initially navigated to. */
|
|
17
|
+
requestedUrl: string;
|
|
18
18
|
/** The post-redirects URL that Lighthouse loaded. */
|
|
19
19
|
finalUrl: string;
|
|
20
20
|
/** The ISO-8601 timestamp of when the results were generated. */
|