lighthouse 9.5.0-dev.20230118 → 9.5.0-dev.20230119
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/bin.d.ts +5 -0
- package/cli/cli-flags.d.ts +258 -0
- package/cli/commands/commands.d.ts +4 -0
- package/cli/commands/list-audits.d.ts +2 -0
- package/cli/commands/list-locales.d.ts +2 -0
- package/cli/commands/list-trace-categories.d.ts +2 -0
- package/cli/index.d.ts +3 -0
- package/cli/printer.d.ts +28 -0
- package/cli/run.d.ts +24 -0
- package/cli/sentry-prompt.d.ts +5 -0
- package/cli/test/smokehouse/config/exclusions.d.ts +12 -0
- package/cli/test/smokehouse/core-tests.d.ts +4 -0
- package/cli/test/smokehouse/frontends/back-compat-util.d.ts +16 -0
- package/cli/test/smokehouse/frontends/lib.d.ts +8 -0
- package/cli/test/smokehouse/frontends/node.d.ts +2 -0
- package/cli/test/smokehouse/frontends/smokehouse-bin.d.ts +3 -0
- package/cli/test/smokehouse/lib/child-process-error.d.ts +21 -0
- package/cli/test/smokehouse/lib/concurrent-mapper.d.ts +78 -0
- package/cli/test/smokehouse/lib/local-console.d.ts +33 -0
- package/cli/test/smokehouse/lighthouse-runners/bundle.d.ts +16 -0
- package/cli/test/smokehouse/lighthouse-runners/cli.d.ts +18 -0
- package/cli/test/smokehouse/lighthouse-runners/devtools.d.ts +23 -0
- package/cli/test/smokehouse/report-assert-test.d.ts +2 -0
- package/cli/test/smokehouse/report-assert.d.ts +50 -0
- package/cli/test/smokehouse/smokehouse.d.ts +35 -0
- package/cli/test/smokehouse/version-check-test.d.ts +2 -0
- package/cli/test/smokehouse/version-check.d.ts +15 -0
- package/core/audits/accessibility/accesskeys.d.ts +10 -0
- package/core/audits/accessibility/aria-allowed-attr.d.ts +10 -0
- package/core/audits/accessibility/aria-command-name.d.ts +10 -0
- package/core/audits/accessibility/aria-hidden-body.d.ts +10 -0
- package/core/audits/accessibility/aria-hidden-focus.d.ts +10 -0
- package/core/audits/accessibility/aria-input-field-name.d.ts +10 -0
- package/core/audits/accessibility/aria-meter-name.d.ts +10 -0
- package/core/audits/accessibility/aria-progressbar-name.d.ts +10 -0
- package/core/audits/accessibility/aria-required-attr.d.ts +10 -0
- package/core/audits/accessibility/aria-required-children.d.ts +10 -0
- package/core/audits/accessibility/aria-required-parent.d.ts +10 -0
- package/core/audits/accessibility/aria-roles.d.ts +10 -0
- package/core/audits/accessibility/aria-toggle-field-name.d.ts +10 -0
- package/core/audits/accessibility/aria-tooltip-name.d.ts +10 -0
- package/core/audits/accessibility/aria-treeitem-name.d.ts +10 -0
- package/core/audits/accessibility/aria-valid-attr-value.d.ts +10 -0
- package/core/audits/accessibility/aria-valid-attr.d.ts +10 -0
- package/core/audits/accessibility/axe-audit.d.ts +17 -0
- package/core/audits/accessibility/button-name.d.ts +10 -0
- package/core/audits/accessibility/bypass.d.ts +10 -0
- package/core/audits/accessibility/color-contrast.d.ts +10 -0
- package/core/audits/accessibility/definition-list.d.ts +10 -0
- package/core/audits/accessibility/dlitem.d.ts +10 -0
- package/core/audits/accessibility/document-title.d.ts +10 -0
- package/core/audits/accessibility/duplicate-id-active.d.ts +10 -0
- package/core/audits/accessibility/duplicate-id-aria.d.ts +10 -0
- package/core/audits/accessibility/form-field-multiple-labels.d.ts +10 -0
- package/core/audits/accessibility/frame-title.d.ts +10 -0
- package/core/audits/accessibility/heading-order.d.ts +10 -0
- package/core/audits/accessibility/html-has-lang.d.ts +10 -0
- package/core/audits/accessibility/html-lang-valid.d.ts +10 -0
- package/core/audits/accessibility/image-alt.d.ts +10 -0
- package/core/audits/accessibility/input-image-alt.d.ts +10 -0
- package/core/audits/accessibility/label.d.ts +10 -0
- package/core/audits/accessibility/link-name.d.ts +10 -0
- package/core/audits/accessibility/list.d.ts +10 -0
- package/core/audits/accessibility/listitem.d.ts +10 -0
- package/core/audits/accessibility/manual/custom-controls-labels.d.ts +8 -0
- package/core/audits/accessibility/manual/custom-controls-roles.d.ts +8 -0
- package/core/audits/accessibility/manual/focus-traps.d.ts +8 -0
- package/core/audits/accessibility/manual/focusable-controls.d.ts +8 -0
- package/core/audits/accessibility/manual/interactive-element-affordance.d.ts +8 -0
- package/core/audits/accessibility/manual/logical-tab-order.d.ts +8 -0
- package/core/audits/accessibility/manual/managed-focus.d.ts +8 -0
- package/core/audits/accessibility/manual/offscreen-content-hidden.d.ts +9 -0
- package/core/audits/accessibility/manual/use-landmarks.d.ts +8 -0
- package/core/audits/accessibility/manual/visual-order-follows-dom.d.ts +8 -0
- package/core/audits/accessibility/meta-refresh.d.ts +10 -0
- package/core/audits/accessibility/meta-viewport.d.ts +10 -0
- package/core/audits/accessibility/object-alt.d.ts +10 -0
- package/core/audits/accessibility/tabindex.d.ts +10 -0
- package/core/audits/accessibility/td-headers-attr.d.ts +10 -0
- package/core/audits/accessibility/th-has-data-cells.d.ts +10 -0
- package/core/audits/accessibility/valid-lang.d.ts +10 -0
- package/core/audits/accessibility/video-caption.d.ts +10 -0
- package/core/audits/audit.d.ts +150 -0
- package/core/audits/audit.js +1 -0
- package/core/audits/autocomplete.d.ts +36 -0
- package/core/audits/bf-cache.d.ts +21 -0
- package/core/audits/bootup-time.d.ts +26 -0
- package/core/audits/byte-efficiency/byte-efficiency-audit.d.ts +82 -0
- package/core/audits/byte-efficiency/duplicated-javascript.d.ts +52 -0
- package/core/audits/byte-efficiency/efficient-animated-content.d.ts +23 -0
- package/core/audits/byte-efficiency/legacy-javascript.d.ts +99 -0
- package/core/audits/byte-efficiency/modern-image-formats.d.ts +38 -0
- package/core/audits/byte-efficiency/offscreen-images.d.ts +75 -0
- package/core/audits/byte-efficiency/render-blocking-resources.d.ts +55 -0
- package/core/audits/byte-efficiency/total-byte-weight.d.ts +21 -0
- package/core/audits/byte-efficiency/unminified-css.d.ts +36 -0
- package/core/audits/byte-efficiency/unminified-javascript.d.ts +37 -0
- package/core/audits/byte-efficiency/unused-css-rules.d.ts +16 -0
- package/core/audits/byte-efficiency/unused-javascript.d.ts +27 -0
- package/core/audits/byte-efficiency/uses-long-cache-ttl.d.ts +61 -0
- package/core/audits/byte-efficiency/uses-optimized-images.d.ts +33 -0
- package/core/audits/byte-efficiency/uses-responsive-images-snapshot.d.ts +16 -0
- package/core/audits/byte-efficiency/uses-responsive-images.d.ts +45 -0
- package/core/audits/byte-efficiency/uses-text-compression.d.ts +14 -0
- package/core/audits/content-width.d.ts +17 -0
- package/core/audits/critical-request-chains.d.ts +44 -0
- package/core/audits/csp-xss.d.ts +51 -0
- package/core/audits/deprecations.d.ts +19 -0
- package/core/audits/diagnostics.d.ts +11 -0
- package/core/audits/dobetterweb/charset.d.ts +19 -0
- package/core/audits/dobetterweb/doctype.d.ts +21 -0
- package/core/audits/dobetterweb/dom-size.d.ts +26 -0
- package/core/audits/dobetterweb/geolocation-on-start.d.ts +16 -0
- package/core/audits/dobetterweb/inspector-issues.d.ts +45 -0
- package/core/audits/dobetterweb/js-libraries.d.ts +15 -0
- package/core/audits/dobetterweb/no-document-write.d.ts +16 -0
- package/core/audits/dobetterweb/notification-on-start.d.ts +16 -0
- package/core/audits/dobetterweb/password-inputs-can-be-pasted-into.d.ts +15 -0
- package/core/audits/dobetterweb/uses-http2.d.ts +69 -0
- package/core/audits/dobetterweb/uses-passive-event-listeners.d.ts +16 -0
- package/core/audits/errors-in-console.d.ts +31 -0
- package/core/audits/final-screenshot.d.ts +11 -0
- package/core/audits/font-display.d.ts +32 -0
- package/core/audits/image-aspect-ratio.d.ts +30 -0
- package/core/audits/image-size-responsive.d.ts +28 -0
- package/core/audits/installable-manifest.d.ts +118 -0
- package/core/audits/is-on-https.d.ts +23 -0
- package/core/audits/largest-contentful-paint-element.d.ts +14 -0
- package/core/audits/layout-shift-elements.d.ts +15 -0
- package/core/audits/lcp-lazy-loaded.d.ts +21 -0
- package/core/audits/long-tasks.d.ts +16 -0
- package/core/audits/main-thread-tasks.d.ts +11 -0
- package/core/audits/mainthread-work-breakdown.d.ts +28 -0
- package/core/audits/manual/manual-audit.d.ts +13 -0
- package/core/audits/manual/pwa-cross-browser.d.ts +12 -0
- package/core/audits/manual/pwa-each-page-has-url.d.ts +12 -0
- package/core/audits/manual/pwa-page-transitions.d.ts +12 -0
- package/core/audits/maskable-icon.d.ts +25 -0
- package/core/audits/metrics/cumulative-layout-shift.d.ts +21 -0
- package/core/audits/metrics/experimental-interaction-to-next-paint.d.ts +21 -0
- package/core/audits/metrics/first-contentful-paint-3g.d.ts +15 -0
- package/core/audits/metrics/first-contentful-paint.d.ts +25 -0
- package/core/audits/metrics/first-meaningful-paint.d.ts +28 -0
- package/core/audits/metrics/interactive.d.ts +31 -0
- package/core/audits/metrics/largest-contentful-paint.d.ts +25 -0
- package/core/audits/metrics/max-potential-fid.d.ts +23 -0
- package/core/audits/metrics/speed-index.d.ts +27 -0
- package/core/audits/metrics/total-blocking-time.d.ts +32 -0
- package/core/audits/metrics.d.ts +11 -0
- package/core/audits/multi-check-audit.d.ts +28 -0
- package/core/audits/network-requests.d.ts +11 -0
- package/core/audits/network-rtt.d.ts +15 -0
- package/core/audits/network-server-latency.d.ts +15 -0
- package/core/audits/no-unload-listeners.d.ts +16 -0
- package/core/audits/non-composited-animations.d.ts +21 -0
- package/core/audits/oopif-iframe-test-audit.d.ts +14 -0
- package/core/audits/performance-budget.d.ts +39 -0
- package/core/audits/predictive-perf.d.ts +11 -0
- package/core/audits/preload-fonts.d.ts +29 -0
- package/core/audits/preload-lcp-image.d.ts +67 -0
- package/core/audits/redirects.d.ts +33 -0
- package/core/audits/resource-summary.d.ts +16 -0
- package/core/audits/screenshot-thumbnails.d.ts +32 -0
- package/core/audits/script-elements-test-audit.d.ts +14 -0
- package/core/audits/script-treemap-data.d.ts +42 -0
- package/core/audits/seo/canonical.d.ts +51 -0
- package/core/audits/seo/crawlable-anchors.d.ts +16 -0
- package/core/audits/seo/font-size.d.ts +24 -0
- package/core/audits/seo/hreflang.d.ts +28 -0
- package/core/audits/seo/http-status-code.d.ts +16 -0
- package/core/audits/seo/is-crawlable.d.ts +38 -0
- package/core/audits/seo/link-text.d.ts +16 -0
- package/core/audits/seo/manual/structured-data.d.ts +12 -0
- package/core/audits/seo/meta-description.d.ts +16 -0
- package/core/audits/seo/plugins.d.ts +15 -0
- package/core/audits/seo/robots-txt.d.ts +18 -0
- package/core/audits/seo/tap-targets.d.ts +50 -0
- package/core/audits/server-response-time.d.ts +21 -0
- package/core/audits/service-worker.d.ts +46 -0
- package/core/audits/splash-screen.d.ts +37 -0
- package/core/audits/themed-omnibox.d.ts +42 -0
- package/core/audits/third-party-facades.d.ts +41 -0
- package/core/audits/third-party-summary.d.ts +58 -0
- package/core/audits/timing-budget.d.ts +43 -0
- package/core/audits/unsized-images.d.ts +39 -0
- package/core/audits/user-timings.d.ts +43 -0
- package/core/audits/uses-rel-preconnect.d.ts +37 -0
- package/core/audits/uses-rel-preload.d.ts +61 -0
- package/core/audits/valid-source-maps.d.ts +27 -0
- package/core/audits/viewport.d.ts +17 -0
- package/core/audits/violation-audit.d.ts +14 -0
- package/core/audits/work-during-interaction.d.ts +82 -0
- package/core/computed/computed-artifact.d.ts +15 -0
- package/core/computed/critical-request-chains.d.ts +40 -0
- package/core/computed/image-records.d.ts +24 -0
- package/core/computed/js-bundles.d.ts +13 -0
- package/core/computed/load-simulator.d.ts +28 -0
- package/core/computed/main-resource.d.ts +25 -0
- package/core/computed/main-thread-tasks.d.ts +15 -0
- package/core/computed/manifest-values.d.ts +24 -0
- package/core/computed/metrics/cumulative-layout-shift.d.ts +53 -0
- package/core/computed/metrics/first-contentful-paint-all-frames.d.ts +19 -0
- package/core/computed/metrics/first-contentful-paint.d.ts +15 -0
- package/core/computed/metrics/first-meaningful-paint.d.ts +15 -0
- package/core/computed/metrics/interactive.d.ts +61 -0
- package/core/computed/metrics/lantern-first-contentful-paint.d.ts +48 -0
- package/core/computed/metrics/lantern-first-meaningful-paint.d.ts +12 -0
- package/core/computed/metrics/lantern-interactive.d.ts +31 -0
- package/core/computed/metrics/lantern-largest-contentful-paint.d.ts +25 -0
- package/core/computed/metrics/lantern-max-potential-fid.d.ts +30 -0
- package/core/computed/metrics/lantern-metric.d.ts +78 -0
- package/core/computed/metrics/lantern-speed-index.d.ts +38 -0
- package/core/computed/metrics/lantern-total-blocking-time.d.ts +31 -0
- package/core/computed/metrics/largest-contentful-paint-all-frames.d.ts +20 -0
- package/core/computed/metrics/largest-contentful-paint.d.ts +15 -0
- package/core/computed/metrics/max-potential-fid.d.ts +15 -0
- package/core/computed/metrics/metric.d.ts +38 -0
- package/core/computed/metrics/navigation-metric.d.ts +16 -0
- package/core/computed/metrics/responsiveness.d.ts +87 -0
- package/core/computed/metrics/speed-index.d.ts +10 -0
- package/core/computed/metrics/tbt-utils.d.ts +18 -0
- package/core/computed/metrics/timing-summary.d.ts +46 -0
- package/core/computed/metrics/total-blocking-time.d.ts +23 -0
- package/core/computed/module-duplication.d.ts +37 -0
- package/core/computed/network-analysis.d.ts +20 -0
- package/core/computed/network-records.d.ts +15 -0
- package/core/computed/network-records.js +1 -0
- package/core/computed/page-dependency-graph.d.ts +88 -0
- package/core/computed/processed-navigation.d.ts +15 -0
- package/core/computed/processed-trace.d.ts +14 -0
- package/core/computed/resource-summary.d.ts +44 -0
- package/core/computed/screenshots.d.ts +20 -0
- package/core/computed/speedline.d.ts +15 -0
- package/core/computed/unused-css.d.ts +62 -0
- package/core/computed/unused-javascript-summary.d.ts +71 -0
- package/core/computed/user-timings.d.ts +31 -0
- package/core/computed/viewport-meta.d.ts +35 -0
- package/core/config/budget.d.ts +74 -0
- package/core/config/config-helpers.d.ts +94 -0
- package/core/config/config-plugin.d.ts +46 -0
- package/core/config/config.d.ts +28 -0
- package/core/config/constants.d.ts +86 -0
- package/core/config/default-config.d.ts +5 -0
- package/core/config/default-config.js +1 -0
- package/core/config/desktop-config.d.ts +5 -0
- package/core/config/desktop-config.js +1 -0
- package/core/config/experimental-config.d.ts +13 -0
- package/core/config/filters.d.ts +83 -0
- package/core/config/full-config.d.ts +9 -0
- package/core/config/lr-desktop-config.d.ts +4 -0
- package/core/config/lr-mobile-config.d.ts +9 -0
- package/core/config/metrics-to-audits.d.ts +19 -0
- package/core/config/perf-config.d.ts +9 -0
- package/core/config/validation.d.ts +77 -0
- package/core/gather/base-artifacts.d.ts +16 -0
- package/core/gather/base-gatherer.d.ts +72 -0
- package/core/gather/base-gatherer.js +2 -0
- package/core/gather/driver/dom.d.ts +20 -0
- package/core/gather/driver/environment.d.ts +35 -0
- package/core/gather/driver/execution-context.d.ts +101 -0
- package/core/gather/driver/execution-context.js +1 -7
- package/core/gather/driver/navigation.d.ts +33 -0
- package/core/gather/driver/network-monitor.d.ts +82 -0
- package/core/gather/driver/network.d.ts +10 -0
- package/core/gather/driver/prepare.d.ts +46 -0
- package/core/gather/driver/service-workers.d.ts +16 -0
- package/core/gather/driver/storage.d.ts +24 -0
- package/core/gather/driver/target-manager.d.ts +61 -0
- package/core/gather/driver/wait-for-condition.d.ts +116 -0
- package/core/gather/driver/wait-for-condition.js +3 -2
- package/core/gather/driver.d.ts +30 -0
- package/core/gather/fetcher.d.ts +63 -0
- package/core/gather/fetcher.js +2 -0
- package/core/gather/gatherers/accessibility.d.ts +23 -0
- package/core/gather/gatherers/anchor-elements.d.ts +10 -0
- package/core/gather/gatherers/bf-cache-failures.d.ts +43 -0
- package/core/gather/gatherers/cache-contents.d.ts +11 -0
- package/core/gather/gatherers/console-messages.d.ts +39 -0
- package/core/gather/gatherers/css-usage.d.ts +39 -0
- package/core/gather/gatherers/devtools-log-compat.d.ts +13 -0
- package/core/gather/gatherers/devtools-log.d.ts +48 -0
- package/core/gather/gatherers/dobetterweb/doctype.d.ts +10 -0
- package/core/gather/gatherers/dobetterweb/domstats.d.ts +10 -0
- package/core/gather/gatherers/dobetterweb/optimized-images.d.ts +61 -0
- package/core/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.d.ts +10 -0
- package/core/gather/gatherers/dobetterweb/response-compression.d.ts +30 -0
- package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.d.ts +53 -0
- package/core/gather/gatherers/full-page-screenshot.d.ts +35 -0
- package/core/gather/gatherers/gatherer.d.ts +46 -0
- package/core/gather/gatherers/global-listeners.d.ts +27 -0
- package/core/gather/gatherers/iframe-elements.d.ts +11 -0
- package/core/gather/gatherers/image-elements.d.ts +35 -0
- package/core/gather/gatherers/inputs.d.ts +10 -0
- package/core/gather/gatherers/inspector-issues.d.ts +38 -0
- package/core/gather/gatherers/installability-errors.d.ts +17 -0
- package/core/gather/gatherers/js-usage.d.ts +22 -0
- package/core/gather/gatherers/link-elements.d.ts +39 -0
- package/core/gather/gatherers/main-document-content.d.ts +27 -0
- package/core/gather/gatherers/meta-elements.d.ts +10 -0
- package/core/gather/gatherers/network-user-agent.d.ts +18 -0
- package/core/gather/gatherers/script-elements.d.ts +26 -0
- package/core/gather/gatherers/scripts.d.ts +27 -0
- package/core/gather/gatherers/seo/embedded-content.d.ts +10 -0
- package/core/gather/gatherers/seo/font-size.d.ts +131 -0
- package/core/gather/gatherers/seo/robots-txt.d.ts +10 -0
- package/core/gather/gatherers/seo/tap-targets.d.ts +21 -0
- package/core/gather/gatherers/service-worker.d.ts +16 -0
- package/core/gather/gatherers/source-maps.d.ts +50 -0
- package/core/gather/gatherers/stacks.d.ts +38 -0
- package/core/gather/gatherers/trace-compat.d.ts +13 -0
- package/core/gather/gatherers/trace-elements.d.ts +83 -0
- package/core/gather/gatherers/trace.d.ts +23 -0
- package/core/gather/gatherers/viewport-dimensions.d.ts +10 -0
- package/core/gather/gatherers/web-app-manifest.d.ts +32 -0
- package/core/gather/navigation-runner.d.ts +92 -0
- package/core/gather/runner-helpers.d.ts +39 -0
- package/core/gather/session.d.ts +50 -0
- package/core/gather/snapshot-runner.d.ts +10 -0
- package/core/gather/timespan-runner.d.ts +12 -0
- package/core/index.d.cts +4 -0
- package/core/index.d.ts +88 -0
- package/core/index.js +2 -0
- package/core/legacy/config/config.d.ts +107 -0
- package/core/legacy/config/legacy-default-config.d.ts +4 -0
- package/core/legacy/gather/connections/connection.d.ts +75 -0
- package/core/legacy/gather/connections/connection.js +1 -0
- package/core/legacy/gather/connections/cri.d.ts +27 -0
- package/core/legacy/gather/connections/raw.d.ts +20 -0
- package/core/legacy/gather/driver.d.ts +214 -0
- package/core/legacy/gather/driver.js +1 -0
- package/core/legacy/gather/gather-runner.d.ts +166 -0
- package/core/lib/arbitrary-equality-map.d.ts +47 -0
- package/core/lib/asset-saver.d.ts +101 -0
- package/core/lib/axe.d.ts +2 -0
- package/core/lib/bf-cache-strings.d.ts +121 -0
- package/core/lib/cdt/Common.d.ts +3 -0
- package/core/lib/cdt/Platform.d.ts +26 -0
- package/core/lib/cdt/SDK.d.ts +2 -0
- package/core/lib/cdt/generated/ParsedURL.d.ts +28 -0
- package/core/lib/cdt/generated/SourceMap.d.ts +100 -0
- package/core/lib/csp-evaluator.d.ts +41 -0
- package/core/lib/dependency-graph/base-node.d.ts +161 -0
- package/core/lib/dependency-graph/cpu-node.d.ts +34 -0
- package/core/lib/dependency-graph/cpu-node.js +1 -0
- package/core/lib/dependency-graph/network-node.d.ts +43 -0
- package/core/lib/dependency-graph/network-node.js +1 -0
- package/core/lib/dependency-graph/simulator/connection-pool.d.ts +58 -0
- package/core/lib/dependency-graph/simulator/connection-pool.js +1 -0
- package/core/lib/dependency-graph/simulator/dns-cache.d.ts +42 -0
- package/core/lib/dependency-graph/simulator/dns-cache.js +2 -0
- package/core/lib/dependency-graph/simulator/network-analyzer.d.ts +166 -0
- package/core/lib/dependency-graph/simulator/simulator-timing-map.d.ts +153 -0
- package/core/lib/dependency-graph/simulator/simulator-timing-map.js +2 -2
- package/core/lib/dependency-graph/simulator/simulator.d.ts +154 -0
- package/core/lib/dependency-graph/simulator/simulator.js +3 -2
- package/core/lib/dependency-graph/simulator/tcp-connection.d.ts +89 -0
- package/core/lib/deprecations-strings.d.ts +66 -0
- package/core/lib/emulation.d.ts +43 -0
- package/core/lib/i18n/i18n.d.ts +81 -0
- package/core/lib/icons.d.ts +22 -0
- package/core/lib/lantern-trace-saver.d.ts +20 -0
- package/core/lib/lh-env.d.ts +2 -0
- package/core/lib/lh-error.d.ts +328 -0
- package/core/lib/lh-trace-processor.d.ts +5 -0
- package/core/lib/manifest-parser.d.ts +186 -0
- package/core/lib/median-run.d.ts +17 -0
- package/core/lib/minification-estimator.d.ts +9 -0
- package/core/lib/minify-devtoolslog.d.ts +6 -0
- package/core/lib/minify-trace.d.ts +6 -0
- package/core/lib/navigation-error.d.ts +39 -0
- package/core/lib/network-recorder.d.ts +115 -0
- package/core/lib/network-request.d.ts +245 -0
- package/core/lib/network-request.js +1 -0
- package/core/lib/page-functions.d.ts +149 -0
- package/core/lib/proto-preprocessor.d.ts +13 -0
- package/core/lib/rect-helpers.d.ts +100 -0
- package/core/lib/script-helpers.d.ts +17 -0
- package/core/lib/sentry.d.ts +32 -0
- package/core/lib/stack-packs.d.ts +16 -0
- package/core/lib/statistics.d.ts +28 -0
- package/core/lib/tappable-rects.d.ts +8 -0
- package/core/lib/third-party-web.d.ts +32 -0
- package/core/lib/timing-trace-saver.d.ts +21 -0
- package/core/lib/tracehouse/cpu-profile-model.d.ts +228 -0
- package/core/lib/tracehouse/main-thread-tasks.d.ts +162 -0
- package/core/lib/tracehouse/main-thread-tasks.js +1 -0
- package/core/lib/tracehouse/task-groups.d.ts +66 -0
- package/core/lib/tracehouse/task-summary.d.ts +18 -0
- package/core/lib/tracehouse/trace-processor.d.ts +275 -0
- package/core/lib/traces/metric-trace-events.d.ts +65 -0
- package/core/lib/url-utils.d.ts +100 -0
- package/core/runner.d.ts +109 -0
- package/core/scoring.d.ts +26 -0
- package/core/user-flow.d.ts +106 -0
- package/core/user-flow.js +1 -0
- package/core/util.d.cts +230 -0
- package/eslint-local-rules.d.cts +6 -0
- package/esm-utils.d.ts +14 -0
- package/flow-report/api.d.ts +7 -0
- package/flow-report/clients/standalone.d.ts +7 -0
- package/flow-report/src/app.d.ts +11 -0
- package/flow-report/src/common.d.ts +20 -0
- package/flow-report/src/header.d.ts +10 -0
- package/flow-report/src/help-dialog.d.ts +10 -0
- package/flow-report/src/i18n/i18n.d.ts +209 -0
- package/flow-report/src/i18n/localized-strings.d.ts +9 -0
- package/flow-report/src/i18n/ui-strings.d.ts +48 -0
- package/flow-report/src/icons.d.ts +18 -0
- package/flow-report/src/sidebar/flow.d.ts +8 -0
- package/flow-report/src/sidebar/sidebar.d.ts +17 -0
- package/flow-report/src/summary/category.d.ts +19 -0
- package/flow-report/src/summary/summary.d.ts +18 -0
- package/flow-report/src/topbar.d.ts +15 -0
- package/flow-report/src/util.d.ts +30 -0
- package/flow-report/src/wrappers/category-score.d.ts +12 -0
- package/flow-report/src/wrappers/markdown.d.ts +10 -0
- package/flow-report/src/wrappers/report.d.ts +10 -0
- package/flow-report/src/wrappers/styles.d.ts +8 -0
- package/flow-report/test/app-test.d.ts +7 -0
- package/flow-report/test/common-test.d.ts +7 -0
- package/flow-report/test/flow-report-pptr-test.d.ts +7 -0
- package/flow-report/test/header-test.d.ts +7 -0
- package/flow-report/test/sample-flow.d.ts +7 -0
- package/flow-report/test/setup/env-setup.d.ts +11 -0
- package/flow-report/test/sidebar/flow-test.d.ts +7 -0
- package/flow-report/test/sidebar/sidebar-test.d.ts +7 -0
- package/flow-report/test/summary/category-test.d.ts +7 -0
- package/flow-report/test/summary/summary-test.d.ts +7 -0
- package/flow-report/test/topbar-test.d.ts +7 -0
- package/flow-report/test/util-test.d.ts +7 -0
- package/flow-report/test/wrappers/category-score-test.d.ts +7 -0
- package/flow-report/test/wrappers/markdown-test.d.ts +7 -0
- package/flow-report/tsconfig.json +1 -1
- package/package.json +5 -2
- package/report/clients/bundle.d.ts +6 -0
- package/report/clients/standalone.d.ts +2 -0
- package/report/generator/file-namer.d.ts +35 -0
- package/report/generator/flow-report-assets.d.ts +9 -0
- package/report/generator/report-assets.d.ts +8 -0
- package/report/generator/report-generator.d.ts +59 -0
- package/report/renderer/api.d.ts +31 -0
- package/report/renderer/category-renderer.d.ts +176 -0
- package/report/renderer/components.d.ts +10 -0
- package/report/renderer/crc-details-renderer.d.ts +73 -0
- package/report/renderer/details-renderer.d.ts +141 -0
- package/report/renderer/dom.d.ts +125 -0
- package/report/renderer/drop-down-menu.d.ts +70 -0
- package/report/renderer/element-screenshot-renderer.d.ts +79 -0
- package/report/renderer/features-util.d.ts +13 -0
- package/report/renderer/i18n.d.ts +106 -0
- package/report/renderer/logger.d.ts +47 -0
- package/report/renderer/open-tab.d.ts +19 -0
- package/report/renderer/performance-category-renderer.d.ts +56 -0
- package/report/renderer/pwa-category-renderer.d.ts +55 -0
- package/report/renderer/report-renderer.d.ts +57 -0
- package/report/renderer/report-ui-features.d.ts +71 -0
- package/report/renderer/snippet-renderer.d.ts +85 -0
- package/report/renderer/swap-locale-feature.d.ts +31 -0
- package/report/renderer/text-encoding.d.ts +26 -0
- package/report/renderer/topbar-features.d.ts +82 -0
- package/report/renderer/util.d.ts +230 -0
- package/report/test-assets/faux-psi.d.ts +34 -0
- package/report/types/augment-dom.d.ts +1 -1
- package/root.d.ts +3 -0
- package/shared/localization/format.d.ts +106 -0
- package/shared/localization/i18n-module.d.ts +4 -0
- package/shared/localization/locales.d.ts +7 -0
- package/shared/localization/swap-flow-locale.d.ts +6 -0
- package/shared/localization/swap-locale.d.ts +39 -0
- package/shared/type-verifiers.d.ts +23 -0
- package/third-party/axe/valid-langs.d.ts +9 -0
- package/types/artifacts.d.ts +40 -38
- package/types/audit.d.ts +6 -6
- package/types/config.d.ts +3 -3
- package/types/externs.d.ts +7 -3
- package/types/gatherer.d.ts +27 -21
- package/types/{cssstyle/index.d.ts → internal/cssstyle.d.ts} +0 -0
- package/types/{enquirer.d.ts → internal/enquirer.d.ts} +0 -0
- package/types/{es-main.d.ts → internal/es-main.d.ts} +0 -0
- package/types/internal/global.d.ts +15 -0
- package/types/{http-link-header/index.d.ts → internal/http-link-header.d.ts} +0 -0
- package/types/{jsonlint-mod.d.ts → internal/jsonlint-mod.d.ts} +0 -0
- package/types/{lighthouse-logger/index.d.ts → internal/lighthouse-logger.d.ts} +0 -0
- package/types/{lookup-closest-locale/index.d.ts → internal/lookup-closest-locale.d.ts} +3 -1
- package/types/{metaviewport-parser/index.d.ts → internal/metaviewport-parser.d.ts} +0 -0
- package/types/{node-fetch.d.ts → internal/node-fetch.d.ts} +0 -0
- package/types/{node.d.ts → internal/node.d.ts} +0 -0
- package/types/{parse-cache-control/index.d.ts → internal/parse-cache-control.d.ts} +0 -0
- package/types/{pretty-json-stringify/index.d.ts → internal/pretty-json-stringify.d.ts} +0 -0
- package/types/{query-selector.d.ts → internal/query-selector.d.ts} +1 -1
- package/types/{rollup-plugin-postprocess.d.ts → internal/rollup-plugin-postprocess.d.ts} +0 -0
- package/types/{smokehouse.d.ts → internal/smokehouse.d.ts} +3 -3
- package/types/{test.d.ts → internal/test.d.ts} +0 -0
- package/types/lh.d.ts +81 -0
- package/types/lh.js +13 -0
- package/types/lhr/audit-details.d.ts +2 -2
- package/types/lhr/audit-result.d.ts +2 -2
- package/types/lhr/flow-result.d.ts +1 -1
- package/types/lhr/lhr.d.ts +2 -2
- package/types/lhr/settings.d.ts +1 -1
- package/types/lhr/treemap.d.ts +2 -2
- package/types/protocol.d.ts +8 -3
- package/types/puppeteer.d.ts +11 -6
- package/types/user-flow.d.ts +14 -5
- package/types/global-lh.d.ts +0 -85
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* We want the run that's closest to the median of the FCP and the median of the TTI.
|
|
3
|
+
* We're using the Euclidean distance for that (https://en.wikipedia.org/wiki/Euclidean_distance).
|
|
4
|
+
* We use FCP and TTI because they represent the earliest and latest moments in the page lifecycle.
|
|
5
|
+
* We avoid the median of single measures like the performance score because they can still exhibit
|
|
6
|
+
* outlier behavior at the beginning or end of load.
|
|
7
|
+
*
|
|
8
|
+
* @param {Array<LH.Result>} runs
|
|
9
|
+
* @return {LH.Result}
|
|
10
|
+
*/
|
|
11
|
+
export function computeMedianRun(runs: Array<LH.Result>): LH.Result;
|
|
12
|
+
/**
|
|
13
|
+
* @param {Array<LH.Result>} runs
|
|
14
|
+
* @return {Array<LH.Result>}
|
|
15
|
+
*/
|
|
16
|
+
export function filterToValidRuns(runs: Array<LH.Result>): Array<LH.Result>;
|
|
17
|
+
//# sourceMappingURL=median-run.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns an error if the original network request failed or wasn't found.
|
|
3
|
+
* @param {LH.Artifacts.NetworkRequest|undefined} mainRecord
|
|
4
|
+
* @return {LH.LighthouseError|undefined}
|
|
5
|
+
*/
|
|
6
|
+
export function getNetworkError(mainRecord: LH.Artifacts.NetworkRequest | undefined): LH.LighthouseError | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Returns an error if we ended up on the `chrome-error` page and all other requests failed.
|
|
9
|
+
* @param {LH.Artifacts.NetworkRequest|undefined} mainRecord
|
|
10
|
+
* @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
|
|
11
|
+
* @return {LH.LighthouseError|undefined}
|
|
12
|
+
*/
|
|
13
|
+
export function getInterstitialError(mainRecord: LH.Artifacts.NetworkRequest | undefined, networkRecords: Array<LH.Artifacts.NetworkRequest>): LH.LighthouseError | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Returns an error if the page load should be considered failed, e.g. from a
|
|
16
|
+
* main document request failure, a security issue, etc.
|
|
17
|
+
* @param {LH.LighthouseError|undefined} navigationError
|
|
18
|
+
* @param {{url: string, loadFailureMode: LH.Gatherer.PassContext['passConfig']['loadFailureMode'], networkRecords: Array<LH.Artifacts.NetworkRequest>, warnings: Array<string | LH.IcuMessage>}} context
|
|
19
|
+
* @return {LH.LighthouseError|undefined}
|
|
20
|
+
*/
|
|
21
|
+
export function getPageLoadError(navigationError: LH.LighthouseError | undefined, context: {
|
|
22
|
+
url: string;
|
|
23
|
+
loadFailureMode: LH.Gatherer.PassContext['passConfig']['loadFailureMode'];
|
|
24
|
+
networkRecords: Array<LH.Artifacts.NetworkRequest>;
|
|
25
|
+
warnings: Array<string | LH.IcuMessage>;
|
|
26
|
+
}): LH.LighthouseError | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Returns an error if we try to load a non-HTML page.
|
|
29
|
+
* Expects a network request with all redirects resolved, otherwise the MIME type may be incorrect.
|
|
30
|
+
* @param {LH.Artifacts.NetworkRequest|undefined} finalRecord
|
|
31
|
+
* @return {LH.LighthouseError|undefined}
|
|
32
|
+
*/
|
|
33
|
+
export function getNonHtmlError(finalRecord: LH.Artifacts.NetworkRequest | undefined): LH.LighthouseError | undefined;
|
|
34
|
+
export namespace UIStrings {
|
|
35
|
+
const warningXhtml: string;
|
|
36
|
+
}
|
|
37
|
+
import { NetworkRequest } from "./network-request.js";
|
|
38
|
+
import { LighthouseError } from "./lh-error.js";
|
|
39
|
+
//# sourceMappingURL=navigation-error.d.ts.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export type NetworkRecorderEventMap = {
|
|
2
|
+
requeststarted: [NetworkRequest];
|
|
3
|
+
requestfinished: [NetworkRequest];
|
|
4
|
+
};
|
|
5
|
+
export type RequestEmitter = LH.Protocol.StrictEventEmitterClass<NetworkRecorderEventMap>;
|
|
6
|
+
declare const NetworkRecorder_base: RequestEmitter;
|
|
7
|
+
export class NetworkRecorder extends NetworkRecorder_base {
|
|
8
|
+
/**
|
|
9
|
+
* @param {NetworkRequest} record The record to find the initiator of
|
|
10
|
+
* @param {Map<string, NetworkRequest[]>} recordsByURL
|
|
11
|
+
* @return {NetworkRequest|null}
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
private static _chooseInitiatorRequest;
|
|
15
|
+
/**
|
|
16
|
+
* Construct network records from a log of devtools protocol messages.
|
|
17
|
+
* @param {LH.DevtoolsLog} devtoolsLog
|
|
18
|
+
* @return {Array<LH.Artifacts.NetworkRequest>}
|
|
19
|
+
*/
|
|
20
|
+
static recordsFromLogs(devtoolsLog: import("../index.js").DevtoolsLog): Array<LH.Artifacts.NetworkRequest>;
|
|
21
|
+
/** @type {NetworkRequest[]} */
|
|
22
|
+
_records: NetworkRequest[];
|
|
23
|
+
/** @type {Map<string, NetworkRequest>} */
|
|
24
|
+
_recordsById: Map<string, NetworkRequest>;
|
|
25
|
+
/** @type {string|null|undefined} */
|
|
26
|
+
_mainSessionId: string | null | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the array of raw network request data without finalizing the initiator and
|
|
29
|
+
* redirect chain.
|
|
30
|
+
* @return {Array<NetworkRequest>}
|
|
31
|
+
*/
|
|
32
|
+
getRawRecords(): Array<NetworkRequest>;
|
|
33
|
+
/**
|
|
34
|
+
* Listener for the DevTools SDK NetworkManager's RequestStarted event, which includes both
|
|
35
|
+
* web socket and normal request creation.
|
|
36
|
+
* @param {NetworkRequest} request
|
|
37
|
+
* @private
|
|
38
|
+
*/
|
|
39
|
+
private onRequestStarted;
|
|
40
|
+
/**
|
|
41
|
+
* Listener for the DevTools SDK NetworkManager's RequestFinished event, which includes
|
|
42
|
+
* request finish, failure, and redirect, as well as the closing of web sockets.
|
|
43
|
+
* @param {NetworkRequest} request
|
|
44
|
+
* @private
|
|
45
|
+
*/
|
|
46
|
+
private onRequestFinished;
|
|
47
|
+
/**
|
|
48
|
+
* @param {{params: LH.Crdp.Network.RequestWillBeSentEvent, sessionId?: string}} event
|
|
49
|
+
*/
|
|
50
|
+
onRequestWillBeSent(event: {
|
|
51
|
+
params: LH.Crdp.Network.RequestWillBeSentEvent;
|
|
52
|
+
sessionId?: string;
|
|
53
|
+
}): void;
|
|
54
|
+
/**
|
|
55
|
+
* @param {{params: LH.Crdp.Network.RequestServedFromCacheEvent, sessionId?: string}} event
|
|
56
|
+
*/
|
|
57
|
+
onRequestServedFromCache(event: {
|
|
58
|
+
params: LH.Crdp.Network.RequestServedFromCacheEvent;
|
|
59
|
+
sessionId?: string;
|
|
60
|
+
}): void;
|
|
61
|
+
/**
|
|
62
|
+
* @param {{params: LH.Crdp.Network.ResponseReceivedEvent, sessionId?: string}} event
|
|
63
|
+
*/
|
|
64
|
+
onResponseReceived(event: {
|
|
65
|
+
params: LH.Crdp.Network.ResponseReceivedEvent;
|
|
66
|
+
sessionId?: string;
|
|
67
|
+
}): void;
|
|
68
|
+
/**
|
|
69
|
+
* @param {{params: LH.Crdp.Network.DataReceivedEvent, sessionId?: string}} event
|
|
70
|
+
*/
|
|
71
|
+
onDataReceived(event: {
|
|
72
|
+
params: LH.Crdp.Network.DataReceivedEvent;
|
|
73
|
+
sessionId?: string;
|
|
74
|
+
}): void;
|
|
75
|
+
/**
|
|
76
|
+
* @param {{params: LH.Crdp.Network.LoadingFinishedEvent, sessionId?: string}} event
|
|
77
|
+
*/
|
|
78
|
+
onLoadingFinished(event: {
|
|
79
|
+
params: LH.Crdp.Network.LoadingFinishedEvent;
|
|
80
|
+
sessionId?: string;
|
|
81
|
+
}): void;
|
|
82
|
+
/**
|
|
83
|
+
* @param {{params: LH.Crdp.Network.LoadingFailedEvent, sessionId?: string}} event
|
|
84
|
+
*/
|
|
85
|
+
onLoadingFailed(event: {
|
|
86
|
+
params: LH.Crdp.Network.LoadingFailedEvent;
|
|
87
|
+
sessionId?: string;
|
|
88
|
+
}): void;
|
|
89
|
+
/**
|
|
90
|
+
* @param {{params: LH.Crdp.Network.ResourceChangedPriorityEvent, sessionId?: string}} event
|
|
91
|
+
*/
|
|
92
|
+
onResourceChangedPriority(event: {
|
|
93
|
+
params: LH.Crdp.Network.ResourceChangedPriorityEvent;
|
|
94
|
+
sessionId?: string;
|
|
95
|
+
}): void;
|
|
96
|
+
/**
|
|
97
|
+
* Routes network events to their handlers, so we can construct networkRecords
|
|
98
|
+
* @param {LH.Protocol.RawEventMessage} event
|
|
99
|
+
*/
|
|
100
|
+
dispatch(event: LH.Protocol.RawEventMessage): void;
|
|
101
|
+
/**
|
|
102
|
+
* Redirected requests all have identical requestIds over the protocol. Once a request has been
|
|
103
|
+
* redirected all future messages referrencing that requestId are about the new destination, not
|
|
104
|
+
* the original. This method is a helper for finding the real request object to which the current
|
|
105
|
+
* message is referring.
|
|
106
|
+
*
|
|
107
|
+
* @param {string} requestId
|
|
108
|
+
* @param {string|undefined} sessionId
|
|
109
|
+
* @return {NetworkRequest|undefined}
|
|
110
|
+
*/
|
|
111
|
+
_findRealRequestAndSetSession(requestId: string, sessionId: string | undefined): NetworkRequest | undefined;
|
|
112
|
+
}
|
|
113
|
+
import { NetworkRequest } from "./network-request.js";
|
|
114
|
+
export {};
|
|
115
|
+
//# sourceMappingURL=network-recorder.d.ts.map
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
export type HeaderEntry = {
|
|
2
|
+
name: string;
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
export type ParsedURL = {
|
|
6
|
+
/**
|
|
7
|
+
* Equivalent to a `new URL(url).protocol` BUT w/o the trailing colon (:)
|
|
8
|
+
*/
|
|
9
|
+
scheme: string;
|
|
10
|
+
/**
|
|
11
|
+
* Equivalent to a `new URL(url).hostname`
|
|
12
|
+
*/
|
|
13
|
+
host: string;
|
|
14
|
+
securityOrigin: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The difference in endTime between the observed Lighthouse endTime and Lightrider's derived endTime.
|
|
18
|
+
*/
|
|
19
|
+
export type LightriderStatistics = {
|
|
20
|
+
/**
|
|
21
|
+
* The time spent making a TCP connection (connect + SSL).
|
|
22
|
+
*/
|
|
23
|
+
endTimeDeltaMs: number;
|
|
24
|
+
/**
|
|
25
|
+
* The time spent requesting a resource from a remote server, we use this to approx RTT.
|
|
26
|
+
*/
|
|
27
|
+
TCPMs: number;
|
|
28
|
+
/**
|
|
29
|
+
* The time spent transferring a resource from a remote server.
|
|
30
|
+
*/
|
|
31
|
+
requestMs: number;
|
|
32
|
+
responseMs: number;
|
|
33
|
+
};
|
|
34
|
+
export class NetworkRequest {
|
|
35
|
+
/**
|
|
36
|
+
* Convert the requestId to backend-version by removing the `:redirect` portion
|
|
37
|
+
*
|
|
38
|
+
* @param {string} requestId
|
|
39
|
+
* @return {string}
|
|
40
|
+
*/
|
|
41
|
+
static getRequestIdForBackend(requestId: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Based on DevTools NetworkManager.
|
|
44
|
+
* @see https://github.com/ChromeDevTools/devtools-frontend/blob/3415ee28e86a3f4bcc2e15b652d22069938df3a6/front_end/sdk/NetworkManager.js#L285-L297
|
|
45
|
+
* @param {LH.Crdp.Network.Headers} headersDict
|
|
46
|
+
* @return {Array<HeaderEntry>}
|
|
47
|
+
*/
|
|
48
|
+
static _headersDictToHeadersArray(headersDict: LH.Crdp.Network.Headers): Array<HeaderEntry>;
|
|
49
|
+
static get TYPES(): LH.Util.SelfMap<LH.Crdp.Network.ResourceType>;
|
|
50
|
+
/**
|
|
51
|
+
* @param {NetworkRequest} record
|
|
52
|
+
* @return {boolean}
|
|
53
|
+
*/
|
|
54
|
+
static isNonNetworkRequest(record: NetworkRequest): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Technically there's not alignment on URLs that create "secure connections" vs "secure contexts"
|
|
57
|
+
* https://github.com/GoogleChrome/lighthouse/pull/11766#discussion_r582340683
|
|
58
|
+
* But for our purposes, we don't need to worry too much.
|
|
59
|
+
* @param {NetworkRequest} record
|
|
60
|
+
* @return {boolean}
|
|
61
|
+
*/
|
|
62
|
+
static isSecureRequest(record: NetworkRequest): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Returns whether the network request was an HSTS redirect request.
|
|
65
|
+
* @param {NetworkRequest} record
|
|
66
|
+
* @return {boolean}
|
|
67
|
+
*/
|
|
68
|
+
static isHstsRequest(record: NetworkRequest): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Resource size is almost always the right one to be using because of the below:
|
|
71
|
+
* `transferSize = resourceSize + headers.length`.
|
|
72
|
+
* HOWEVER, there are some cases where an image is compressed again over the network and transfer size
|
|
73
|
+
* is smaller (see https://github.com/GoogleChrome/lighthouse/pull/4968).
|
|
74
|
+
* Use the min of the two numbers to be safe.
|
|
75
|
+
* `tranferSize` of cached records is 0
|
|
76
|
+
* @param {NetworkRequest} networkRecord
|
|
77
|
+
* @return {number}
|
|
78
|
+
*/
|
|
79
|
+
static getResourceSizeOnNetwork(networkRecord: NetworkRequest): number;
|
|
80
|
+
requestId: string;
|
|
81
|
+
connectionId: string;
|
|
82
|
+
connectionReused: boolean;
|
|
83
|
+
url: string;
|
|
84
|
+
protocol: string;
|
|
85
|
+
isSecure: boolean;
|
|
86
|
+
isValid: boolean;
|
|
87
|
+
parsedURL: ParsedURL;
|
|
88
|
+
documentURL: string;
|
|
89
|
+
/**
|
|
90
|
+
* When the network service is about to handle a request, ie. just before going to the
|
|
91
|
+
* HTTP cache or going to the network for DNS/connection setup, in milliseconds.
|
|
92
|
+
*/
|
|
93
|
+
startTime: number;
|
|
94
|
+
/** When the last byte of the response body is received, in milliseconds. */
|
|
95
|
+
endTime: number;
|
|
96
|
+
/** When the last byte of the response headers is received, in milliseconds. */
|
|
97
|
+
responseReceivedTime: number;
|
|
98
|
+
transferSize: number;
|
|
99
|
+
resourceSize: number;
|
|
100
|
+
fromDiskCache: boolean;
|
|
101
|
+
fromMemoryCache: boolean;
|
|
102
|
+
fromPrefetchCache: boolean;
|
|
103
|
+
/** @type {LightriderStatistics|undefined} Extra timing information available only when run in Lightrider. */
|
|
104
|
+
lrStatistics: LightriderStatistics | undefined;
|
|
105
|
+
finished: boolean;
|
|
106
|
+
requestMethod: string;
|
|
107
|
+
statusCode: number;
|
|
108
|
+
/** @type {NetworkRequest|undefined} The network request that redirected to this one */
|
|
109
|
+
redirectSource: NetworkRequest | undefined;
|
|
110
|
+
/** @type {NetworkRequest|undefined} The network request that this one redirected to */
|
|
111
|
+
redirectDestination: NetworkRequest | undefined;
|
|
112
|
+
/** @type {NetworkRequest[]|undefined} The chain of network requests that redirected to this one */
|
|
113
|
+
redirects: NetworkRequest[] | undefined;
|
|
114
|
+
failed: boolean;
|
|
115
|
+
localizedFailDescription: string;
|
|
116
|
+
/** @type {LH.Crdp.Network.Initiator} */
|
|
117
|
+
initiator: LH.Crdp.Network.Initiator;
|
|
118
|
+
/** @type {LH.Crdp.Network.ResourceTiming|undefined} */
|
|
119
|
+
timing: LH.Crdp.Network.ResourceTiming | undefined;
|
|
120
|
+
/** @type {LH.Crdp.Network.ResourceType|undefined} */
|
|
121
|
+
resourceType: LH.Crdp.Network.ResourceType | undefined;
|
|
122
|
+
mimeType: string;
|
|
123
|
+
/** @type {LH.Crdp.Network.ResourcePriority} */
|
|
124
|
+
priority: LH.Crdp.Network.ResourcePriority;
|
|
125
|
+
/** @type {NetworkRequest|undefined} */
|
|
126
|
+
initiatorRequest: NetworkRequest | undefined;
|
|
127
|
+
/** @type {HeaderEntry[]} */
|
|
128
|
+
responseHeaders: HeaderEntry[];
|
|
129
|
+
/** @type {string} */
|
|
130
|
+
responseHeadersText: string;
|
|
131
|
+
fetchedViaServiceWorker: boolean;
|
|
132
|
+
/** @type {string|undefined} */
|
|
133
|
+
frameId: string | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* @type {string|undefined}
|
|
136
|
+
* Only set for child targets (OOPIFs). This is the sessionId of the protocol connection on
|
|
137
|
+
* which this request was discovered. `undefined` means it came from the root.
|
|
138
|
+
*/
|
|
139
|
+
sessionId: string | undefined;
|
|
140
|
+
isLinkPreload: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* @return {boolean}
|
|
143
|
+
*/
|
|
144
|
+
hasErrorStatusCode(): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* @param {NetworkRequest} initiatorRequest
|
|
147
|
+
*/
|
|
148
|
+
setInitiatorRequest(initiatorRequest: NetworkRequest): void;
|
|
149
|
+
/**
|
|
150
|
+
* @param {LH.Crdp.Network.RequestWillBeSentEvent} data
|
|
151
|
+
*/
|
|
152
|
+
onRequestWillBeSent(data: LH.Crdp.Network.RequestWillBeSentEvent): void;
|
|
153
|
+
onRequestServedFromCache(): void;
|
|
154
|
+
/**
|
|
155
|
+
* @param {LH.Crdp.Network.ResponseReceivedEvent} data
|
|
156
|
+
*/
|
|
157
|
+
onResponseReceived(data: LH.Crdp.Network.ResponseReceivedEvent): void;
|
|
158
|
+
/**
|
|
159
|
+
* @param {LH.Crdp.Network.DataReceivedEvent} data
|
|
160
|
+
*/
|
|
161
|
+
onDataReceived(data: LH.Crdp.Network.DataReceivedEvent): void;
|
|
162
|
+
/**
|
|
163
|
+
* @param {LH.Crdp.Network.LoadingFinishedEvent} data
|
|
164
|
+
*/
|
|
165
|
+
onLoadingFinished(data: LH.Crdp.Network.LoadingFinishedEvent): void;
|
|
166
|
+
/**
|
|
167
|
+
* @param {LH.Crdp.Network.LoadingFailedEvent} data
|
|
168
|
+
*/
|
|
169
|
+
onLoadingFailed(data: LH.Crdp.Network.LoadingFailedEvent): void;
|
|
170
|
+
/**
|
|
171
|
+
* @param {LH.Crdp.Network.ResourceChangedPriorityEvent} data
|
|
172
|
+
*/
|
|
173
|
+
onResourceChangedPriority(data: LH.Crdp.Network.ResourceChangedPriorityEvent): void;
|
|
174
|
+
/**
|
|
175
|
+
* @param {LH.Crdp.Network.RequestWillBeSentEvent} data
|
|
176
|
+
*/
|
|
177
|
+
onRedirectResponse(data: LH.Crdp.Network.RequestWillBeSentEvent): void;
|
|
178
|
+
/**
|
|
179
|
+
* @param {string=} sessionId
|
|
180
|
+
*/
|
|
181
|
+
setSession(sessionId?: string | undefined): void;
|
|
182
|
+
/**
|
|
183
|
+
* @param {LH.Crdp.Network.Response} response
|
|
184
|
+
* @param {number} timestamp in seconds
|
|
185
|
+
* @param {LH.Crdp.Network.ResponseReceivedEvent['type']=} resourceType
|
|
186
|
+
*/
|
|
187
|
+
_onResponse(response: LH.Crdp.Network.Response, timestamp: number, resourceType?: LH.Crdp.Network.ResponseReceivedEvent['type'] | undefined): void;
|
|
188
|
+
/**
|
|
189
|
+
* Resolve differences between conflicting timing signals. Based on the property setters in DevTools.
|
|
190
|
+
* @see https://github.com/ChromeDevTools/devtools-frontend/blob/56a99365197b85c24b732ac92b0ac70feed80179/front_end/sdk/NetworkRequest.js#L485-L502
|
|
191
|
+
* @param {LH.Crdp.Network.ResourceTiming} timing
|
|
192
|
+
*/
|
|
193
|
+
_recomputeTimesWithResourceTiming(timing: LH.Crdp.Network.ResourceTiming): void;
|
|
194
|
+
/**
|
|
195
|
+
* Update responseReceivedTime to the endTime if endTime is earlier.
|
|
196
|
+
* A response can't be received after the entire request finished.
|
|
197
|
+
*/
|
|
198
|
+
_updateResponseReceivedTimeIfNecessary(): void;
|
|
199
|
+
/**
|
|
200
|
+
* LR loses transfer size information, but passes it in the 'X-TotalFetchedSize' header.
|
|
201
|
+
* 'X-TotalFetchedSize' is the canonical transfer size in LR. Nothing should supersede it.
|
|
202
|
+
*
|
|
203
|
+
* The total length of the encoded data is spread out among multiple events. The sum of the
|
|
204
|
+
* values in onResponseReceived and all the onDataReceived events typically equals the value
|
|
205
|
+
* seen on the onLoadingFinished event. In <1% of cases we see the values differ. As we process
|
|
206
|
+
* onResponseReceived and onDataReceived we accumulate the total encodedDataLength. When we
|
|
207
|
+
* process onLoadingFinished, we override the accumulated total. We do this so that if the
|
|
208
|
+
* request is aborted or fails, we still get a value via the accumulation.
|
|
209
|
+
*
|
|
210
|
+
* In Lightrider, due to instrumentation limitations, our values for encodedDataLength are bogus
|
|
211
|
+
* and not valid. However the resource's true encodedDataLength/transferSize is shared via a
|
|
212
|
+
* special response header, X-TotalFetchedSize. In this situation, we read this value from
|
|
213
|
+
* responseReceived, use it for the transferSize and ignore the encodedDataLength values in
|
|
214
|
+
* both dataReceived and loadingFinished.
|
|
215
|
+
*/
|
|
216
|
+
_updateTransferSizeForLightrider(): void;
|
|
217
|
+
/**
|
|
218
|
+
* LR loses protocol information.
|
|
219
|
+
*/
|
|
220
|
+
_updateProtocolForLightrider(): void;
|
|
221
|
+
/**
|
|
222
|
+
* LR gets additional, accurate timing information from its underlying fetch infrastructure. This
|
|
223
|
+
* is passed in via X-Headers similar to 'X-TotalFetchedSize'.
|
|
224
|
+
*/
|
|
225
|
+
_updateTimingsForLightrider(): void;
|
|
226
|
+
}
|
|
227
|
+
export namespace NetworkRequest {
|
|
228
|
+
export { HEADER_TCP };
|
|
229
|
+
export { HEADER_SSL };
|
|
230
|
+
export { HEADER_REQ };
|
|
231
|
+
export { HEADER_RES };
|
|
232
|
+
export { HEADER_TOTAL };
|
|
233
|
+
export { HEADER_FETCHED_SIZE };
|
|
234
|
+
export { HEADER_PROTOCOL_IS_H2 };
|
|
235
|
+
}
|
|
236
|
+
import * as LH from "../../types/lh.js";
|
|
237
|
+
declare const HEADER_TCP: "X-TCPMs";
|
|
238
|
+
declare const HEADER_SSL: "X-SSLMs";
|
|
239
|
+
declare const HEADER_REQ: "X-RequestMs";
|
|
240
|
+
declare const HEADER_RES: "X-ResponseMs";
|
|
241
|
+
declare const HEADER_TOTAL: "X-TotalMs";
|
|
242
|
+
declare const HEADER_FETCHED_SIZE: "X-TotalFetchedSize";
|
|
243
|
+
declare const HEADER_PROTOCOL_IS_H2: "X-ProtocolIsH2";
|
|
244
|
+
export {};
|
|
245
|
+
//# sourceMappingURL=network-request.d.ts.map
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
export namespace pageFunctions {
|
|
2
|
+
export { wrapRuntimeEvalErrorInBrowser };
|
|
3
|
+
export { getElementsInDocument };
|
|
4
|
+
export { getOuterHTMLSnippet };
|
|
5
|
+
export { computeBenchmarkIndex };
|
|
6
|
+
export { getNodeDetails };
|
|
7
|
+
export { getNodePath };
|
|
8
|
+
export { getNodeSelector };
|
|
9
|
+
export { getNodeLabel };
|
|
10
|
+
export { isPositionFixed };
|
|
11
|
+
export { wrapRequestIdleCallback };
|
|
12
|
+
export { getBoundingClientRect };
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* `typed-query-selector`'s CSS selector parser.
|
|
16
|
+
*/
|
|
17
|
+
export type ParseSelector<T extends string> = import('typed-query-selector/parser').ParseSelector<T>;
|
|
18
|
+
/**
|
|
19
|
+
* @license Copyright 2018 The Lighthouse Authors. All Rights Reserved.
|
|
20
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* @fileoverview
|
|
25
|
+
* Helper functions that are passed by `toString()` by Driver to be evaluated in target page.
|
|
26
|
+
*
|
|
27
|
+
* Every function in this module only runs in the browser, so it is ignored from
|
|
28
|
+
* the c8 code coverage tool. See c8.sh
|
|
29
|
+
*
|
|
30
|
+
* Important: this module should only be imported like this:
|
|
31
|
+
* const pageFunctions = require('...');
|
|
32
|
+
* Never like this:
|
|
33
|
+
* const {justWhatINeed} = require('...');
|
|
34
|
+
* Otherwise, minification will mangle the variable names and break usage.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* `typed-query-selector`'s CSS selector parser.
|
|
38
|
+
* @template {string} T
|
|
39
|
+
* @typedef {import('typed-query-selector/parser').ParseSelector<T>} ParseSelector
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* The `exceptionDetails` provided by the debugger protocol does not contain the useful
|
|
43
|
+
* information such as name, message, and stack trace of the error when it's wrapped in a
|
|
44
|
+
* promise. Instead, map to a successful object that contains this information.
|
|
45
|
+
* @param {string|Error} [err] The error to convert
|
|
46
|
+
* @return {{__failedInBrowser: boolean, name: string, message: string, stack: string|undefined}}
|
|
47
|
+
*/
|
|
48
|
+
declare function wrapRuntimeEvalErrorInBrowser(err?: string | Error | undefined): {
|
|
49
|
+
__failedInBrowser: boolean;
|
|
50
|
+
name: string;
|
|
51
|
+
message: string;
|
|
52
|
+
stack: string | undefined;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* @template {string} T
|
|
56
|
+
* @param {T} selector Optional simple CSS selector to filter nodes on.
|
|
57
|
+
* Combinators are not supported.
|
|
58
|
+
* @return {Array<ParseSelector<T>>}
|
|
59
|
+
*/
|
|
60
|
+
declare function getElementsInDocument<T extends string>(selector: T): import("typed-query-selector/parser").ParseSelector<T, Element>[];
|
|
61
|
+
/**
|
|
62
|
+
* Gets the opening tag text of the given node.
|
|
63
|
+
* @param {Element|ShadowRoot} element
|
|
64
|
+
* @param {Array<string>=} ignoreAttrs An optional array of attribute tags to not include in the HTML snippet.
|
|
65
|
+
* @return {string}
|
|
66
|
+
*/
|
|
67
|
+
declare function getOuterHTMLSnippet(element: Element | ShadowRoot, ignoreAttrs?: Array<string> | undefined, snippetCharacterLimit?: number): string;
|
|
68
|
+
/**
|
|
69
|
+
* Computes a memory/CPU performance benchmark index to determine rough device class.
|
|
70
|
+
* @see https://github.com/GoogleChrome/lighthouse/issues/9085
|
|
71
|
+
* @see https://docs.google.com/spreadsheets/d/1E0gZwKsxegudkjJl8Fki_sOwHKpqgXwt8aBAfuUaB8A/edit?usp=sharing
|
|
72
|
+
*
|
|
73
|
+
* Historically (until LH 6.3), this benchmark created a string of length 100,000 in a loop, and returned
|
|
74
|
+
* the number of times per second the string can be created.
|
|
75
|
+
*
|
|
76
|
+
* Changes to v8 in 8.6.106 changed this number and also made Chrome more variable w.r.t GC interupts.
|
|
77
|
+
* This benchmark now is a hybrid of a similar GC-heavy approach to the original benchmark and an array
|
|
78
|
+
* copy benchmark.
|
|
79
|
+
*
|
|
80
|
+
* As of Chrome m86...
|
|
81
|
+
*
|
|
82
|
+
* - 1000+ is a desktop-class device, Core i3 PC, iPhone X, etc
|
|
83
|
+
* - 800+ is a high-end Android phone, Galaxy S8, low-end Chromebook, etc
|
|
84
|
+
* - 125+ is a mid-tier Android phone, Moto G4, etc
|
|
85
|
+
* - <125 is a budget Android phone, Alcatel Ideal, Galaxy J2, etc
|
|
86
|
+
* @return {number}
|
|
87
|
+
*/
|
|
88
|
+
declare function computeBenchmarkIndex(): number;
|
|
89
|
+
/**
|
|
90
|
+
* @param {Element|ShadowRoot} element
|
|
91
|
+
* @return {LH.Artifacts.NodeDetails}
|
|
92
|
+
*/
|
|
93
|
+
declare function getNodeDetails(element: Element | ShadowRoot): LH.Artifacts.NodeDetails;
|
|
94
|
+
declare namespace getNodeDetails {
|
|
95
|
+
function toString(): string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Adapted from DevTools' SDK.DOMNode.prototype.path
|
|
99
|
+
* https://github.com/ChromeDevTools/devtools-frontend/blob/4fff931bb/front_end/sdk/DOMModel.js#L625-L647
|
|
100
|
+
* Backend: https://source.chromium.org/search?q=f:node.cc%20symbol:PrintNodePathTo&sq=&ss=chromium%2Fchromium%2Fsrc
|
|
101
|
+
*
|
|
102
|
+
* TODO: DevTools nodePath handling doesn't support iframes, but probably could. https://crbug.com/1127635
|
|
103
|
+
* @param {Node} node
|
|
104
|
+
* @return {string}
|
|
105
|
+
*/
|
|
106
|
+
declare function getNodePath(node: Node): string;
|
|
107
|
+
/**
|
|
108
|
+
* @param {Element} element
|
|
109
|
+
* @return {string}
|
|
110
|
+
*
|
|
111
|
+
* Note: CSS Selectors having no standard mechanism to describe shadow DOM piercing. So we can't.
|
|
112
|
+
*
|
|
113
|
+
* If the node resides within shadow DOM, the selector *only* starts from the shadow root.
|
|
114
|
+
* For example, consider this img within a <section> within a shadow root..
|
|
115
|
+
* - DOM: <html> <body> <div> #shadow-root <section> <img/>
|
|
116
|
+
* - nodePath: 0,HTML,1,BODY,1,DIV,a,#document-fragment,0,SECTION,0,IMG
|
|
117
|
+
* - nodeSelector: section > img
|
|
118
|
+
*/
|
|
119
|
+
declare function getNodeSelector(element: Element): string;
|
|
120
|
+
/**
|
|
121
|
+
* Generate a human-readable label for the given element, based on end-user facing
|
|
122
|
+
* strings like the innerText or alt attribute.
|
|
123
|
+
* Returns label string or null if no useful label is found.
|
|
124
|
+
* @param {Element} element
|
|
125
|
+
* @return {string | null}
|
|
126
|
+
*/
|
|
127
|
+
declare function getNodeLabel(element: Element): string | null;
|
|
128
|
+
/**
|
|
129
|
+
* This function checks if an element or an ancestor of an element is `position:fixed`.
|
|
130
|
+
* In addition we ensure that the element is capable of behaving as a `position:fixed`
|
|
131
|
+
* element, checking that it lives within a scrollable ancestor.
|
|
132
|
+
* @param {HTMLElement} element
|
|
133
|
+
* @return {boolean}
|
|
134
|
+
*/
|
|
135
|
+
declare function isPositionFixed(element: HTMLElement): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* RequestIdleCallback shim that calculates the remaining deadline time in order to avoid a potential lighthouse
|
|
138
|
+
* penalty for tests run with simulated throttling. Reduces the deadline time to (50 - safetyAllowance) / cpuSlowdownMultiplier to
|
|
139
|
+
* ensure a long task is very unlikely if using the API correctly.
|
|
140
|
+
* @param {number} cpuSlowdownMultiplier
|
|
141
|
+
*/
|
|
142
|
+
declare function wrapRequestIdleCallback(cpuSlowdownMultiplier: number): void;
|
|
143
|
+
/**
|
|
144
|
+
* @param {Element} element
|
|
145
|
+
* @return {LH.Artifacts.Rect}
|
|
146
|
+
*/
|
|
147
|
+
declare function getBoundingClientRect(element: Element): LH.Artifacts.Rect;
|
|
148
|
+
export {};
|
|
149
|
+
//# sourceMappingURL=page-functions.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Helper functions to transform an LHR into a proto-ready LHR.
|
|
3
|
+
*
|
|
4
|
+
* FIXME: This file is 100% technical debt. Our eventual goal is for the
|
|
5
|
+
* roundtrip JSON to match the Golden LHR 1:1.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Transform an LHR into a proto-friendly, mostly-compatible LHR.
|
|
9
|
+
* @param {LH.Result} lhr
|
|
10
|
+
* @return {LH.Result}
|
|
11
|
+
*/
|
|
12
|
+
export function processForProto(lhr: LH.Result): LH.Result;
|
|
13
|
+
//# sourceMappingURL=proto-preprocessor.d.ts.map
|