lighthouse 9.5.0-dev.20220711 → 9.5.0-dev.20220714
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/{esm-utils.mjs → esm-utils.js} +2 -2
- package/flow-report/tsconfig.json +1 -0
- package/lighthouse-cli/bin.js +5 -9
- package/lighthouse-cli/commands/list-audits.js +2 -2
- package/lighthouse-cli/commands/list-trace-categories.js +1 -2
- package/lighthouse-cli/run.js +2 -2
- package/lighthouse-cli/test/smokehouse/core-tests.js +3 -2
- package/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js +4 -3
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/bundle.js +8 -4
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/cli.js +1 -1
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/devtools.js +17 -68
- package/lighthouse-cli/test/smokehouse/smokehouse.js +10 -1
- package/lighthouse-core/audits/accessibility/accesskeys.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-allowed-attr.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-command-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-hidden-body.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-hidden-focus.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-input-field-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-meter-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-progressbar-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-required-attr.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-required-children.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-required-parent.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-roles.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-toggle-field-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-tooltip-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-treeitem-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-valid-attr-value.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-valid-attr.js +6 -5
- package/lighthouse-core/audits/accessibility/axe-audit.js +6 -5
- package/lighthouse-core/audits/accessibility/button-name.js +6 -5
- package/lighthouse-core/audits/accessibility/bypass.js +6 -5
- package/lighthouse-core/audits/accessibility/color-contrast.js +6 -5
- package/lighthouse-core/audits/accessibility/definition-list.js +6 -5
- package/lighthouse-core/audits/accessibility/dlitem.js +6 -5
- package/lighthouse-core/audits/accessibility/document-title.js +6 -5
- package/lighthouse-core/audits/accessibility/duplicate-id-active.js +6 -5
- package/lighthouse-core/audits/accessibility/duplicate-id-aria.js +6 -5
- package/lighthouse-core/audits/accessibility/form-field-multiple-labels.js +6 -5
- package/lighthouse-core/audits/accessibility/frame-title.js +6 -5
- package/lighthouse-core/audits/accessibility/heading-order.js +6 -5
- package/lighthouse-core/audits/accessibility/html-has-lang.js +6 -5
- package/lighthouse-core/audits/accessibility/html-lang-valid.js +6 -5
- package/lighthouse-core/audits/accessibility/image-alt.js +6 -5
- package/lighthouse-core/audits/accessibility/input-image-alt.js +6 -5
- package/lighthouse-core/audits/accessibility/label.js +6 -5
- package/lighthouse-core/audits/accessibility/link-name.js +6 -5
- package/lighthouse-core/audits/accessibility/list.js +6 -5
- package/lighthouse-core/audits/accessibility/listitem.js +6 -5
- package/lighthouse-core/audits/accessibility/manual/custom-controls-labels.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/custom-controls-roles.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/focus-traps.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/focusable-controls.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/interactive-element-affordance.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/logical-tab-order.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/managed-focus.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/offscreen-content-hidden.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/use-landmarks.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/visual-order-follows-dom.js +2 -2
- package/lighthouse-core/audits/accessibility/meta-refresh.js +6 -5
- package/lighthouse-core/audits/accessibility/meta-viewport.js +6 -5
- package/lighthouse-core/audits/accessibility/object-alt.js +6 -5
- package/lighthouse-core/audits/accessibility/tabindex.js +6 -5
- package/lighthouse-core/audits/accessibility/td-headers-attr.js +6 -5
- package/lighthouse-core/audits/accessibility/th-has-data-cells.js +6 -5
- package/lighthouse-core/audits/accessibility/valid-lang.js +6 -5
- package/lighthouse-core/audits/accessibility/video-caption.js +6 -5
- package/lighthouse-core/audits/apple-touch-icon.js +5 -5
- package/lighthouse-core/audits/audit.js +4 -4
- package/lighthouse-core/audits/autocomplete.js +6 -6
- package/lighthouse-core/audits/bootup-time.js +9 -9
- package/lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js +12 -12
- package/lighthouse-core/audits/byte-efficiency/duplicated-javascript.js +9 -8
- package/lighthouse-core/audits/byte-efficiency/efficient-animated-content.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/legacy-javascript.js +18 -10
- package/lighthouse-core/audits/byte-efficiency/modern-image-formats.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/offscreen-images.js +11 -11
- package/lighthouse-core/audits/byte-efficiency/render-blocking-resources.js +15 -15
- package/lighthouse-core/audits/byte-efficiency/total-byte-weight.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/unminified-css.js +8 -8
- package/lighthouse-core/audits/byte-efficiency/unminified-javascript.js +8 -8
- package/lighthouse-core/audits/byte-efficiency/unused-css-rules.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/unused-javascript.js +9 -9
- package/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js +10 -10
- package/lighthouse-core/audits/byte-efficiency/uses-optimized-images.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/uses-responsive-images-snapshot.js +8 -8
- package/lighthouse-core/audits/byte-efficiency/uses-responsive-images.js +9 -10
- package/lighthouse-core/audits/byte-efficiency/uses-text-compression.js +7 -7
- package/lighthouse-core/audits/content-width.js +5 -5
- package/lighthouse-core/audits/critical-request-chains.js +6 -6
- package/lighthouse-core/audits/csp-xss.js +7 -10
- package/lighthouse-core/audits/deprecations.js +7 -6
- package/lighthouse-core/audits/diagnostics.js +6 -6
- package/lighthouse-core/audits/dobetterweb/charset.js +6 -9
- package/lighthouse-core/audits/dobetterweb/doctype.js +5 -5
- package/lighthouse-core/audits/dobetterweb/dom-size.js +5 -5
- package/lighthouse-core/audits/dobetterweb/geolocation-on-start.js +5 -5
- package/lighthouse-core/audits/dobetterweb/inspector-issues.js +6 -5
- package/lighthouse-core/audits/dobetterweb/js-libraries.js +5 -5
- package/lighthouse-core/audits/dobetterweb/no-document-write.js +5 -5
- package/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js +12 -8
- package/lighthouse-core/audits/dobetterweb/notification-on-start.js +5 -5
- package/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +5 -5
- package/lighthouse-core/audits/dobetterweb/uses-http2.js +15 -14
- package/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js +5 -5
- package/lighthouse-core/audits/errors-in-console.js +8 -7
- package/lighthouse-core/audits/final-screenshot.js +5 -5
- package/lighthouse-core/audits/font-display.js +8 -8
- package/lighthouse-core/audits/full-page-screenshot.js +2 -2
- package/lighthouse-core/audits/image-aspect-ratio.js +6 -6
- package/lighthouse-core/audits/image-size-responsive.js +6 -6
- package/lighthouse-core/audits/installable-manifest.js +6 -6
- package/lighthouse-core/audits/is-on-https.js +8 -8
- package/lighthouse-core/audits/largest-contentful-paint-element.js +5 -5
- package/lighthouse-core/audits/layout-shift-elements.js +5 -5
- package/lighthouse-core/audits/lcp-lazy-loaded.js +5 -5
- package/lighthouse-core/audits/long-tasks.js +10 -10
- package/lighthouse-core/audits/main-thread-tasks.js +3 -3
- package/lighthouse-core/audits/mainthread-work-breakdown.js +7 -7
- package/lighthouse-core/audits/manual/manual-audit.js +2 -2
- package/lighthouse-core/audits/manual/pwa-cross-browser.js +5 -5
- package/lighthouse-core/audits/manual/pwa-each-page-has-url.js +5 -5
- package/lighthouse-core/audits/manual/pwa-page-transitions.js +5 -5
- package/lighthouse-core/audits/maskable-icon.js +6 -6
- package/lighthouse-core/audits/metrics/cumulative-layout-shift.js +6 -6
- package/lighthouse-core/audits/metrics/experimental-interaction-to-next-paint.js +6 -6
- package/lighthouse-core/audits/metrics/first-contentful-paint-3g.js +6 -4
- package/lighthouse-core/audits/metrics/first-contentful-paint.js +6 -6
- package/lighthouse-core/audits/metrics/first-meaningful-paint.js +6 -6
- package/lighthouse-core/audits/metrics/interactive.js +6 -6
- package/lighthouse-core/audits/metrics/largest-contentful-paint.js +6 -6
- package/lighthouse-core/audits/metrics/max-potential-fid.js +6 -6
- package/lighthouse-core/audits/metrics/speed-index.js +6 -6
- package/lighthouse-core/audits/metrics/total-blocking-time.js +6 -6
- package/lighthouse-core/audits/metrics.js +3 -3
- package/lighthouse-core/audits/multi-check-audit.js +2 -2
- package/lighthouse-core/audits/network-requests.js +5 -5
- package/lighthouse-core/audits/network-rtt.js +7 -7
- package/lighthouse-core/audits/network-server-latency.js +7 -7
- package/lighthouse-core/audits/no-unload-listeners.js +6 -6
- package/lighthouse-core/audits/non-composited-animations.js +6 -5
- package/lighthouse-core/audits/oopif-iframe-test-audit.js +1 -1
- package/lighthouse-core/audits/performance-budget.js +8 -8
- package/lighthouse-core/audits/predictive-perf.js +9 -10
- package/lighthouse-core/audits/preload-fonts.js +8 -7
- package/lighthouse-core/audits/preload-lcp-image.js +11 -11
- package/lighthouse-core/audits/redirects.js +11 -11
- package/lighthouse-core/audits/resource-summary.js +6 -6
- package/lighthouse-core/audits/screenshot-thumbnails.js +5 -5
- package/lighthouse-core/audits/script-elements-test-audit.js +1 -1
- package/lighthouse-core/audits/script-treemap-data.js +7 -6
- package/lighthouse-core/audits/seo/canonical.js +7 -7
- package/lighthouse-core/audits/seo/crawlable-anchors.js +5 -5
- package/lighthouse-core/audits/seo/font-size.js +8 -6
- package/lighthouse-core/audits/seo/hreflang.js +7 -6
- package/lighthouse-core/audits/seo/http-status-code.js +7 -6
- package/lighthouse-core/audits/seo/is-crawlable.js +11 -9
- package/lighthouse-core/audits/seo/link-text.js +7 -6
- package/lighthouse-core/audits/seo/manual/structured-data.js +5 -5
- package/lighthouse-core/audits/seo/meta-description.js +5 -5
- package/lighthouse-core/audits/seo/plugins.js +6 -6
- package/lighthouse-core/audits/seo/robots-txt.js +7 -6
- package/lighthouse-core/audits/seo/tap-targets.js +12 -9
- package/lighthouse-core/audits/server-response-time.js +6 -6
- package/lighthouse-core/audits/service-worker.js +6 -6
- package/lighthouse-core/audits/splash-screen.js +6 -6
- package/lighthouse-core/audits/themed-omnibox.js +7 -7
- package/lighthouse-core/audits/third-party-facades.js +14 -13
- package/lighthouse-core/audits/third-party-summary.js +9 -9
- package/lighthouse-core/audits/timing-budget.js +8 -8
- package/lighthouse-core/audits/unsized-images.js +6 -6
- package/lighthouse-core/audits/user-timings.js +6 -6
- package/lighthouse-core/audits/uses-rel-preconnect.js +15 -15
- package/lighthouse-core/audits/uses-rel-preload.js +13 -13
- package/lighthouse-core/audits/valid-source-maps.js +6 -6
- package/lighthouse-core/audits/viewport.js +6 -6
- package/lighthouse-core/audits/violation-audit.js +3 -3
- package/lighthouse-core/audits/work-during-interaction.js +15 -15
- package/lighthouse-core/computed/computed-artifact.js +3 -3
- package/lighthouse-core/computed/critical-request-chains.js +5 -5
- package/lighthouse-core/computed/image-records.js +3 -3
- package/lighthouse-core/computed/js-bundles.js +4 -4
- package/lighthouse-core/computed/load-simulator.js +8 -5
- package/lighthouse-core/computed/main-resource.js +4 -4
- package/lighthouse-core/computed/main-thread-tasks.js +4 -4
- package/lighthouse-core/computed/manifest-values.js +3 -3
- package/lighthouse-core/computed/metrics/cumulative-layout-shift.js +4 -4
- package/lighthouse-core/computed/metrics/first-contentful-paint-all-frames.js +3 -3
- package/lighthouse-core/computed/metrics/first-contentful-paint.js +4 -4
- package/lighthouse-core/computed/metrics/first-meaningful-paint.js +5 -5
- package/lighthouse-core/computed/metrics/interactive.js +8 -9
- package/lighthouse-core/computed/metrics/lantern-first-contentful-paint.js +7 -7
- package/lighthouse-core/computed/metrics/lantern-first-meaningful-paint.js +5 -5
- package/lighthouse-core/computed/metrics/lantern-interactive.js +7 -7
- package/lighthouse-core/computed/metrics/lantern-largest-contentful-paint.js +5 -5
- package/lighthouse-core/computed/metrics/lantern-max-potential-fid.js +6 -6
- package/lighthouse-core/computed/metrics/lantern-metric.js +10 -10
- package/lighthouse-core/computed/metrics/lantern-speed-index.js +8 -8
- package/lighthouse-core/computed/metrics/lantern-total-blocking-time.js +8 -8
- package/lighthouse-core/computed/metrics/largest-contentful-paint-all-frames.js +5 -4
- package/lighthouse-core/computed/metrics/largest-contentful-paint.js +6 -5
- package/lighthouse-core/computed/metrics/max-potential-fid.js +6 -6
- package/lighthouse-core/computed/metrics/metric.js +6 -6
- package/lighthouse-core/computed/metrics/navigation-metric.js +2 -2
- package/lighthouse-core/computed/metrics/responsiveness.js +3 -3
- package/lighthouse-core/computed/metrics/speed-index.js +5 -5
- package/lighthouse-core/computed/metrics/tbt-utils.js +1 -1
- package/lighthouse-core/computed/metrics/timing-summary.js +15 -15
- package/lighthouse-core/computed/metrics/total-blocking-time.js +7 -7
- package/lighthouse-core/computed/module-duplication.js +3 -3
- package/lighthouse-core/computed/network-analysis.js +4 -4
- package/lighthouse-core/computed/network-records.js +3 -3
- package/lighthouse-core/computed/page-dependency-graph.js +11 -11
- package/lighthouse-core/computed/processed-navigation.js +3 -3
- package/lighthouse-core/computed/processed-trace.js +3 -3
- package/lighthouse-core/computed/resource-summary.js +7 -7
- package/lighthouse-core/computed/screenshots.js +2 -2
- package/lighthouse-core/computed/speedline.js +5 -5
- package/lighthouse-core/computed/trace-of-tab.js +6 -5
- package/lighthouse-core/computed/unused-css.js +4 -4
- package/lighthouse-core/computed/unused-javascript-summary.js +2 -2
- package/lighthouse-core/computed/user-timings.js +3 -3
- package/lighthouse-core/computed/viewport-meta.js +3 -4
- package/lighthouse-core/config/budget.js +1 -1
- package/lighthouse-core/config/config-helpers.js +47 -19
- package/lighthouse-core/config/config-plugin.js +2 -2
- package/lighthouse-core/config/config.js +16 -14
- package/lighthouse-core/config/constants.js +1 -1
- package/lighthouse-core/config/default-config.js +11 -10
- package/lighthouse-core/config/desktop-config.js +2 -2
- package/lighthouse-core/config/experimental-config.js +1 -1
- package/lighthouse-core/config/full-config.js +1 -1
- package/lighthouse-core/config/lr-desktop-config.js +2 -2
- package/lighthouse-core/config/lr-mobile-config.js +1 -1
- package/lighthouse-core/config/metrics-to-audits.js +1 -1
- package/lighthouse-core/config/perf-config.js +1 -1
- package/lighthouse-core/fraggle-rock/api.js +8 -8
- package/lighthouse-core/fraggle-rock/config/config.js +27 -17
- package/lighthouse-core/fraggle-rock/config/default-config.js +5 -5
- package/lighthouse-core/fraggle-rock/config/filters.js +3 -4
- package/lighthouse-core/fraggle-rock/config/validation.js +4 -4
- package/lighthouse-core/fraggle-rock/gather/base-artifacts.js +6 -8
- package/lighthouse-core/fraggle-rock/gather/base-gatherer.js +2 -1
- package/lighthouse-core/fraggle-rock/gather/driver.js +5 -5
- package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +23 -27
- package/lighthouse-core/fraggle-rock/gather/runner-helpers.js +3 -3
- package/lighthouse-core/fraggle-rock/gather/session.js +3 -3
- package/lighthouse-core/fraggle-rock/gather/snapshot-runner.js +7 -11
- package/lighthouse-core/fraggle-rock/gather/timespan-runner.js +8 -12
- package/lighthouse-core/fraggle-rock/user-flow.js +8 -8
- package/lighthouse-core/gather/connections/connection.js +4 -4
- package/lighthouse-core/gather/connections/cri.js +6 -6
- package/lighthouse-core/gather/connections/raw.js +2 -2
- package/lighthouse-core/gather/driver/dom.js +1 -1
- package/lighthouse-core/gather/driver/environment.js +6 -6
- package/lighthouse-core/gather/driver/execution-context.js +2 -2
- package/lighthouse-core/gather/driver/navigation.js +8 -8
- package/lighthouse-core/gather/driver/network-monitor.js +7 -6
- package/lighthouse-core/gather/driver/network.js +2 -2
- package/lighthouse-core/gather/driver/prepare.js +5 -5
- package/lighthouse-core/gather/driver/service-workers.js +1 -1
- package/lighthouse-core/gather/driver/storage.js +4 -4
- package/lighthouse-core/gather/driver/target-manager.js +9 -4
- package/lighthouse-core/gather/driver/wait-for-condition.js +6 -5
- package/lighthouse-core/gather/driver.js +11 -16
- package/lighthouse-core/gather/fetcher.js +1 -1
- package/lighthouse-core/gather/gather-runner.js +22 -22
- package/lighthouse-core/gather/gatherers/accessibility.js +6 -5
- package/lighthouse-core/gather/gatherers/anchor-elements.js +6 -5
- package/lighthouse-core/gather/gatherers/cache-contents.js +2 -2
- package/lighthouse-core/gather/gatherers/console-messages.js +2 -2
- package/lighthouse-core/gather/gatherers/css-usage.js +6 -5
- package/lighthouse-core/gather/gatherers/devtools-log-compat.js +4 -3
- package/lighthouse-core/gather/gatherers/devtools-log.js +3 -3
- package/lighthouse-core/gather/gatherers/dobetterweb/doctype.js +2 -2
- package/lighthouse-core/gather/gatherers/dobetterweb/domstats.js +3 -3
- package/lighthouse-core/gather/gatherers/dobetterweb/optimized-images.js +8 -8
- package/lighthouse-core/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.js +4 -3
- package/lighthouse-core/gather/gatherers/dobetterweb/response-compression.js +10 -10
- package/lighthouse-core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +4 -4
- package/lighthouse-core/gather/gatherers/full-page-screenshot.js +7 -6
- package/lighthouse-core/gather/gatherers/gatherer.js +1 -1
- package/lighthouse-core/gather/gatherers/global-listeners.js +2 -2
- package/lighthouse-core/gather/gatherers/iframe-elements.js +4 -3
- package/lighthouse-core/gather/gatherers/image-elements.js +5 -5
- package/lighthouse-core/gather/gatherers/inputs.js +5 -4
- package/lighthouse-core/gather/gatherers/inspector-issues.js +4 -4
- package/lighthouse-core/gather/gatherers/installability-errors.js +3 -3
- package/lighthouse-core/gather/gatherers/js-usage.js +2 -2
- package/lighthouse-core/gather/gatherers/link-elements.js +7 -7
- package/lighthouse-core/gather/gatherers/main-document-content.js +5 -5
- package/lighthouse-core/gather/gatherers/meta-elements.js +3 -3
- package/lighthouse-core/gather/gatherers/network-user-agent.js +3 -3
- package/lighthouse-core/gather/gatherers/script-elements.js +6 -6
- package/lighthouse-core/gather/gatherers/scripts.js +2 -2
- package/lighthouse-core/gather/gatherers/seo/embedded-content.js +4 -3
- package/lighthouse-core/gather/gatherers/seo/font-size.js +8 -5
- package/lighthouse-core/gather/gatherers/seo/robots-txt.js +2 -2
- package/lighthouse-core/gather/gatherers/seo/tap-targets.js +5 -4
- package/lighthouse-core/gather/gatherers/service-worker.js +3 -3
- package/lighthouse-core/gather/gatherers/source-maps.js +3 -3
- package/lighthouse-core/gather/gatherers/stacks.js +12 -4
- package/lighthouse-core/gather/gatherers/trace-compat.js +4 -3
- package/lighthouse-core/gather/gatherers/trace-elements.js +13 -12
- package/lighthouse-core/gather/gatherers/trace.js +4 -3
- package/lighthouse-core/gather/gatherers/viewport-dimensions.js +2 -2
- package/lighthouse-core/gather/gatherers/web-app-manifest.js +5 -5
- package/lighthouse-core/index.cjs +21 -0
- package/lighthouse-core/index.js +25 -23
- package/lighthouse-core/lib/arbitrary-equality-map.js +2 -2
- package/lighthouse-core/lib/asset-saver.js +15 -12
- package/lighthouse-core/lib/axe.js +9 -4
- package/lighthouse-core/lib/cdt/package.json +4 -0
- package/lighthouse-core/lib/csp-evaluator.js +11 -13
- package/lighthouse-core/lib/dependency-graph/base-node.js +2 -2
- package/lighthouse-core/lib/dependency-graph/cpu-node.js +2 -2
- package/lighthouse-core/lib/dependency-graph/network-node.js +3 -3
- package/lighthouse-core/lib/dependency-graph/simulator/connection-pool.js +4 -4
- package/lighthouse-core/lib/dependency-graph/simulator/dns-cache.js +1 -1
- package/lighthouse-core/lib/dependency-graph/simulator/network-analyzer.js +11 -10
- package/lighthouse-core/lib/dependency-graph/simulator/simulator-timing-map.js +5 -5
- package/lighthouse-core/lib/dependency-graph/simulator/simulator.js +12 -10
- package/lighthouse-core/lib/dependency-graph/simulator/tcp-connection.js +1 -1
- package/lighthouse-core/lib/emulation.js +2 -2
- package/lighthouse-core/lib/i18n/README.md +1 -1
- package/lighthouse-core/lib/i18n/i18n.js +13 -13
- package/lighthouse-core/lib/icons.js +2 -2
- package/lighthouse-core/lib/lantern-trace-saver.js +1 -1
- package/lighthouse-core/lib/lh-env.js +7 -5
- package/lighthouse-core/lib/lh-error.js +4 -4
- package/lighthouse-core/lib/lh-trace-processor.js +3 -3
- package/lighthouse-core/lib/manifest-parser.js +4 -4
- package/lighthouse-core/lib/median-run.js +1 -1
- package/lighthouse-core/lib/minification-estimator.js +1 -1
- package/lighthouse-core/lib/minify-devtoolslog.js +1 -1
- package/lighthouse-core/lib/minify-trace.js +3 -3
- package/lighthouse-core/lib/navigation-error.js +6 -6
- package/lighthouse-core/lib/network-recorder.js +4 -4
- package/lighthouse-core/lib/network-request.js +2 -3
- package/lighthouse-core/lib/page-functions.js +2 -1
- package/lighthouse-core/lib/proto-preprocessor.js +7 -6
- package/lighthouse-core/lib/rect-helpers.js +1 -1
- package/lighthouse-core/lib/script-helpers.js +4 -1
- package/lighthouse-core/lib/sentry.js +4 -4
- package/lighthouse-core/lib/stack-packs.js +4 -4
- package/lighthouse-core/lib/statistics.js +1 -1
- package/lighthouse-core/lib/tappable-rects.js +2 -2
- package/lighthouse-core/lib/third-party-web.js +2 -2
- package/lighthouse-core/lib/timing-trace-saver.js +1 -1
- package/lighthouse-core/lib/tracehouse/cpu-profile-model.js +8 -8
- package/lighthouse-core/lib/tracehouse/main-thread-tasks.js +2 -2
- package/lighthouse-core/lib/tracehouse/task-groups.js +1 -1
- package/lighthouse-core/lib/tracehouse/task-summary.js +2 -2
- package/lighthouse-core/lib/tracehouse/trace-processor.js +2 -3
- package/lighthouse-core/lib/traces/pwmetrics-events.js +4 -3
- package/lighthouse-core/lib/url-shim.js +6 -4
- package/lighthouse-core/package.json +4 -0
- package/lighthouse-core/runner.js +40 -34
- package/lighthouse-core/scoring.js +2 -2
- package/lighthouse-core/{util-commonjs.js → util.cjs} +0 -0
- package/package.json +4 -2
- package/report/test/generator/report-generator-test.js +4 -3
- package/report/test/renderer/report-renderer-axe-test.js +2 -2
- package/root.js +10 -2
- package/shared/package.json +4 -0
- package/shared/test/localization/format-test.js +23 -13
- package/shared/test/localization/swap-locale-test.js +1 -0
- package/third-party/axe/valid-langs.js +1 -1
- package/third-party/chromium-synchronization/inspector-issueAdded-types-test.js +3 -3
- package/third-party/chromium-synchronization/installability-errors-test.js +3 -3
- package/third-party/download-content-shell/download-content-shell.js +6 -5
- package/third-party/download-content-shell/utils.js +8 -8
- package/tsconfig.json +3 -1
- package/types/artifacts.d.ts +9 -11
- package/types/audit.d.ts +2 -2
- package/types/config.d.ts +1 -1
- package/types/cssstyle/index.d.ts +1 -1
- package/types/gatherer.d.ts +7 -7
- package/types/global-lh.d.ts +2 -2
- package/types/smokehouse.d.ts +2 -0
|
@@ -7,18 +7,16 @@
|
|
|
7
7
|
|
|
8
8
|
/** @typedef {import('csp_evaluator/finding').Finding} Finding */
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
evaluateForFailure,
|
|
12
|
-
|
|
13
|
-
evaluateForWarnings,
|
|
14
|
-
} = require('csp_evaluator/dist/lighthouse/lighthouse_checks.js');
|
|
15
|
-
const {Type} = require('csp_evaluator/dist/finding.js');
|
|
16
|
-
const {CspParser} = require('csp_evaluator/dist/parser.js');
|
|
17
|
-
const {Directive} = require('csp_evaluator/dist/csp.js');
|
|
10
|
+
import {
|
|
11
|
+
evaluateForFailure, evaluateForSyntaxErrors, evaluateForWarnings,
|
|
12
|
+
} from 'csp_evaluator/dist/lighthouse/lighthouse_checks.js';
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
import {Type} from 'csp_evaluator/dist/finding.js';
|
|
15
|
+
import {CspParser} from 'csp_evaluator/dist/parser.js';
|
|
16
|
+
import {Directive} from 'csp_evaluator/dist/csp.js';
|
|
17
|
+
import log from 'lighthouse-logger';
|
|
18
|
+
import * as i18n from '../lib/i18n/i18n.js';
|
|
19
|
+
import {isIcuMessage} from '../../shared/localization/format.js';
|
|
22
20
|
|
|
23
21
|
const UIStrings = {
|
|
24
22
|
/** Message shown when a CSP does not have a base-uri directive. Shown in a table with a list of other CSP vulnerabilities and suggestions. "CSP" stands for "Content Security Policy". "base-uri", "'none'", and "'self'" do not need to be translated. */
|
|
@@ -90,7 +88,7 @@ const UIStrings = {
|
|
|
90
88
|
'Plain URL schemes allow scripts to be sourced from an unsafe domain.',
|
|
91
89
|
};
|
|
92
90
|
|
|
93
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
91
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
94
92
|
|
|
95
93
|
/** @type {Record<number, string|LH.IcuMessage|Record<string, LH.IcuMessage>>} */
|
|
96
94
|
const FINDING_TO_UI_STRING = {
|
|
@@ -165,7 +163,7 @@ function evaluateRawCspsForXss(rawCsps) {
|
|
|
165
163
|
return {bypasses, warnings, syntax};
|
|
166
164
|
}
|
|
167
165
|
|
|
168
|
-
|
|
166
|
+
export {
|
|
169
167
|
getTranslatedDescription,
|
|
170
168
|
evaluateRawCspsForXss,
|
|
171
169
|
parseCsp,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* A union of all types derived from BaseNode, allowing type check discrimination
|
|
10
10
|
* based on `node.type`. If a new node type is created, it should be added here.
|
|
11
|
-
* @typedef {import('./cpu-node.js') | import('./network-node.js')} Node
|
|
11
|
+
* @typedef {import('./cpu-node.js').CPUNode | import('./network-node.js').NetworkNode} Node
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -360,4 +360,4 @@ BaseNode.TYPES = /** @type {{NETWORK: 'network', CPU: 'cpu'}} */({
|
|
|
360
360
|
CPU: 'cpu',
|
|
361
361
|
});
|
|
362
362
|
|
|
363
|
-
|
|
363
|
+
export {BaseNode};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import {BaseNode} from './base-node.js';
|
|
9
9
|
|
|
10
10
|
class CPUNode extends BaseNode {
|
|
11
11
|
/**
|
|
@@ -83,4 +83,4 @@ class CPUNode extends BaseNode {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
export {CPUNode};
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import {BaseNode} from './base-node.js';
|
|
9
|
+
import {NetworkRequest} from '../network-request.js';
|
|
10
10
|
|
|
11
11
|
class NetworkNode extends BaseNode {
|
|
12
12
|
/**
|
|
@@ -96,4 +96,4 @@ class NetworkNode extends BaseNode {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
export {NetworkNode};
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import {NetworkAnalyzer} from './network-analyzer.js';
|
|
9
|
+
import {TcpConnection} from './tcp-connection.js';
|
|
10
10
|
|
|
11
11
|
const DEFAULT_SERVER_RESPONSE_TIME = 30;
|
|
12
12
|
const TLS_SCHEMES = ['https', 'wss'];
|
|
@@ -15,7 +15,7 @@ const TLS_SCHEMES = ['https', 'wss'];
|
|
|
15
15
|
// https://cs.chromium.org/chromium/src/net/socket/client_socket_pool_manager.cc?type=cs&q="int+g_max_sockets_per_group"
|
|
16
16
|
const CONNECTIONS_PER_ORIGIN = 6;
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
export class ConnectionPool {
|
|
19
19
|
/**
|
|
20
20
|
* @param {LH.Artifacts.NetworkRequest[]} records
|
|
21
21
|
* @param {Required<LH.Gatherer.Simulation.Options>} options
|
|
@@ -168,4 +168,4 @@ module.exports = class ConnectionPool {
|
|
|
168
168
|
this._connectionsByRecord.delete(record);
|
|
169
169
|
this._connectionsInUse.delete(connection);
|
|
170
170
|
}
|
|
171
|
-
}
|
|
171
|
+
}
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
+
import URL from '../../url-shim.js';
|
|
9
|
+
|
|
8
10
|
const INITIAL_CWD = 14 * 1024;
|
|
9
|
-
const URL = require('../../url-shim.js');
|
|
10
11
|
|
|
11
12
|
// Assume that 40% of TTFB was server response time by default for static assets
|
|
12
13
|
const DEFAULT_SERVER_RESPONSE_PERCENTAGE = 0.4;
|
|
@@ -47,7 +48,7 @@ class NetworkAnalyzer {
|
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
50
|
* @param {number[]} values
|
|
50
|
-
* @return {
|
|
51
|
+
* @return {Summary}
|
|
51
52
|
*/
|
|
52
53
|
static getSummary(values) {
|
|
53
54
|
values.sort((a, b) => a - b);
|
|
@@ -62,7 +63,7 @@ class NetworkAnalyzer {
|
|
|
62
63
|
|
|
63
64
|
/**
|
|
64
65
|
* @param {Map<string,number[]>} values
|
|
65
|
-
* @return {Map<string,
|
|
66
|
+
* @return {Map<string, Summary>}
|
|
66
67
|
*/
|
|
67
68
|
static summarize(values) {
|
|
68
69
|
const summaryByKey = new Map();
|
|
@@ -302,8 +303,8 @@ class NetworkAnalyzer {
|
|
|
302
303
|
* is unavailable.
|
|
303
304
|
*
|
|
304
305
|
* @param {LH.Artifacts.NetworkRequest[]} records
|
|
305
|
-
* @param {
|
|
306
|
-
* @return {Map<string,
|
|
306
|
+
* @param {RTTEstimateOptions} [options]
|
|
307
|
+
* @return {Map<string, Summary>}
|
|
307
308
|
*/
|
|
308
309
|
static estimateRTTByOrigin(records, options) {
|
|
309
310
|
const {
|
|
@@ -354,8 +355,8 @@ class NetworkAnalyzer {
|
|
|
354
355
|
* estimated automatically if not provided.
|
|
355
356
|
*
|
|
356
357
|
* @param {LH.Artifacts.NetworkRequest[]} records
|
|
357
|
-
* @param {
|
|
358
|
-
* @return {Map<string,
|
|
358
|
+
* @param {RTTEstimateOptions & {rttByOrigin?: Map<string, number>}} [options]
|
|
359
|
+
* @return {Map<string, Summary>}
|
|
359
360
|
*/
|
|
360
361
|
static estimateServerResponseTimeByOrigin(records, options) {
|
|
361
362
|
let rttByOrigin = (options || {}).rttByOrigin;
|
|
@@ -457,10 +458,10 @@ class NetworkAnalyzer {
|
|
|
457
458
|
}
|
|
458
459
|
}
|
|
459
460
|
|
|
460
|
-
|
|
461
|
+
export {NetworkAnalyzer};
|
|
461
462
|
|
|
462
463
|
/**
|
|
463
|
-
* @typedef
|
|
464
|
+
* @typedef Summary
|
|
464
465
|
* @property {number} min
|
|
465
466
|
* @property {number} max
|
|
466
467
|
* @property {number} avg
|
|
@@ -468,7 +469,7 @@ module.exports = NetworkAnalyzer;
|
|
|
468
469
|
*/
|
|
469
470
|
|
|
470
471
|
/**
|
|
471
|
-
* @typedef
|
|
472
|
+
* @typedef RTTEstimateOptions
|
|
472
473
|
* @property {boolean} [forceCoarseEstimates] TCP connection handshake information will be used when available, but in some circumstances this data can be unreliable. This flag exposes an option to ignore the handshake data and use the coarse download/TTFB timing data.
|
|
473
474
|
* @property {number} [coarseEstimateMultiplier] Coarse estimates include lots of extra time and noise multiply by some factor to deflate the estimates a bit.
|
|
474
475
|
* @property {boolean} [useDownloadEstimates] Useful for testing to isolate the different methods of estimation.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import {BaseNode} from '../base-node.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @fileoverview
|
|
@@ -16,9 +16,9 @@ const BaseNode = require('../base-node.js');
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
/** @typedef {
|
|
20
|
-
/** @typedef {import('../network-node')} NetworkNode */
|
|
21
|
-
/** @typedef {import('../cpu-node')} CpuNode */
|
|
19
|
+
/** @typedef {import('../base-node.js').Node} Node */
|
|
20
|
+
/** @typedef {import('../network-node').NetworkNode} NetworkNode */
|
|
21
|
+
/** @typedef {import('../cpu-node').CPUNode} CpuNode */
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* @typedef NodeTimingComplete
|
|
@@ -209,4 +209,4 @@ class SimulatorTimingMap {
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
|
|
212
|
+
export {SimulatorTimingMap};
|
|
@@ -5,16 +5,18 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import {BaseNode} from '../base-node.js';
|
|
9
|
+
import {TcpConnection} from './tcp-connection.js';
|
|
10
|
+
import {ConnectionPool} from './connection-pool.js';
|
|
11
|
+
import {DNSCache} from './dns-cache.js';
|
|
12
|
+
import {SimulatorTimingMap} from './simulator-timing-map.js';
|
|
13
|
+
import * as constants from '../../../config/constants.js';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/** @typedef {import('../
|
|
15
|
+
const mobileSlow4G = constants.throttling.mobileSlow4G;
|
|
16
|
+
|
|
17
|
+
/** @typedef {import('../base-node.js').Node} Node */
|
|
18
|
+
/** @typedef {import('../network-node').NetworkNode} NetworkNode */
|
|
19
|
+
/** @typedef {import('../cpu-node').CPUNode} CpuNode */
|
|
18
20
|
|
|
19
21
|
// see https://cs.chromium.org/search/?q=kDefaultMaxNumDelayableRequestsPerClient&sq=package:chromium&type=cs
|
|
20
22
|
const DEFAULT_MAXIMUM_CONCURRENT_REQUESTS = 10;
|
|
@@ -520,4 +522,4 @@ class Simulator {
|
|
|
520
522
|
}
|
|
521
523
|
}
|
|
522
524
|
|
|
523
|
-
|
|
525
|
+
export {Simulator};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import {lighthouseVersion} from '../../root.js';
|
|
9
9
|
|
|
10
10
|
const NO_THROTTLING_METRICS = {
|
|
11
11
|
latency: 0,
|
|
@@ -153,7 +153,7 @@ function clearCPUThrottling(session) {
|
|
|
153
153
|
return session.sendCommand('Emulation.setCPUThrottlingRate', NO_CPU_THROTTLE_METRICS);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
export {
|
|
157
157
|
emulate,
|
|
158
158
|
throttle,
|
|
159
159
|
clearThrottling,
|
|
@@ -232,7 +232,7 @@ CTC is a name that is distinct and identifies this as the Chrome translation for
|
|
|
232
232
|
};
|
|
233
233
|
|
|
234
234
|
// Init the strings in this file with the i18n system.
|
|
235
|
-
const str_ = i18n.createIcuMessageFn(
|
|
235
|
+
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
236
236
|
|
|
237
237
|
// Create an IcuMessage instance with a replacement value for our localizable string.
|
|
238
238
|
const icuMessage = str_(UIStrings.totalSize, {totalBytes: 10240});
|
|
@@ -7,16 +7,14 @@
|
|
|
7
7
|
|
|
8
8
|
/** @typedef {import('../../../shared/localization/locales').LhlMessages} LhlMessages */
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
DEFAULT_LOCALE,
|
|
19
|
-
} = require('../../../shared/localization/format.js');
|
|
10
|
+
import path from 'path';
|
|
11
|
+
|
|
12
|
+
import lookupClosestLocale from 'lookup-closest-locale';
|
|
13
|
+
import {getAvailableLocales} from '../../../shared/localization/format.js';
|
|
14
|
+
import log from 'lighthouse-logger';
|
|
15
|
+
import {LH_ROOT} from '../../../root.js';
|
|
16
|
+
import {isIcuMessage, formatMessage, DEFAULT_LOCALE} from '../../../shared/localization/format.js';
|
|
17
|
+
import {getModulePath} from '../../../esm-utils.js';
|
|
20
18
|
|
|
21
19
|
const UIStrings = {
|
|
22
20
|
/** Used to show the duration in milliseconds that something lasted. The `{timeInMs}` placeholder will be replaced with the time duration, shown in milliseconds (e.g. 63 ms) */
|
|
@@ -172,6 +170,8 @@ function lookupLocale(locales, possibleLocales) {
|
|
|
172
170
|
* @param {Record<string, string>} fileStrings
|
|
173
171
|
*/
|
|
174
172
|
function createIcuMessageFn(filename, fileStrings) {
|
|
173
|
+
filename = filename.replace('file://', '');
|
|
174
|
+
|
|
175
175
|
/**
|
|
176
176
|
* Combined so fn can access both caller's strings and i18n.UIStrings shared across LH.
|
|
177
177
|
* @type {Record<string, string>}
|
|
@@ -188,7 +188,7 @@ function createIcuMessageFn(filename, fileStrings) {
|
|
|
188
188
|
const keyname = Object.keys(mergedStrings).find(key => mergedStrings[key] === message);
|
|
189
189
|
if (!keyname) throw new Error(`Could not locate: ${message}`);
|
|
190
190
|
|
|
191
|
-
const filenameToLookup = keyname in fileStrings ? filename :
|
|
191
|
+
const filenameToLookup = keyname in fileStrings ? filename : getModulePath(import.meta);
|
|
192
192
|
const unixStyleFilename = path.relative(LH_ROOT, filenameToLookup).replace(/\\/g, '/');
|
|
193
193
|
const i18nId = `${unixStyleFilename} | ${keyname}`;
|
|
194
194
|
|
|
@@ -211,11 +211,11 @@ function isStringOrIcuMessage(value) {
|
|
|
211
211
|
return typeof value === 'string' || isIcuMessage(value);
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
|
|
214
|
+
export {
|
|
215
215
|
UIStrings,
|
|
216
216
|
lookupLocale,
|
|
217
217
|
createIcuMessageFn,
|
|
218
218
|
isStringOrIcuMessage,
|
|
219
219
|
// TODO: exported for backwards compatibility. Consider removing on future breaking change.
|
|
220
|
-
createMessageInstanceIdFn
|
|
220
|
+
createIcuMessageFn as createMessageInstanceIdFn,
|
|
221
221
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import URL from './url-shim.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @param {NonNullable<LH.Artifacts.Manifest['value']>} manifest
|
|
@@ -78,7 +78,7 @@ function containsMaskableIcon(manifest) {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
export {
|
|
82
82
|
doExist,
|
|
83
83
|
pngSizedAtLeast,
|
|
84
84
|
containsMaskableIcon,
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import process from 'process';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
// NODE_ENV is set to test by mocha-setup.js and the smokehouse CLI runner
|
|
11
|
+
// CI as a catchall for everything we do in GitHub Actions
|
|
12
|
+
const isUnderTest = !!process.env.CI || process.env.NODE_ENV === 'test';
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
isUnderTest,
|
|
14
16
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import * as i18n from './i18n/i18n.js';
|
|
9
9
|
|
|
10
10
|
/* eslint-disable max-len */
|
|
11
11
|
const UIStrings = {
|
|
@@ -89,7 +89,7 @@ const UIStrings = {
|
|
|
89
89
|
oldChromeDoesNotSupportFeature: 'This version of Chrome is too old to support \'{featureName}\'. Use a newer version to see full results.',
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
92
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
/**
|
|
@@ -417,5 +417,5 @@ const ERRORS = {
|
|
|
417
417
|
LighthouseError.errors = ERRORS;
|
|
418
418
|
LighthouseError.NO_ERROR = 'NO_ERROR';
|
|
419
419
|
LighthouseError.UNKNOWN_ERROR = 'UNKNOWN_ERROR';
|
|
420
|
-
|
|
421
|
-
|
|
420
|
+
|
|
421
|
+
export {LighthouseError, UIStrings};
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import {LighthouseError} from '../lib/lh-error.js';
|
|
9
|
+
import {TraceProcessor} from '../lib/tracehouse/trace-processor.js';
|
|
10
10
|
|
|
11
11
|
// TraceProcessor throws generic errors, but we'd like our special localized and code-specific LighthouseError
|
|
12
12
|
// objects to be thrown instead.
|
|
@@ -43,4 +43,4 @@ class LHTraceProcessor extends TraceProcessor {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
export default LHTraceProcessor;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import URL from './url-shim.js';
|
|
9
|
+
import cssParsers from 'cssstyle/lib/parsers.js';
|
|
10
10
|
|
|
11
11
|
const ALLOWED_DISPLAY_VALUES = [
|
|
12
12
|
'fullscreen',
|
|
@@ -458,7 +458,7 @@ function parseBackgroundColor(jsonInput) {
|
|
|
458
458
|
* @param {string} manifestUrl URL of manifest file.
|
|
459
459
|
* @param {string} documentUrl URL of document containing manifest link element.
|
|
460
460
|
*/
|
|
461
|
-
function
|
|
461
|
+
function parseManifest(string, manifestUrl, documentUrl) {
|
|
462
462
|
if (manifestUrl === undefined || documentUrl === undefined) {
|
|
463
463
|
throw new Error('Manifest and document URLs required for manifest parsing.');
|
|
464
464
|
}
|
|
@@ -510,4 +510,4 @@ function parse(string, manifestUrl, documentUrl) {
|
|
|
510
510
|
};
|
|
511
511
|
}
|
|
512
512
|
|
|
513
|
-
|
|
513
|
+
export {parseManifest};
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* - lighthouse-core/lib/tracehouse/trace-processor.js
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
import {TraceProcessor} from './tracehouse/trace-processor.js';
|
|
19
19
|
|
|
20
20
|
const toplevelTaskNames = new Set([
|
|
21
21
|
'RunTask', // m71+
|
|
@@ -94,7 +94,7 @@ const traceEventsToKeepInProcess = new Set([
|
|
|
94
94
|
* @param {LH.TraceEvent[]} events
|
|
95
95
|
*/
|
|
96
96
|
function filterOutUnnecessaryTasksByNameAndDuration(events) {
|
|
97
|
-
const {pid} =
|
|
97
|
+
const {pid} = TraceProcessor.findMainFrameIds(events);
|
|
98
98
|
|
|
99
99
|
return events.filter(evt => {
|
|
100
100
|
if (toplevelTaskNames.has(evt.name) && evt.dur < 1000) return false;
|
|
@@ -170,4 +170,4 @@ function minifyTrace(inputTrace) {
|
|
|
170
170
|
return {traceEvents: filterTraceEvents(inputTrace.traceEvents)};
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
export {minifyTrace};
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import {LighthouseError} from './lh-error.js';
|
|
9
|
+
import {NetworkAnalyzer} from './dependency-graph/simulator/network-analyzer.js';
|
|
10
|
+
import {NetworkRequest} from './network-request.js';
|
|
11
|
+
import * as i18n from '../lib/i18n/i18n.js';
|
|
12
12
|
|
|
13
13
|
const UIStrings = {
|
|
14
14
|
/**
|
|
@@ -19,7 +19,7 @@ const UIStrings = {
|
|
|
19
19
|
'The page MIME type is XHTML: Lighthouse does not explicitly support this document type',
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
22
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
23
23
|
|
|
24
24
|
// MIME types are case-insensitive but Chrome normalizes MIME types to be lowercase.
|
|
25
25
|
const HTML_MIME_TYPE = 'text/html';
|
|
@@ -165,7 +165,7 @@ function getPageLoadError(navigationError, context) {
|
|
|
165
165
|
return navigationError;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
export {
|
|
169
169
|
getNetworkError,
|
|
170
170
|
getInterstitialError,
|
|
171
171
|
getPageLoadError,
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import log from 'lighthouse-logger';
|
|
9
|
+
import {NetworkRequest} from './network-request.js';
|
|
10
|
+
import {EventEmitter} from 'events';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @typedef {{
|
|
@@ -325,4 +325,4 @@ class NetworkRecorder extends RequestEventEmitter {
|
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
|
|
328
|
+
export {NetworkRecorder};
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
* @see https://cs.chromium.org/chromium/src/third_party/blink/renderer/devtools/front_end/sdk/NetworkManager.js
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
import URL from './url-shim.js';
|
|
16
15
|
|
|
17
16
|
// Lightrider X-Header names for timing information.
|
|
18
17
|
// See: _updateTransferSizeForLightrider and _updateTimingsForLightrider.
|
|
@@ -537,4 +536,4 @@ NetworkRequest.HEADER_TOTAL = HEADER_TOTAL;
|
|
|
537
536
|
NetworkRequest.HEADER_FETCHED_SIZE = HEADER_FETCHED_SIZE;
|
|
538
537
|
NetworkRequest.HEADER_PROTOCOL_IS_H2 = HEADER_PROTOCOL_IS_H2;
|
|
539
538
|
|
|
540
|
-
|
|
539
|
+
export {NetworkRequest};
|
|
@@ -537,7 +537,8 @@ const getNodeDetailsString = `function getNodeDetails(element) {
|
|
|
537
537
|
return (${getNodeDetails.toString()})(element);
|
|
538
538
|
}`;
|
|
539
539
|
|
|
540
|
-
|
|
540
|
+
// TODO(esmodules): should this be refactored to export each function individually?
|
|
541
|
+
export const pageFunctions = {
|
|
541
542
|
wrapRuntimeEvalErrorInBrowserString: wrapRuntimeEvalErrorInBrowser.toString(),
|
|
542
543
|
wrapRuntimeEvalErrorInBrowser,
|
|
543
544
|
getElementsInDocument,
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
import fs from 'fs';
|
|
10
|
+
import esMain from 'es-main';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* @fileoverview Helper functions to transform an LHR into a proto-ready LHR.
|
|
@@ -108,7 +109,7 @@ function processForProto(lhr) {
|
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
// Test if called from the CLI or as a module.
|
|
111
|
-
if (
|
|
112
|
+
if (esMain(import.meta)) {
|
|
112
113
|
// read in the argv for the input & output
|
|
113
114
|
const args = process.argv.slice(2);
|
|
114
115
|
let input;
|
|
@@ -126,8 +127,8 @@ if (require.main === module) {
|
|
|
126
127
|
// write to output from argv
|
|
127
128
|
fs.writeFileSync(output, JSON.stringify(report), 'utf-8');
|
|
128
129
|
}
|
|
129
|
-
} else {
|
|
130
|
-
module.exports = {
|
|
131
|
-
processForProto,
|
|
132
|
-
};
|
|
133
130
|
}
|
|
131
|
+
|
|
132
|
+
export {
|
|
133
|
+
processForProto,
|
|
134
|
+
};
|