lighthouse 9.6.8 → 10.0.0
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/.gitattributes +4 -1
- package/CONTRIBUTING.md +15 -15
- package/build-tracker.config.js +0 -1
- package/cli/bin.d.ts +5 -0
- package/cli/bin.js +140 -0
- package/cli/cli-flags.d.ts +258 -0
- package/cli/cli-flags.js +553 -0
- package/cli/commands/commands.d.ts +4 -0
- package/cli/commands/commands.js +9 -0
- package/cli/commands/list-audits.d.ts +2 -0
- package/cli/commands/list-audits.js +15 -0
- package/cli/commands/list-locales.d.ts +2 -0
- package/cli/commands/list-locales.js +15 -0
- package/cli/commands/list-trace-categories.d.ts +2 -0
- package/cli/commands/list-trace-categories.js +14 -0
- package/cli/index.d.ts +3 -0
- package/cli/index.js +10 -0
- package/cli/printer.d.ts +28 -0
- package/cli/printer.js +99 -0
- package/cli/run.d.ts +24 -0
- package/cli/run.js +284 -0
- package/cli/sentry-prompt.d.ts +5 -0
- package/cli/sentry-prompt.js +78 -0
- package/cli/test/smokehouse/__snapshots__/report-assert-test.js.snap +71 -0
- package/cli/test/smokehouse/config/exclusions.d.ts +12 -0
- package/cli/test/smokehouse/config/exclusions.js +36 -0
- package/cli/test/smokehouse/core-tests.d.ts +4 -0
- package/cli/test/smokehouse/core-tests.js +134 -0
- package/cli/test/smokehouse/frontends/back-compat-util.d.ts +16 -0
- package/cli/test/smokehouse/frontends/back-compat-util.js +41 -0
- package/cli/test/smokehouse/frontends/lib.d.ts +8 -0
- package/cli/test/smokehouse/frontends/lib.js +48 -0
- package/cli/test/smokehouse/frontends/node.d.ts +2 -0
- package/cli/test/smokehouse/frontends/node.js +12 -0
- package/cli/test/smokehouse/frontends/smokehouse-bin.d.ts +3 -0
- package/cli/test/smokehouse/frontends/smokehouse-bin.js +258 -0
- package/cli/test/smokehouse/lib/child-process-error.d.ts +21 -0
- package/cli/test/smokehouse/lib/child-process-error.js +25 -0
- package/cli/test/smokehouse/lib/concurrent-mapper.d.ts +78 -0
- package/cli/test/smokehouse/lib/concurrent-mapper.js +125 -0
- package/cli/test/smokehouse/lib/local-console.d.ts +33 -0
- package/cli/test/smokehouse/lib/local-console.js +50 -0
- package/cli/test/smokehouse/lighthouse-runners/bundle.d.ts +16 -0
- package/cli/test/smokehouse/lighthouse-runners/bundle.js +158 -0
- package/cli/test/smokehouse/lighthouse-runners/cli.d.ts +18 -0
- package/cli/test/smokehouse/lighthouse-runners/cli.js +134 -0
- package/cli/test/smokehouse/lighthouse-runners/devtools.d.ts +23 -0
- package/cli/test/smokehouse/lighthouse-runners/devtools.js +72 -0
- package/cli/test/smokehouse/readme.md +208 -0
- package/cli/test/smokehouse/report-assert-test.d.ts +2 -0
- package/cli/test/smokehouse/report-assert-test.js +298 -0
- package/cli/test/smokehouse/report-assert.d.ts +50 -0
- package/cli/test/smokehouse/report-assert.js +520 -0
- package/cli/test/smokehouse/smokehouse.d.ts +35 -0
- package/cli/test/smokehouse/smokehouse.js +336 -0
- package/cli/test/smokehouse/version-check-test.d.ts +2 -0
- package/cli/test/smokehouse/version-check-test.js +43 -0
- package/cli/test/smokehouse/version-check.d.ts +15 -0
- package/cli/test/smokehouse/version-check.js +48 -0
- package/commitlint.config.js +0 -1
- package/core/audits/accessibility/accesskeys.d.ts +10 -0
- package/core/audits/accessibility/accesskeys.js +44 -0
- package/core/audits/accessibility/aria-allowed-attr.d.ts +10 -0
- package/core/audits/accessibility/aria-allowed-attr.js +44 -0
- package/core/audits/accessibility/aria-command-name.d.ts +10 -0
- package/core/audits/accessibility/aria-command-name.js +42 -0
- package/core/audits/accessibility/aria-hidden-body.d.ts +10 -0
- package/core/audits/accessibility/aria-hidden-body.js +42 -0
- package/core/audits/accessibility/aria-hidden-focus.d.ts +10 -0
- package/core/audits/accessibility/aria-hidden-focus.js +42 -0
- package/core/audits/accessibility/aria-input-field-name.d.ts +10 -0
- package/core/audits/accessibility/aria-input-field-name.js +42 -0
- package/core/audits/accessibility/aria-meter-name.d.ts +10 -0
- package/core/audits/accessibility/aria-meter-name.js +42 -0
- package/core/audits/accessibility/aria-progressbar-name.d.ts +10 -0
- package/core/audits/accessibility/aria-progressbar-name.js +42 -0
- package/core/audits/accessibility/aria-required-attr.d.ts +10 -0
- package/core/audits/accessibility/aria-required-attr.js +43 -0
- package/core/audits/accessibility/aria-required-children.d.ts +10 -0
- package/core/audits/accessibility/aria-required-children.js +47 -0
- package/core/audits/accessibility/aria-required-parent.d.ts +10 -0
- package/core/audits/accessibility/aria-required-parent.js +45 -0
- package/core/audits/accessibility/aria-roles.d.ts +10 -0
- package/core/audits/accessibility/aria-roles.js +44 -0
- package/core/audits/accessibility/aria-toggle-field-name.d.ts +10 -0
- package/core/audits/accessibility/aria-toggle-field-name.js +42 -0
- package/core/audits/accessibility/aria-tooltip-name.d.ts +10 -0
- package/core/audits/accessibility/aria-tooltip-name.js +42 -0
- package/core/audits/accessibility/aria-treeitem-name.d.ts +10 -0
- package/core/audits/accessibility/aria-treeitem-name.js +42 -0
- package/core/audits/accessibility/aria-valid-attr-value.d.ts +10 -0
- package/core/audits/accessibility/aria-valid-attr-value.js +44 -0
- package/core/audits/accessibility/aria-valid-attr.d.ts +10 -0
- package/core/audits/accessibility/aria-valid-attr.js +44 -0
- package/core/audits/accessibility/axe-audit.d.ts +17 -0
- package/core/audits/accessibility/axe-audit.js +113 -0
- package/core/audits/accessibility/button-name.d.ts +10 -0
- package/core/audits/accessibility/button-name.js +44 -0
- package/core/audits/accessibility/bypass.d.ts +10 -0
- package/core/audits/accessibility/bypass.js +46 -0
- package/core/audits/accessibility/color-contrast.d.ts +10 -0
- package/core/audits/accessibility/color-contrast.js +45 -0
- package/core/audits/accessibility/definition-list.d.ts +10 -0
- package/core/audits/accessibility/definition-list.js +46 -0
- package/core/audits/accessibility/dlitem.d.ts +10 -0
- package/core/audits/accessibility/dlitem.js +44 -0
- package/core/audits/accessibility/document-title.d.ts +10 -0
- package/core/audits/accessibility/document-title.js +44 -0
- package/core/audits/accessibility/duplicate-id-active.d.ts +10 -0
- package/core/audits/accessibility/duplicate-id-active.js +42 -0
- package/core/audits/accessibility/duplicate-id-aria.d.ts +10 -0
- package/core/audits/accessibility/duplicate-id-aria.js +42 -0
- package/core/audits/accessibility/form-field-multiple-labels.d.ts +10 -0
- package/core/audits/accessibility/form-field-multiple-labels.js +43 -0
- package/core/audits/accessibility/frame-title.d.ts +10 -0
- package/core/audits/accessibility/frame-title.js +43 -0
- package/core/audits/accessibility/heading-order.d.ts +10 -0
- package/core/audits/accessibility/heading-order.js +42 -0
- package/core/audits/accessibility/html-has-lang.d.ts +10 -0
- package/core/audits/accessibility/html-has-lang.js +46 -0
- package/core/audits/accessibility/html-lang-valid.d.ts +10 -0
- package/core/audits/accessibility/html-lang-valid.js +45 -0
- package/core/audits/accessibility/image-alt.d.ts +10 -0
- package/core/audits/accessibility/image-alt.js +44 -0
- package/core/audits/accessibility/input-image-alt.d.ts +10 -0
- package/core/audits/accessibility/input-image-alt.js +44 -0
- package/core/audits/accessibility/label.d.ts +10 -0
- package/core/audits/accessibility/label.js +44 -0
- package/core/audits/accessibility/link-name.d.ts +10 -0
- package/core/audits/accessibility/link-name.js +45 -0
- package/core/audits/accessibility/list.d.ts +10 -0
- package/core/audits/accessibility/list.js +46 -0
- package/core/audits/accessibility/listitem.d.ts +10 -0
- package/core/audits/accessibility/listitem.js +45 -0
- package/core/audits/accessibility/manual/custom-controls-labels.d.ts +8 -0
- package/core/audits/accessibility/manual/custom-controls-labels.js +27 -0
- package/core/audits/accessibility/manual/custom-controls-roles.d.ts +8 -0
- package/core/audits/accessibility/manual/custom-controls-roles.js +27 -0
- package/core/audits/accessibility/manual/focus-traps.d.ts +8 -0
- package/core/audits/accessibility/manual/focus-traps.js +27 -0
- package/core/audits/accessibility/manual/focusable-controls.d.ts +8 -0
- package/core/audits/accessibility/manual/focusable-controls.js +27 -0
- package/core/audits/accessibility/manual/interactive-element-affordance.d.ts +8 -0
- package/core/audits/accessibility/manual/interactive-element-affordance.js +27 -0
- package/core/audits/accessibility/manual/logical-tab-order.d.ts +8 -0
- package/core/audits/accessibility/manual/logical-tab-order.js +27 -0
- package/core/audits/accessibility/manual/managed-focus.d.ts +8 -0
- package/core/audits/accessibility/manual/managed-focus.js +27 -0
- package/core/audits/accessibility/manual/offscreen-content-hidden.d.ts +9 -0
- package/core/audits/accessibility/manual/offscreen-content-hidden.js +28 -0
- package/core/audits/accessibility/manual/use-landmarks.d.ts +8 -0
- package/core/audits/accessibility/manual/use-landmarks.js +27 -0
- package/core/audits/accessibility/manual/visual-order-follows-dom.d.ts +8 -0
- package/core/audits/accessibility/manual/visual-order-follows-dom.js +27 -0
- package/core/audits/accessibility/meta-refresh.d.ts +10 -0
- package/core/audits/accessibility/meta-refresh.js +45 -0
- package/core/audits/accessibility/meta-viewport.d.ts +10 -0
- package/core/audits/accessibility/meta-viewport.js +46 -0
- package/core/audits/accessibility/object-alt.d.ts +10 -0
- package/core/audits/accessibility/object-alt.js +44 -0
- package/core/audits/accessibility/tabindex.d.ts +10 -0
- package/core/audits/accessibility/tabindex.js +44 -0
- package/core/audits/accessibility/td-headers-attr.d.ts +10 -0
- package/core/audits/accessibility/td-headers-attr.js +48 -0
- package/core/audits/accessibility/th-has-data-cells.d.ts +10 -0
- package/core/audits/accessibility/th-has-data-cells.js +48 -0
- package/core/audits/accessibility/valid-lang.d.ts +10 -0
- package/core/audits/accessibility/valid-lang.js +44 -0
- package/core/audits/accessibility/video-caption.d.ts +10 -0
- package/core/audits/accessibility/video-caption.js +46 -0
- package/core/audits/audit.d.ts +157 -0
- package/core/audits/audit.js +405 -0
- package/core/audits/autocomplete.d.ts +36 -0
- package/core/audits/autocomplete.js +290 -0
- package/core/audits/bf-cache.d.ts +21 -0
- package/core/audits/bf-cache.js +120 -0
- package/core/audits/bootup-time.d.ts +26 -0
- package/core/audits/bootup-time.js +151 -0
- package/core/audits/byte-efficiency/byte-efficiency-audit.d.ts +82 -0
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +260 -0
- package/core/audits/byte-efficiency/duplicated-javascript.d.ts +52 -0
- package/core/audits/byte-efficiency/duplicated-javascript.js +247 -0
- package/core/audits/byte-efficiency/efficient-animated-content.d.ts +23 -0
- package/core/audits/byte-efficiency/efficient-animated-content.js +92 -0
- package/core/audits/byte-efficiency/legacy-javascript.d.ts +100 -0
- package/core/audits/byte-efficiency/legacy-javascript.js +479 -0
- package/core/audits/byte-efficiency/modern-image-formats.d.ts +38 -0
- package/core/audits/byte-efficiency/modern-image-formats.js +186 -0
- package/core/audits/byte-efficiency/offscreen-images.d.ts +75 -0
- package/core/audits/byte-efficiency/offscreen-images.js +253 -0
- package/{lighthouse-core → core}/audits/byte-efficiency/polyfill-graph-data.json +0 -0
- package/core/audits/byte-efficiency/render-blocking-resources.d.ts +55 -0
- package/core/audits/byte-efficiency/render-blocking-resources.js +307 -0
- package/core/audits/byte-efficiency/total-byte-weight.d.ts +21 -0
- package/core/audits/byte-efficiency/total-byte-weight.js +109 -0
- package/core/audits/byte-efficiency/unminified-css.d.ts +36 -0
- package/core/audits/byte-efficiency/unminified-css.js +114 -0
- package/core/audits/byte-efficiency/unminified-javascript.d.ts +37 -0
- package/core/audits/byte-efficiency/unminified-javascript.js +118 -0
- package/core/audits/byte-efficiency/unused-css-rules.d.ts +16 -0
- package/core/audits/byte-efficiency/unused-css-rules.js +69 -0
- package/core/audits/byte-efficiency/unused-javascript.d.ts +27 -0
- package/core/audits/byte-efficiency/unused-javascript.js +163 -0
- package/core/audits/byte-efficiency/uses-long-cache-ttl.d.ts +61 -0
- package/core/audits/byte-efficiency/uses-long-cache-ttl.js +297 -0
- package/core/audits/byte-efficiency/uses-optimized-images.d.ts +33 -0
- package/core/audits/byte-efficiency/uses-optimized-images.js +145 -0
- package/core/audits/byte-efficiency/uses-responsive-images-snapshot.d.ts +16 -0
- package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +100 -0
- package/core/audits/byte-efficiency/uses-responsive-images.d.ts +45 -0
- package/core/audits/byte-efficiency/uses-responsive-images.js +201 -0
- package/core/audits/byte-efficiency/uses-text-compression.d.ts +14 -0
- package/core/audits/byte-efficiency/uses-text-compression.js +100 -0
- package/core/audits/content-width.d.ts +17 -0
- package/core/audits/content-width.js +76 -0
- package/core/audits/critical-request-chains.d.ts +44 -0
- package/core/audits/critical-request-chains.js +218 -0
- package/core/audits/csp-xss.d.ts +51 -0
- package/core/audits/csp-xss.js +186 -0
- package/core/audits/deprecations.d.ts +19 -0
- package/core/audits/deprecations.js +114 -0
- package/core/audits/diagnostics.d.ts +11 -0
- package/core/audits/diagnostics.js +79 -0
- package/core/audits/dobetterweb/charset.d.ts +19 -0
- package/core/audits/dobetterweb/charset.js +93 -0
- package/core/audits/dobetterweb/doctype.d.ts +21 -0
- package/core/audits/dobetterweb/doctype.js +120 -0
- package/core/audits/dobetterweb/dom-size.d.ts +26 -0
- package/core/audits/dobetterweb/dom-size.js +134 -0
- package/core/audits/dobetterweb/geolocation-on-start.d.ts +16 -0
- package/core/audits/dobetterweb/geolocation-on-start.js +69 -0
- package/core/audits/dobetterweb/inspector-issues.d.ts +45 -0
- package/core/audits/dobetterweb/inspector-issues.js +191 -0
- package/core/audits/dobetterweb/js-libraries.d.ts +15 -0
- package/core/audits/dobetterweb/js-libraries.js +87 -0
- package/core/audits/dobetterweb/no-document-write.d.ts +16 -0
- package/core/audits/dobetterweb/no-document-write.js +84 -0
- package/core/audits/dobetterweb/notification-on-start.d.ts +16 -0
- package/core/audits/dobetterweb/notification-on-start.js +68 -0
- package/core/audits/dobetterweb/paste-preventing-inputs.d.ts +15 -0
- package/core/audits/dobetterweb/paste-preventing-inputs.js +67 -0
- package/core/audits/dobetterweb/uses-http2.d.ts +72 -0
- package/core/audits/dobetterweb/uses-http2.js +264 -0
- package/core/audits/dobetterweb/uses-passive-event-listeners.d.ts +16 -0
- package/core/audits/dobetterweb/uses-passive-event-listeners.js +67 -0
- package/core/audits/errors-in-console.d.ts +31 -0
- package/core/audits/errors-in-console.js +120 -0
- package/core/audits/final-screenshot.d.ts +11 -0
- package/core/audits/final-screenshot.js +58 -0
- package/core/audits/font-display.d.ts +32 -0
- package/core/audits/font-display.js +193 -0
- package/core/audits/image-aspect-ratio.d.ts +30 -0
- package/core/audits/image-aspect-ratio.js +122 -0
- package/core/audits/image-size-responsive.d.ts +28 -0
- package/core/audits/image-size-responsive.js +332 -0
- package/core/audits/installable-manifest.d.ts +118 -0
- package/core/audits/installable-manifest.js +265 -0
- package/core/audits/is-on-https.d.ts +23 -0
- package/core/audits/is-on-https.js +123 -0
- package/core/audits/largest-contentful-paint-element.d.ts +14 -0
- package/core/audits/largest-contentful-paint-element.js +69 -0
- package/core/audits/layout-shift-elements.d.ts +15 -0
- package/core/audits/layout-shift-elements.js +74 -0
- package/core/audits/lcp-lazy-loaded.d.ts +21 -0
- package/core/audits/lcp-lazy-loaded.js +84 -0
- package/core/audits/long-tasks.d.ts +16 -0
- package/core/audits/long-tasks.js +124 -0
- package/core/audits/main-thread-tasks.d.ts +11 -0
- package/core/audits/main-thread-tasks.js +58 -0
- package/core/audits/mainthread-work-breakdown.d.ts +28 -0
- package/core/audits/mainthread-work-breakdown.js +135 -0
- package/core/audits/manual/manual-audit.d.ts +13 -0
- package/core/audits/manual/manual-audit.js +36 -0
- package/core/audits/manual/pwa-cross-browser.d.ts +12 -0
- package/core/audits/manual/pwa-cross-browser.js +40 -0
- package/core/audits/manual/pwa-each-page-has-url.d.ts +12 -0
- package/core/audits/manual/pwa-each-page-has-url.js +38 -0
- package/core/audits/manual/pwa-page-transitions.d.ts +12 -0
- package/core/audits/manual/pwa-page-transitions.js +38 -0
- package/core/audits/maskable-icon.d.ts +25 -0
- package/core/audits/maskable-icon.js +70 -0
- package/core/audits/metrics/cumulative-layout-shift.d.ts +21 -0
- package/core/audits/metrics/cumulative-layout-shift.js +79 -0
- package/core/audits/metrics/experimental-interaction-to-next-paint.d.ts +21 -0
- package/core/audits/metrics/experimental-interaction-to-next-paint.js +88 -0
- package/core/audits/metrics/first-contentful-paint-3g.d.ts +15 -0
- package/core/audits/metrics/first-contentful-paint-3g.js +69 -0
- package/core/audits/metrics/first-contentful-paint.d.ts +25 -0
- package/core/audits/metrics/first-contentful-paint.js +85 -0
- package/core/audits/metrics/first-meaningful-paint.d.ts +28 -0
- package/core/audits/metrics/first-meaningful-paint.js +89 -0
- package/core/audits/metrics/interactive.d.ts +31 -0
- package/core/audits/metrics/interactive.js +93 -0
- package/core/audits/metrics/largest-contentful-paint.d.ts +25 -0
- package/core/audits/metrics/largest-contentful-paint.js +94 -0
- package/core/audits/metrics/max-potential-fid.d.ts +23 -0
- package/core/audits/metrics/max-potential-fid.js +77 -0
- package/core/audits/metrics/speed-index.d.ts +27 -0
- package/core/audits/metrics/speed-index.js +88 -0
- package/core/audits/metrics/total-blocking-time.d.ts +32 -0
- package/core/audits/metrics/total-blocking-time.js +118 -0
- package/core/audits/metrics.d.ts +11 -0
- package/core/audits/metrics.js +73 -0
- package/core/audits/multi-check-audit.d.ts +28 -0
- package/core/audits/multi-check-audit.js +82 -0
- package/core/audits/network-requests.d.ts +11 -0
- package/core/audits/network-requests.js +129 -0
- package/core/audits/network-rtt.d.ts +15 -0
- package/core/audits/network-rtt.js +89 -0
- package/core/audits/network-server-latency.d.ts +15 -0
- package/core/audits/network-server-latency.js +88 -0
- package/core/audits/no-unload-listeners.d.ts +16 -0
- package/core/audits/no-unload-listeners.js +86 -0
- package/core/audits/non-composited-animations.d.ts +21 -0
- package/core/audits/non-composited-animations.js +205 -0
- package/core/audits/oopif-iframe-test-audit.d.ts +14 -0
- package/core/audits/oopif-iframe-test-audit.js +29 -0
- package/core/audits/performance-budget.d.ts +39 -0
- package/core/audits/performance-budget.js +154 -0
- package/core/audits/predictive-perf.d.ts +11 -0
- package/core/audits/predictive-perf.js +100 -0
- package/core/audits/preload-fonts.d.ts +29 -0
- package/core/audits/preload-fonts.js +106 -0
- package/core/audits/prioritize-lcp-image.d.ts +76 -0
- package/core/audits/prioritize-lcp-image.js +290 -0
- package/core/audits/redirects.d.ts +33 -0
- package/core/audits/redirects.js +164 -0
- package/core/audits/resource-summary.d.ts +16 -0
- package/core/audits/resource-summary.js +104 -0
- package/core/audits/screenshot-thumbnails.d.ts +33 -0
- package/core/audits/screenshot-thumbnails.js +168 -0
- package/core/audits/script-elements-test-audit.d.ts +14 -0
- package/core/audits/script-elements-test-audit.js +29 -0
- package/core/audits/script-treemap-data.d.ts +42 -0
- package/core/audits/script-treemap-data.js +287 -0
- package/core/audits/seo/canonical.d.ts +51 -0
- package/core/audits/seo/canonical.js +217 -0
- package/core/audits/seo/crawlable-anchors.d.ts +16 -0
- package/core/audits/seo/crawlable-anchors.js +93 -0
- package/core/audits/seo/font-size.d.ts +24 -0
- package/core/audits/seo/font-size.js +344 -0
- package/core/audits/seo/hreflang.d.ts +28 -0
- package/core/audits/seo/hreflang.js +148 -0
- package/core/audits/seo/http-status-code.d.ts +16 -0
- package/core/audits/seo/http-status-code.js +68 -0
- package/core/audits/seo/is-crawlable.d.ts +38 -0
- package/core/audits/seo/is-crawlable.js +223 -0
- package/core/audits/seo/link-text.d.ts +16 -0
- package/core/audits/seo/link-text.js +160 -0
- package/core/audits/seo/manual/structured-data.d.ts +12 -0
- package/core/audits/seo/manual/structured-data.js +37 -0
- package/core/audits/seo/meta-description.d.ts +16 -0
- package/core/audits/seo/meta-description.js +66 -0
- package/core/audits/seo/plugins.d.ts +15 -0
- package/core/audits/seo/plugins.js +150 -0
- package/core/audits/seo/robots-txt.d.ts +18 -0
- package/core/audits/seo/robots-txt.js +255 -0
- package/core/audits/seo/tap-targets.d.ts +50 -0
- package/core/audits/seo/tap-targets.js +352 -0
- package/core/audits/server-response-time.d.ts +21 -0
- package/core/audits/server-response-time.js +90 -0
- package/core/audits/service-worker.d.ts +46 -0
- package/core/audits/service-worker.js +182 -0
- package/core/audits/splash-screen.d.ts +37 -0
- package/core/audits/splash-screen.js +98 -0
- package/core/audits/themed-omnibox.d.ts +42 -0
- package/core/audits/themed-omnibox.js +102 -0
- package/core/audits/third-party-facades.d.ts +42 -0
- package/core/audits/third-party-facades.js +224 -0
- package/core/audits/third-party-summary.d.ts +59 -0
- package/core/audits/third-party-summary.js +257 -0
- package/core/audits/timing-budget.d.ts +43 -0
- package/core/audits/timing-budget.js +174 -0
- package/core/audits/unsized-images.d.ts +39 -0
- package/core/audits/unsized-images.js +162 -0
- package/core/audits/user-timings.d.ts +43 -0
- package/core/audits/user-timings.js +118 -0
- package/core/audits/uses-rel-preconnect.d.ts +37 -0
- package/core/audits/uses-rel-preconnect.js +253 -0
- package/core/audits/uses-rel-preload.d.ts +61 -0
- package/core/audits/uses-rel-preload.js +269 -0
- package/core/audits/valid-source-maps.d.ts +29 -0
- package/core/audits/valid-source-maps.js +160 -0
- package/core/audits/viewport.d.ts +17 -0
- package/core/audits/viewport.js +64 -0
- package/core/audits/violation-audit.d.ts +14 -0
- package/core/audits/violation-audit.js +49 -0
- package/core/audits/work-during-interaction.d.ts +82 -0
- package/core/audits/work-during-interaction.js +279 -0
- package/core/computed/computed-artifact.d.ts +15 -0
- package/core/computed/computed-artifact.js +62 -0
- package/core/computed/critical-request-chains.d.ts +40 -0
- package/core/computed/critical-request-chains.js +143 -0
- package/core/computed/entity-classification.d.ts +29 -0
- package/core/computed/entity-classification.js +103 -0
- package/core/computed/image-records.d.ts +24 -0
- package/core/computed/image-records.js +64 -0
- package/core/computed/js-bundles.d.ts +13 -0
- package/core/computed/js-bundles.js +120 -0
- package/core/computed/load-simulator.d.ts +28 -0
- package/core/computed/load-simulator.js +92 -0
- package/core/computed/main-resource.d.ts +25 -0
- package/core/computed/main-resource.js +35 -0
- package/core/computed/main-thread-tasks.d.ts +15 -0
- package/core/computed/main-thread-tasks.js +25 -0
- package/core/computed/manifest-values.d.ts +24 -0
- package/core/computed/manifest-values.js +136 -0
- package/core/computed/metrics/cumulative-layout-shift.d.ts +53 -0
- package/core/computed/metrics/cumulative-layout-shift.js +125 -0
- package/core/computed/metrics/first-contentful-paint-all-frames.d.ts +19 -0
- package/core/computed/metrics/first-contentful-paint-all-frames.js +37 -0
- package/core/computed/metrics/first-contentful-paint.d.ts +15 -0
- package/core/computed/metrics/first-contentful-paint.js +40 -0
- package/core/computed/metrics/first-meaningful-paint.d.ts +15 -0
- package/core/computed/metrics/first-meaningful-paint.js +44 -0
- package/core/computed/metrics/interactive.d.ts +61 -0
- package/core/computed/metrics/interactive.js +192 -0
- package/core/computed/metrics/lantern-first-contentful-paint.d.ts +48 -0
- package/core/computed/metrics/lantern-first-contentful-paint.js +204 -0
- package/core/computed/metrics/lantern-first-meaningful-paint.d.ts +12 -0
- package/core/computed/metrics/lantern-first-meaningful-paint.js +83 -0
- package/core/computed/metrics/lantern-interactive.d.ts +31 -0
- package/core/computed/metrics/lantern-interactive.js +113 -0
- package/core/computed/metrics/lantern-largest-contentful-paint.d.ts +25 -0
- package/core/computed/metrics/lantern-largest-contentful-paint.js +111 -0
- package/core/computed/metrics/lantern-max-potential-fid.d.ts +30 -0
- package/core/computed/metrics/lantern-max-potential-fid.js +93 -0
- package/core/computed/metrics/lantern-metric.d.ts +78 -0
- package/core/computed/metrics/lantern-metric.js +162 -0
- package/core/computed/metrics/lantern-speed-index.d.ts +38 -0
- package/core/computed/metrics/lantern-speed-index.js +150 -0
- package/core/computed/metrics/lantern-total-blocking-time.d.ts +31 -0
- package/core/computed/metrics/lantern-total-blocking-time.js +126 -0
- package/core/computed/metrics/largest-contentful-paint-all-frames.d.ts +20 -0
- package/core/computed/metrics/largest-contentful-paint-all-frames.js +45 -0
- package/core/computed/metrics/largest-contentful-paint.d.ts +15 -0
- package/core/computed/metrics/largest-contentful-paint.js +52 -0
- package/core/computed/metrics/max-potential-fid.d.ts +15 -0
- package/core/computed/metrics/max-potential-fid.js +45 -0
- package/core/computed/metrics/metric.d.ts +38 -0
- package/core/computed/metrics/metric.js +100 -0
- package/core/computed/metrics/navigation-metric.d.ts +16 -0
- package/core/computed/metrics/navigation-metric.js +46 -0
- package/core/computed/metrics/responsiveness.d.ts +87 -0
- package/core/computed/metrics/responsiveness.js +160 -0
- package/core/computed/metrics/speed-index.d.ts +10 -0
- package/core/computed/metrics/speed-index.js +40 -0
- package/core/computed/metrics/tbt-utils.d.ts +18 -0
- package/core/computed/metrics/tbt-utils.js +56 -0
- package/core/computed/metrics/timing-summary.d.ts +46 -0
- package/core/computed/metrics/timing-summary.js +157 -0
- package/core/computed/metrics/total-blocking-time.d.ts +23 -0
- package/core/computed/metrics/total-blocking-time.js +74 -0
- package/core/computed/module-duplication.d.ts +37 -0
- package/core/computed/module-duplication.js +138 -0
- package/core/computed/network-analysis.d.ts +20 -0
- package/core/computed/network-analysis.js +64 -0
- package/core/computed/network-records.d.ts +15 -0
- package/core/computed/network-records.js +22 -0
- package/core/computed/page-dependency-graph.d.ts +88 -0
- package/core/computed/page-dependency-graph.js +516 -0
- package/core/computed/processed-navigation.d.ts +21 -0
- package/core/computed/processed-navigation.js +37 -0
- package/core/computed/processed-trace.d.ts +14 -0
- package/core/computed/processed-trace.js +21 -0
- package/core/computed/resource-summary.d.ts +46 -0
- package/core/computed/resource-summary.js +118 -0
- package/core/computed/screenshots.d.ts +20 -0
- package/core/computed/screenshots.js +29 -0
- package/core/computed/speedline.d.ts +15 -0
- package/core/computed/speedline.js +55 -0
- package/core/computed/unused-css.d.ts +62 -0
- package/core/computed/unused-css.js +153 -0
- package/core/computed/unused-javascript-summary.d.ts +71 -0
- package/core/computed/unused-javascript-summary.js +155 -0
- package/core/computed/user-timings.d.ts +31 -0
- package/core/computed/user-timings.js +83 -0
- package/core/computed/viewport-meta.d.ts +35 -0
- package/core/computed/viewport-meta.js +56 -0
- package/core/config/budget.d.ts +74 -0
- package/core/config/budget.js +340 -0
- package/core/config/config-helpers.d.ts +94 -0
- package/core/config/config-helpers.js +630 -0
- package/core/config/config-plugin.d.ts +46 -0
- package/core/config/config-plugin.js +250 -0
- package/core/config/config.d.ts +28 -0
- package/core/config/config.js +344 -0
- package/core/config/constants.d.ts +86 -0
- package/core/config/constants.js +175 -0
- package/core/config/default-config.d.ts +5 -0
- package/core/config/default-config.js +637 -0
- package/core/config/desktop-config.d.ts +5 -0
- package/core/config/desktop-config.js +21 -0
- package/core/config/experimental-config.d.ts +13 -0
- package/core/config/experimental-config.js +29 -0
- package/core/config/filters.d.ts +83 -0
- package/core/config/filters.js +344 -0
- package/core/config/full-config.d.ts +9 -0
- package/core/config/full-config.js +13 -0
- package/core/config/lr-desktop-config.d.ts +4 -0
- package/core/config/lr-desktop-config.js +28 -0
- package/core/config/lr-mobile-config.d.ts +9 -0
- package/core/config/lr-mobile-config.js +33 -0
- package/core/config/metrics-to-audits.d.ts +19 -0
- package/core/config/metrics-to-audits.js +61 -0
- package/core/config/perf-config.d.ts +9 -0
- package/core/config/perf-config.js +16 -0
- package/core/config/validation.d.ts +77 -0
- package/core/config/validation.js +312 -0
- package/core/gather/base-artifacts.d.ts +16 -0
- package/core/gather/base-artifacts.js +95 -0
- package/core/gather/base-gatherer.d.ts +72 -0
- package/core/gather/base-gatherer.js +108 -0
- package/core/gather/driver/dom.d.ts +20 -0
- package/core/gather/driver/dom.js +57 -0
- package/core/gather/driver/environment.d.ts +35 -0
- package/core/gather/driver/environment.js +105 -0
- package/core/gather/driver/execution-context.d.ts +101 -0
- package/core/gather/driver/execution-context.js +262 -0
- package/core/gather/driver/navigation.d.ts +33 -0
- package/core/gather/driver/navigation.js +182 -0
- package/core/gather/driver/network-monitor.d.ts +82 -0
- package/core/gather/driver/network-monitor.js +260 -0
- package/core/gather/driver/network.d.ts +10 -0
- package/core/gather/driver/network.js +27 -0
- package/core/gather/driver/prepare.d.ts +52 -0
- package/core/gather/driver/prepare.js +244 -0
- package/core/gather/driver/service-workers.d.ts +16 -0
- package/core/gather/driver/service-workers.js +52 -0
- package/core/gather/driver/storage.d.ts +24 -0
- package/core/gather/driver/storage.js +149 -0
- package/core/gather/driver/target-manager.d.ts +61 -0
- package/core/gather/driver/target-manager.js +209 -0
- package/core/gather/driver/wait-for-condition.d.ts +116 -0
- package/core/gather/driver/wait-for-condition.js +544 -0
- package/core/gather/driver.d.ts +30 -0
- package/core/gather/driver.js +92 -0
- package/core/gather/fetcher.d.ts +63 -0
- package/core/gather/fetcher.js +143 -0
- package/core/gather/gatherers/accessibility.d.ts +23 -0
- package/core/gather/gatherers/accessibility.js +199 -0
- package/core/gather/gatherers/anchor-elements.d.ts +10 -0
- package/core/gather/gatherers/anchor-elements.js +132 -0
- package/core/gather/gatherers/bf-cache-failures.d.ts +43 -0
- package/core/gather/gatherers/bf-cache-failures.js +179 -0
- package/core/gather/gatherers/cache-contents.d.ts +11 -0
- package/core/gather/gatherers/cache-contents.js +58 -0
- package/core/gather/gatherers/console-messages.d.ts +39 -0
- package/core/gather/gatherers/console-messages.js +174 -0
- package/core/gather/gatherers/css-usage.d.ts +39 -0
- package/core/gather/gatherers/css-usage.js +150 -0
- package/core/gather/gatherers/devtools-log-compat.d.ts +13 -0
- package/core/gather/gatherers/devtools-log-compat.js +35 -0
- package/core/gather/gatherers/devtools-log.d.ts +48 -0
- package/core/gather/gatherers/devtools-log.js +115 -0
- package/core/gather/gatherers/dobetterweb/doctype.d.ts +10 -0
- package/core/gather/gatherers/dobetterweb/doctype.js +47 -0
- package/core/gather/gatherers/dobetterweb/domstats.d.ts +10 -0
- package/core/gather/gatherers/dobetterweb/domstats.js +102 -0
- package/core/gather/gatherers/dobetterweb/optimized-images.d.ts +61 -0
- package/core/gather/gatherers/dobetterweb/optimized-images.js +193 -0
- package/core/gather/gatherers/dobetterweb/response-compression.d.ts +30 -0
- package/core/gather/gatherers/dobetterweb/response-compression.js +155 -0
- package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.d.ts +53 -0
- package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +237 -0
- package/core/gather/gatherers/full-page-screenshot.d.ts +35 -0
- package/core/gather/gatherers/full-page-screenshot.js +258 -0
- package/core/gather/gatherers/gatherer.d.ts +46 -0
- package/core/gather/gatherers/gatherer.js +58 -0
- package/core/gather/gatherers/global-listeners.d.ts +27 -0
- package/core/gather/gatherers/global-listeners.js +91 -0
- package/core/gather/gatherers/iframe-elements.d.ts +11 -0
- package/core/gather/gatherers/iframe-elements.js +67 -0
- package/core/gather/gatherers/image-elements.d.ts +35 -0
- package/core/gather/gatherers/image-elements.js +378 -0
- package/core/gather/gatherers/inputs.d.ts +10 -0
- package/core/gather/gatherers/inputs.js +118 -0
- package/core/gather/gatherers/inspector-issues.d.ts +38 -0
- package/core/gather/gatherers/inspector-issues.js +126 -0
- package/core/gather/gatherers/installability-errors.d.ts +17 -0
- package/core/gather/gatherers/installability-errors.js +56 -0
- package/core/gather/gatherers/js-usage.d.ts +22 -0
- package/core/gather/gatherers/js-usage.js +74 -0
- package/core/gather/gatherers/link-elements.d.ts +39 -0
- package/core/gather/gatherers/link-elements.js +181 -0
- package/core/gather/gatherers/main-document-content.d.ts +27 -0
- package/core/gather/gatherers/main-document-content.js +53 -0
- package/core/gather/gatherers/meta-elements.d.ts +10 -0
- package/core/gather/gatherers/meta-elements.js +67 -0
- package/core/gather/gatherers/network-user-agent.d.ts +18 -0
- package/core/gather/gatherers/network-user-agent.js +41 -0
- package/core/gather/gatherers/script-elements.d.ts +26 -0
- package/core/gather/gatherers/script-elements.js +110 -0
- package/core/gather/gatherers/scripts.d.ts +27 -0
- package/core/gather/gatherers/scripts.js +139 -0
- package/core/gather/gatherers/seo/embedded-content.d.ts +10 -0
- package/core/gather/gatherers/seo/embedded-content.js +63 -0
- package/core/gather/gatherers/seo/font-size.d.ts +131 -0
- package/core/gather/gatherers/seo/font-size.js +339 -0
- package/core/gather/gatherers/seo/robots-txt.d.ts +10 -0
- package/core/gather/gatherers/seo/robots-txt.js +27 -0
- package/core/gather/gatherers/seo/tap-targets.d.ts +21 -0
- package/core/gather/gatherers/seo/tap-targets.js +389 -0
- package/core/gather/gatherers/service-worker.d.ts +16 -0
- package/core/gather/gatherers/service-worker.js +44 -0
- package/core/gather/gatherers/source-maps.d.ts +50 -0
- package/core/gather/gatherers/source-maps.js +155 -0
- package/core/gather/gatherers/stacks.d.ts +38 -0
- package/core/gather/gatherers/stacks.js +137 -0
- package/core/gather/gatherers/trace-compat.d.ts +13 -0
- package/core/gather/gatherers/trace-compat.js +35 -0
- package/core/gather/gatherers/trace-elements.d.ts +83 -0
- package/core/gather/gatherers/trace-elements.js +349 -0
- package/core/gather/gatherers/trace.d.ts +23 -0
- package/core/gather/gatherers/trace.js +130 -0
- package/core/gather/gatherers/viewport-dimensions.d.ts +10 -0
- package/core/gather/gatherers/viewport-dimensions.js +57 -0
- package/core/gather/gatherers/web-app-manifest.d.ts +32 -0
- package/core/gather/gatherers/web-app-manifest.js +106 -0
- package/core/gather/navigation-runner.d.ts +94 -0
- package/core/gather/navigation-runner.js +386 -0
- package/core/gather/runner-helpers.d.ts +39 -0
- package/core/gather/runner-helpers.js +159 -0
- package/core/gather/session.d.ts +50 -0
- package/core/gather/session.js +114 -0
- package/core/gather/snapshot-runner.d.ts +10 -0
- package/core/gather/snapshot-runner.js +67 -0
- package/core/gather/timespan-runner.d.ts +12 -0
- package/core/gather/timespan-runner.js +85 -0
- package/core/index.cjs +21 -0
- package/core/index.d.cts +4 -0
- package/core/index.d.ts +88 -0
- package/core/index.js +172 -0
- package/core/legacy/config/config.d.ts +107 -0
- package/core/legacy/config/config.js +566 -0
- package/core/legacy/config/legacy-default-config.d.ts +4 -0
- package/core/legacy/config/legacy-default-config.js +87 -0
- package/core/legacy/gather/connections/connection.d.ts +75 -0
- package/core/legacy/gather/connections/connection.js +181 -0
- package/core/legacy/gather/connections/cri.d.ts +27 -0
- package/core/legacy/gather/connections/cri.js +162 -0
- package/core/legacy/gather/connections/raw.d.ts +20 -0
- package/core/legacy/gather/connections/raw.js +57 -0
- package/core/legacy/gather/driver.d.ts +215 -0
- package/core/legacy/gather/driver.js +469 -0
- package/core/legacy/gather/gather-runner.d.ts +166 -0
- package/core/legacy/gather/gather-runner.js +590 -0
- package/core/lib/arbitrary-equality-map.d.ts +47 -0
- package/core/lib/arbitrary-equality-map.js +80 -0
- package/core/lib/asset-saver.d.ts +101 -0
- package/core/lib/asset-saver.js +451 -0
- package/core/lib/axe.d.ts +2 -0
- package/core/lib/axe.js +17 -0
- package/core/lib/bf-cache-strings.d.ts +121 -0
- package/core/lib/bf-cache-strings.js +661 -0
- package/core/lib/cdt/Common.d.ts +3 -0
- package/core/lib/cdt/Common.js +12 -0
- package/core/lib/cdt/Platform.d.ts +26 -0
- package/core/lib/cdt/Platform.js +57 -0
- package/core/lib/cdt/SDK.d.ts +2 -0
- package/core/lib/cdt/SDK.js +28 -0
- package/core/lib/cdt/generated/ParsedURL.d.ts +28 -0
- package/core/lib/cdt/generated/ParsedURL.js +178 -0
- package/core/lib/cdt/generated/SourceMap.d.ts +100 -0
- package/core/lib/cdt/generated/SourceMap.js +527 -0
- package/core/lib/cdt/package.json +4 -0
- package/core/lib/csp-evaluator.d.ts +41 -0
- package/core/lib/csp-evaluator.js +170 -0
- package/core/lib/dependency-graph/base-node.d.ts +161 -0
- package/core/lib/dependency-graph/base-node.js +364 -0
- package/core/lib/dependency-graph/cpu-node.d.ts +34 -0
- package/core/lib/dependency-graph/cpu-node.js +86 -0
- package/core/lib/dependency-graph/network-node.d.ts +43 -0
- package/core/lib/dependency-graph/network-node.js +99 -0
- package/core/lib/dependency-graph/simulator/connection-pool.d.ts +58 -0
- package/core/lib/dependency-graph/simulator/connection-pool.js +171 -0
- package/core/lib/dependency-graph/simulator/dns-cache.d.ts +42 -0
- package/core/lib/dependency-graph/simulator/dns-cache.js +74 -0
- package/core/lib/dependency-graph/simulator/network-analyzer.d.ts +166 -0
- package/core/lib/dependency-graph/simulator/network-analyzer.js +479 -0
- package/core/lib/dependency-graph/simulator/simulator-timing-map.d.ts +153 -0
- package/core/lib/dependency-graph/simulator/simulator-timing-map.js +220 -0
- package/core/lib/dependency-graph/simulator/simulator.d.ts +154 -0
- package/core/lib/dependency-graph/simulator/simulator.js +540 -0
- package/core/lib/dependency-graph/simulator/tcp-connection.d.ts +89 -0
- package/core/lib/dependency-graph/simulator/tcp-connection.js +230 -0
- package/core/lib/deprecations-strings.d.ts +66 -0
- package/core/lib/deprecations-strings.js +654 -0
- package/core/lib/emulation.d.ts +43 -0
- package/core/lib/emulation.js +163 -0
- package/core/lib/i18n/README.md +290 -0
- package/core/lib/i18n/i18n.d.ts +81 -0
- package/core/lib/i18n/i18n.js +229 -0
- package/core/lib/icons.d.ts +22 -0
- package/core/lib/icons.js +82 -0
- package/core/lib/lantern-trace-saver.d.ts +20 -0
- package/core/lib/lantern-trace-saver.js +260 -0
- package/core/lib/lh-env.d.ts +2 -0
- package/core/lib/lh-env.js +15 -0
- package/core/lib/lh-error.d.ts +328 -0
- package/core/lib/lh-error.js +425 -0
- package/core/lib/lh-trace-processor.d.ts +5 -0
- package/core/lib/lh-trace-processor.js +45 -0
- package/core/lib/lighthouse-compatibility.d.ts +8 -0
- package/core/lib/lighthouse-compatibility.js +139 -0
- package/core/lib/manifest-parser.d.ts +186 -0
- package/core/lib/manifest-parser.js +495 -0
- package/core/lib/median-run.d.ts +17 -0
- package/core/lib/median-run.js +92 -0
- package/core/lib/minification-estimator.d.ts +9 -0
- package/core/lib/minification-estimator.js +192 -0
- package/core/lib/minify-devtoolslog.d.ts +6 -0
- package/core/lib/minify-devtoolslog.js +86 -0
- package/core/lib/navigation-error.d.ts +39 -0
- package/core/lib/navigation-error.js +175 -0
- package/core/lib/network-recorder.d.ts +115 -0
- package/core/lib/network-recorder.js +341 -0
- package/core/lib/network-request.d.ts +247 -0
- package/core/lib/network-request.js +590 -0
- package/core/lib/page-functions.d.ts +149 -0
- package/core/lib/page-functions.js +544 -0
- package/core/lib/proto-preprocessor.d.ts +13 -0
- package/core/lib/proto-preprocessor.js +133 -0
- package/core/lib/rect-helpers.d.ts +100 -0
- package/core/lib/rect-helpers.js +251 -0
- package/core/lib/script-helpers.d.ts +17 -0
- package/core/lib/script-helpers.js +31 -0
- package/core/lib/sentry.d.ts +32 -0
- package/core/lib/sentry.js +143 -0
- package/core/lib/stack-packs.d.ts +16 -0
- package/core/lib/stack-packs.js +126 -0
- package/core/lib/statistics.d.ts +28 -0
- package/core/lib/statistics.js +103 -0
- package/core/lib/tappable-rects.d.ts +8 -0
- package/core/lib/tappable-rects.js +98 -0
- package/core/lib/third-party-web.d.ts +32 -0
- package/core/lib/third-party-web.js +52 -0
- package/core/lib/timing-trace-saver.d.ts +21 -0
- package/core/lib/timing-trace-saver.js +96 -0
- package/core/lib/tracehouse/cpu-profile-model.d.ts +228 -0
- package/core/lib/tracehouse/cpu-profile-model.js +591 -0
- package/core/lib/tracehouse/main-thread-tasks.d.ts +162 -0
- package/core/lib/tracehouse/main-thread-tasks.js +688 -0
- package/core/lib/tracehouse/task-groups.d.ts +66 -0
- package/core/lib/tracehouse/task-groups.js +111 -0
- package/core/lib/tracehouse/task-summary.d.ts +18 -0
- package/core/lib/tracehouse/task-summary.js +86 -0
- package/core/lib/tracehouse/trace-processor.d.ts +284 -0
- package/core/lib/tracehouse/trace-processor.js +1016 -0
- package/core/lib/traces/metric-trace-events.d.ts +65 -0
- package/core/lib/traces/metric-trace-events.js +200 -0
- package/core/lib/url-utils.d.ts +100 -0
- package/core/lib/url-utils.js +266 -0
- package/core/runner.d.ts +114 -0
- package/core/runner.js +563 -0
- package/core/scoring.d.ts +26 -0
- package/core/scoring.js +91 -0
- package/core/scripts/download-chrome.sh +36 -0
- package/core/scripts/manual-chrome-launcher.js +50 -0
- package/core/user-flow.d.ts +106 -0
- package/core/user-flow.js +354 -0
- package/dist/report/bundle.esm.js +1485 -1281
- package/dist/report/flow.js +37 -25
- package/dist/report/standalone.js +35 -19
- package/eslint-local-rules.cjs +106 -0
- package/eslint-local-rules.d.cts +6 -0
- package/esm-utils.d.ts +14 -0
- package/esm-utils.js +38 -0
- package/flow-report/api.d.ts +7 -0
- package/flow-report/assets/standalone-flow-template.html +1 -1
- package/flow-report/clients/standalone.d.ts +7 -0
- package/flow-report/src/app.d.ts +11 -0
- package/flow-report/src/app.tsx +1 -1
- package/flow-report/src/common.d.ts +20 -0
- package/flow-report/src/common.tsx +3 -3
- package/flow-report/src/header.d.ts +10 -0
- package/flow-report/src/header.tsx +1 -1
- package/flow-report/src/help-dialog.d.ts +10 -0
- package/flow-report/src/i18n/i18n.d.ts +212 -0
- package/flow-report/src/i18n/i18n.tsx +24 -19
- 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/sidebar/sidebar.tsx +7 -4
- package/flow-report/src/summary/category.d.ts +19 -0
- package/flow-report/src/summary/category.tsx +10 -10
- package/flow-report/src/summary/summary.d.ts +18 -0
- package/flow-report/src/summary/summary.tsx +4 -4
- package/flow-report/src/topbar.d.ts +15 -0
- package/flow-report/src/topbar.tsx +14 -30
- package/flow-report/src/util.d.ts +30 -0
- package/flow-report/src/util.ts +2 -13
- 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/report.tsx +1 -1
- 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/common-test.tsx +11 -12
- package/flow-report/test/flow-report-pptr-test.d.ts +7 -0
- package/flow-report/test/flow-report-pptr-test.ts +21 -8
- package/flow-report/test/header-test.d.ts +7 -0
- package/flow-report/test/run-flow-report-tests.sh +20 -0
- package/flow-report/test/sample-flow.d.ts +7 -0
- package/flow-report/test/sample-flow.ts +1 -1
- package/flow-report/test/setup/env-setup.d.ts +11 -0
- package/flow-report/test/setup/env-setup.ts +47 -24
- 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/sidebar/sidebar-test.tsx +30 -3
- 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/summary/summary-test.tsx +1 -1
- package/flow-report/test/topbar-test.d.ts +7 -0
- package/flow-report/test/topbar-test.tsx +11 -12
- package/flow-report/test/util-test.d.ts +7 -0
- package/flow-report/test/util-test.tsx +3 -3
- 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 +5 -3
- package/flow-report/types/flow-report.d.ts +8 -1
- package/package.json +86 -80
- package/readme.md +27 -40
- package/report/README.md +8 -9
- package/report/assets/standalone-template.html +1 -1
- package/report/assets/styles.css +35 -17
- package/report/assets/templates.html +14 -37
- package/report/clients/bundle.d.ts +6 -0
- package/report/clients/bundle.js +1 -2
- package/report/clients/standalone.d.ts +2 -0
- package/report/clients/standalone.js +0 -1
- package/report/generator/file-namer.d.ts +35 -0
- package/report/generator/file-namer.js +7 -3
- package/report/generator/flow-report-assets.d.ts +9 -0
- package/report/generator/flow-report-assets.js +10 -6
- package/report/generator/report-assets.d.ts +8 -0
- package/report/generator/report-assets.js +8 -5
- package/report/generator/report-generator.d.ts +59 -0
- package/report/generator/report-generator.js +76 -34
- package/report/generator/tsconfig.json +1 -2
- package/report/renderer/api.d.ts +31 -0
- package/report/renderer/api.js +0 -2
- package/report/renderer/category-renderer.d.ts +176 -0
- package/report/renderer/category-renderer.js +39 -41
- package/report/renderer/components.d.ts +10 -0
- package/report/renderer/components.js +364 -448
- package/report/renderer/crc-details-renderer.d.ts +73 -0
- package/report/renderer/crc-details-renderer.js +28 -30
- package/report/renderer/details-renderer.d.ts +141 -0
- package/report/renderer/details-renderer.js +44 -92
- package/report/renderer/dom.d.ts +125 -0
- package/report/renderer/dom.js +13 -10
- package/report/renderer/drop-down-menu.d.ts +70 -0
- package/report/renderer/drop-down-menu.js +0 -1
- package/report/renderer/element-screenshot-renderer.d.ts +79 -0
- package/report/renderer/element-screenshot-renderer.js +11 -12
- package/report/renderer/features-util.d.ts +13 -0
- package/report/renderer/features-util.js +0 -1
- package/report/renderer/i18n-formatter.d.ts +100 -0
- package/report/renderer/i18n-formatter.js +263 -0
- package/report/renderer/logger.d.ts +47 -0
- package/report/renderer/logger.js +0 -1
- package/report/renderer/open-tab.d.ts +19 -0
- package/report/renderer/open-tab.js +4 -4
- package/report/renderer/performance-category-renderer.d.ts +56 -0
- package/report/renderer/performance-category-renderer.js +29 -26
- package/report/renderer/pwa-category-renderer.d.ts +55 -0
- package/report/renderer/pwa-category-renderer.js +8 -8
- package/report/renderer/report-globals.d.ts +21 -0
- package/report/renderer/report-globals.js +49 -0
- package/report/renderer/report-renderer.d.ts +57 -0
- package/report/renderer/report-renderer.js +54 -52
- package/report/renderer/report-ui-features.d.ts +71 -0
- package/report/renderer/report-ui-features.js +44 -39
- package/report/renderer/report-utils.d.ts +129 -0
- package/report/renderer/report-utils.js +448 -0
- package/report/renderer/snippet-renderer.d.ts +85 -0
- package/report/renderer/snippet-renderer.js +5 -5
- package/report/renderer/swap-locale-feature.d.ts +31 -0
- package/report/renderer/swap-locale-feature.js +2 -3
- package/report/renderer/text-encoding.d.ts +26 -0
- package/report/renderer/text-encoding.js +0 -1
- package/report/renderer/topbar-features.d.ts +82 -0
- package/report/renderer/topbar-features.js +2 -2
- package/report/test/clients/bundle-test.js +5 -10
- package/report/test/generator/file-namer-test.js +3 -4
- package/report/test/generator/report-generator-test.js +49 -24
- package/report/test/renderer/category-renderer-test.js +19 -15
- package/report/test/renderer/components-test.js +36 -37
- package/report/test/renderer/crc-details-renderer-test.js +11 -10
- package/report/test/renderer/details-renderer-test.js +91 -41
- package/report/test/renderer/dom-test.js +38 -14
- package/report/test/renderer/element-screenshot-renderer-test.js +14 -12
- package/report/test/renderer/i18n-formatter-test.js +179 -0
- package/report/test/renderer/performance-category-renderer-test.js +43 -31
- package/report/test/renderer/pwa-category-renderer-test.js +17 -13
- package/report/test/renderer/report-renderer-axe-test.js +12 -15
- package/report/test/renderer/report-renderer-test.js +17 -15
- package/report/test/renderer/report-ui-features-test.js +304 -89
- package/report/test/renderer/report-utils-test.js +219 -0
- package/report/test/renderer/snippet-renderer-test.js +11 -10
- package/report/test/renderer/text-encoding-test.js +2 -5
- package/report/test-assets/faux-psi.d.ts +34 -0
- package/report/tsconfig.json +1 -2
- package/report/types/augment-dom.d.ts +1 -1
- package/root.d.ts +3 -0
- package/root.js +9 -19
- package/shared/localization/format.d.ts +106 -0
- package/shared/localization/format.js +27 -21
- package/shared/localization/i18n-module.d.ts +4 -0
- package/shared/localization/i18n-module.js +7 -3
- package/shared/localization/locales/ar-XB.json +1658 -1007
- package/shared/localization/locales/ar.json +1659 -1008
- package/shared/localization/locales/bg.json +1657 -1006
- package/shared/localization/locales/ca.json +1664 -1013
- package/shared/localization/locales/cs.json +1659 -1008
- package/shared/localization/locales/da.json +1658 -1007
- package/shared/localization/locales/de.json +1794 -1143
- package/shared/localization/locales/el.json +1657 -1006
- package/shared/localization/locales/en-GB.json +1658 -1007
- package/shared/localization/locales/en-US.json +1471 -1066
- package/shared/localization/locales/en-XA.json +1658 -1007
- package/shared/localization/locales/en-XL.json +1471 -1066
- package/shared/localization/locales/es-419.json +1660 -1009
- package/shared/localization/locales/es.json +1665 -1014
- package/shared/localization/locales/fi.json +1658 -1007
- package/shared/localization/locales/fil.json +1659 -1008
- package/shared/localization/locales/fr.json +1660 -1009
- package/shared/localization/locales/he.json +1678 -1027
- package/shared/localization/locales/hi.json +1661 -1010
- package/shared/localization/locales/hr.json +1658 -1007
- package/shared/localization/locales/hu.json +1657 -1006
- package/shared/localization/locales/id.json +1658 -1007
- package/shared/localization/locales/it.json +1678 -1027
- package/shared/localization/locales/ja.json +1657 -1006
- package/shared/localization/locales/ko.json +1658 -1007
- package/shared/localization/locales/lt.json +1658 -1007
- package/shared/localization/locales/lv.json +1658 -1007
- package/shared/localization/locales/nl.json +1659 -1008
- package/shared/localization/locales/no.json +1662 -1011
- package/shared/localization/locales/pl.json +1657 -1006
- package/shared/localization/locales/pt-PT.json +1678 -1027
- package/shared/localization/locales/pt.json +1659 -1008
- package/shared/localization/locales/ro.json +1657 -1006
- package/shared/localization/locales/ru.json +1657 -1006
- package/shared/localization/locales/sk.json +1657 -1006
- package/shared/localization/locales/sl.json +1657 -1006
- package/shared/localization/locales/sr-Latn.json +1658 -1007
- package/shared/localization/locales/sr.json +1658 -1007
- package/shared/localization/locales/sv.json +1664 -1013
- package/shared/localization/locales/ta.json +1658 -1007
- package/shared/localization/locales/te.json +1688 -1037
- package/shared/localization/locales/th.json +1666 -1015
- package/shared/localization/locales/tr.json +1658 -1007
- package/shared/localization/locales/uk.json +1657 -1006
- package/shared/localization/locales/vi.json +1659 -1008
- package/shared/localization/locales/zh-HK.json +1658 -1007
- package/shared/localization/locales/zh-TW.json +1661 -1010
- package/shared/localization/locales/zh.json +1658 -1007
- package/shared/localization/locales.d.ts +7 -0
- package/shared/localization/locales.js +54 -51
- package/shared/localization/swap-flow-locale.d.ts +6 -0
- package/shared/localization/swap-flow-locale.js +6 -3
- package/shared/localization/swap-locale.d.ts +39 -0
- package/shared/localization/swap-locale.js +7 -8
- package/shared/test/localization/format-test.js +73 -56
- package/shared/test/localization/locales-test.js +2 -4
- package/shared/test/localization/swap-locale-test.js +10 -11
- package/shared/test/util-test.js +214 -0
- package/shared/tsconfig.json +1 -2
- package/shared/type-verifiers.d.ts +23 -0
- package/shared/type-verifiers.js +1 -2
- package/shared/types/shared.d.ts +2 -2
- package/shared/util.d.ts +122 -0
- package/shared/util.js +332 -0
- package/third-party/axe/valid-langs.d.ts +9 -0
- package/third-party/axe/valid-langs.js +1 -1
- package/third-party/chromium-synchronization/inspector-issueAdded-types-test.js +5 -7
- package/third-party/chromium-synchronization/installability-errors-test.js +4 -8
- package/third-party/download-content-shell/README.md +1 -0
- package/third-party/download-content-shell/download-content-shell.js +12 -6
- package/third-party/download-content-shell/utils.js +8 -8
- package/tsconfig-base.json +6 -1
- package/tsconfig.json +84 -90
- package/types/artifacts.d.ts +135 -78
- package/types/audit.d.ts +9 -8
- package/types/config.d.ts +26 -38
- package/types/externs.d.ts +9 -101
- package/types/gatherer.d.ts +35 -27
- package/types/internal/cssstyle.d.ts +23 -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/internal/lighthouse-logger.d.ts +34 -0
- package/types/internal/lookup-closest-locale.d.ts +13 -0
- 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/internal/node.d.ts +44 -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/internal/query-selector.d.ts +36 -0
- package/types/{rollup-plugin-postprocess.d.ts → internal/rollup-plugin-postprocess.d.ts} +0 -0
- package/types/internal/smokehouse.d.ts +83 -0
- package/types/internal/test.d.ts +53 -0
- package/types/lh.d.ts +81 -0
- package/types/lh.js +13 -0
- package/types/lhr/audit-details.d.ts +6 -53
- package/types/lhr/audit-result.d.ts +2 -2
- package/types/lhr/flow-result.d.ts +28 -0
- package/types/lhr/lhr.d.ts +53 -6
- package/types/lhr/settings.d.ts +18 -1
- package/types/lhr/treemap.d.ts +5 -4
- package/types/lhr/tsconfig.json +0 -2
- package/types/protocol.d.ts +32 -18
- package/types/puppeteer.d.ts +27 -0
- package/types/user-flow.d.ts +27 -6
- package/types/utility-types.d.ts +72 -0
- package/vercel.json +6 -0
- package/eslint-local-rules.js +0 -106
- package/flow-report/.eslintrc.cjs +0 -51
- package/flow-report/jest.config.js +0 -24
- package/flow-report/package.json +0 -4
- package/flow-report/test/setup/global-setup.ts +0 -11
- package/jest.config.js +0 -30
- package/lighthouse-cli/.eslintrc.cjs +0 -29
- package/lighthouse-cli/bin.js +0 -152
- package/lighthouse-cli/cli-flags.js +0 -530
- package/lighthouse-cli/commands/commands.js +0 -10
- package/lighthouse-cli/commands/list-audits.js +0 -16
- package/lighthouse-cli/commands/list-locales.js +0 -16
- package/lighthouse-cli/commands/list-trace-categories.js +0 -16
- package/lighthouse-cli/index.js +0 -14
- package/lighthouse-cli/package.json +0 -4
- package/lighthouse-cli/printer.js +0 -100
- package/lighthouse-cli/run.js +0 -286
- package/lighthouse-cli/sentry-prompt.js +0 -79
- package/lighthouse-cli/test/smokehouse/core-tests.js +0 -129
- package/lighthouse-cli/test/smokehouse/frontends/back-compat-util.js +0 -42
- package/lighthouse-cli/test/smokehouse/frontends/lib.js +0 -49
- package/lighthouse-cli/test/smokehouse/frontends/node.js +0 -13
- package/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js +0 -262
- package/lighthouse-cli/test/smokehouse/lib/child-process-error.js +0 -26
- package/lighthouse-cli/test/smokehouse/lib/concurrent-mapper.js +0 -126
- package/lighthouse-cli/test/smokehouse/lib/local-console.js +0 -51
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/bundle.js +0 -68
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/cli.js +0 -151
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/devtools.js +0 -106
- package/lighthouse-cli/test/smokehouse/readme.md +0 -204
- package/lighthouse-cli/test/smokehouse/report-assert.js +0 -493
- package/lighthouse-cli/test/smokehouse/smokehouse.js +0 -284
- package/lighthouse-cli/test/smokehouse/version-check-test.js +0 -46
- package/lighthouse-cli/test/smokehouse/version-check.js +0 -49
- package/lighthouse-core/audits/accessibility/accesskeys.js +0 -45
- package/lighthouse-core/audits/accessibility/aria-allowed-attr.js +0 -45
- package/lighthouse-core/audits/accessibility/aria-command-name.js +0 -43
- package/lighthouse-core/audits/accessibility/aria-hidden-body.js +0 -43
- package/lighthouse-core/audits/accessibility/aria-hidden-focus.js +0 -43
- package/lighthouse-core/audits/accessibility/aria-input-field-name.js +0 -43
- package/lighthouse-core/audits/accessibility/aria-meter-name.js +0 -43
- package/lighthouse-core/audits/accessibility/aria-progressbar-name.js +0 -43
- package/lighthouse-core/audits/accessibility/aria-required-attr.js +0 -44
- package/lighthouse-core/audits/accessibility/aria-required-children.js +0 -48
- package/lighthouse-core/audits/accessibility/aria-required-parent.js +0 -46
- package/lighthouse-core/audits/accessibility/aria-roles.js +0 -45
- package/lighthouse-core/audits/accessibility/aria-toggle-field-name.js +0 -43
- package/lighthouse-core/audits/accessibility/aria-tooltip-name.js +0 -43
- package/lighthouse-core/audits/accessibility/aria-treeitem-name.js +0 -43
- package/lighthouse-core/audits/accessibility/aria-valid-attr-value.js +0 -45
- package/lighthouse-core/audits/accessibility/aria-valid-attr.js +0 -45
- package/lighthouse-core/audits/accessibility/axe-audit.js +0 -114
- package/lighthouse-core/audits/accessibility/button-name.js +0 -45
- package/lighthouse-core/audits/accessibility/bypass.js +0 -46
- package/lighthouse-core/audits/accessibility/color-contrast.js +0 -46
- package/lighthouse-core/audits/accessibility/definition-list.js +0 -47
- package/lighthouse-core/audits/accessibility/dlitem.js +0 -45
- package/lighthouse-core/audits/accessibility/document-title.js +0 -45
- package/lighthouse-core/audits/accessibility/duplicate-id-active.js +0 -43
- package/lighthouse-core/audits/accessibility/duplicate-id-aria.js +0 -43
- package/lighthouse-core/audits/accessibility/form-field-multiple-labels.js +0 -44
- package/lighthouse-core/audits/accessibility/frame-title.js +0 -44
- package/lighthouse-core/audits/accessibility/heading-order.js +0 -43
- package/lighthouse-core/audits/accessibility/html-has-lang.js +0 -47
- package/lighthouse-core/audits/accessibility/html-lang-valid.js +0 -46
- package/lighthouse-core/audits/accessibility/image-alt.js +0 -45
- package/lighthouse-core/audits/accessibility/input-image-alt.js +0 -45
- package/lighthouse-core/audits/accessibility/label.js +0 -45
- package/lighthouse-core/audits/accessibility/link-name.js +0 -46
- package/lighthouse-core/audits/accessibility/list.js +0 -47
- package/lighthouse-core/audits/accessibility/listitem.js +0 -46
- package/lighthouse-core/audits/accessibility/manual/custom-controls-labels.js +0 -28
- package/lighthouse-core/audits/accessibility/manual/custom-controls-roles.js +0 -28
- package/lighthouse-core/audits/accessibility/manual/focus-traps.js +0 -28
- package/lighthouse-core/audits/accessibility/manual/focusable-controls.js +0 -28
- package/lighthouse-core/audits/accessibility/manual/interactive-element-affordance.js +0 -28
- package/lighthouse-core/audits/accessibility/manual/logical-tab-order.js +0 -28
- package/lighthouse-core/audits/accessibility/manual/managed-focus.js +0 -28
- package/lighthouse-core/audits/accessibility/manual/offscreen-content-hidden.js +0 -29
- package/lighthouse-core/audits/accessibility/manual/use-landmarks.js +0 -28
- package/lighthouse-core/audits/accessibility/manual/visual-order-follows-dom.js +0 -28
- package/lighthouse-core/audits/accessibility/meta-refresh.js +0 -46
- package/lighthouse-core/audits/accessibility/meta-viewport.js +0 -47
- package/lighthouse-core/audits/accessibility/object-alt.js +0 -45
- package/lighthouse-core/audits/accessibility/tabindex.js +0 -45
- package/lighthouse-core/audits/accessibility/td-headers-attr.js +0 -49
- package/lighthouse-core/audits/accessibility/th-has-data-cells.js +0 -48
- package/lighthouse-core/audits/accessibility/valid-lang.js +0 -45
- package/lighthouse-core/audits/accessibility/video-caption.js +0 -46
- package/lighthouse-core/audits/apple-touch-icon.js +0 -72
- package/lighthouse-core/audits/audit.js +0 -391
- package/lighthouse-core/audits/autocomplete.js +0 -290
- package/lighthouse-core/audits/bootup-time.js +0 -152
- package/lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js +0 -258
- package/lighthouse-core/audits/byte-efficiency/duplicated-javascript.js +0 -249
- package/lighthouse-core/audits/byte-efficiency/efficient-animated-content.js +0 -92
- package/lighthouse-core/audits/byte-efficiency/legacy-javascript.js +0 -472
- package/lighthouse-core/audits/byte-efficiency/modern-image-formats.js +0 -186
- package/lighthouse-core/audits/byte-efficiency/offscreen-images.js +0 -252
- package/lighthouse-core/audits/byte-efficiency/render-blocking-resources.js +0 -309
- package/lighthouse-core/audits/byte-efficiency/total-byte-weight.js +0 -111
- package/lighthouse-core/audits/byte-efficiency/unminified-css.js +0 -117
- package/lighthouse-core/audits/byte-efficiency/unminified-javascript.js +0 -120
- package/lighthouse-core/audits/byte-efficiency/unused-css-rules.js +0 -71
- package/lighthouse-core/audits/byte-efficiency/unused-javascript.js +0 -161
- package/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js +0 -298
- package/lighthouse-core/audits/byte-efficiency/uses-optimized-images.js +0 -145
- package/lighthouse-core/audits/byte-efficiency/uses-responsive-images-snapshot.js +0 -100
- package/lighthouse-core/audits/byte-efficiency/uses-responsive-images.js +0 -177
- package/lighthouse-core/audits/byte-efficiency/uses-text-compression.js +0 -100
- package/lighthouse-core/audits/content-width.js +0 -77
- package/lighthouse-core/audits/critical-request-chains.js +0 -220
- package/lighthouse-core/audits/csp-xss.js +0 -186
- package/lighthouse-core/audits/deprecations.js +0 -115
- package/lighthouse-core/audits/diagnostics.js +0 -79
- package/lighthouse-core/audits/dobetterweb/charset.js +0 -96
- package/lighthouse-core/audits/dobetterweb/doctype.js +0 -94
- package/lighthouse-core/audits/dobetterweb/dom-size.js +0 -123
- package/lighthouse-core/audits/dobetterweb/geolocation-on-start.js +0 -70
- package/lighthouse-core/audits/dobetterweb/inspector-issues.js +0 -192
- package/lighthouse-core/audits/dobetterweb/js-libraries.js +0 -88
- package/lighthouse-core/audits/dobetterweb/no-document-write.js +0 -85
- package/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js +0 -225
- package/lighthouse-core/audits/dobetterweb/notification-on-start.js +0 -69
- package/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +0 -66
- package/lighthouse-core/audits/dobetterweb/uses-http2.js +0 -258
- package/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js +0 -68
- package/lighthouse-core/audits/errors-in-console.js +0 -118
- package/lighthouse-core/audits/final-screenshot.js +0 -59
- package/lighthouse-core/audits/font-display.js +0 -193
- package/lighthouse-core/audits/full-page-screenshot.js +0 -43
- package/lighthouse-core/audits/image-aspect-ratio.js +0 -122
- package/lighthouse-core/audits/image-size-responsive.js +0 -331
- package/lighthouse-core/audits/installable-manifest.js +0 -266
- package/lighthouse-core/audits/is-on-https.js +0 -125
- package/lighthouse-core/audits/largest-contentful-paint-element.js +0 -70
- package/lighthouse-core/audits/layout-shift-elements.js +0 -75
- package/lighthouse-core/audits/lcp-lazy-loaded.js +0 -85
- package/lighthouse-core/audits/long-tasks.js +0 -124
- package/lighthouse-core/audits/main-thread-tasks.js +0 -59
- package/lighthouse-core/audits/mainthread-work-breakdown.js +0 -134
- package/lighthouse-core/audits/manual/manual-audit.js +0 -37
- package/lighthouse-core/audits/manual/pwa-cross-browser.js +0 -41
- package/lighthouse-core/audits/manual/pwa-each-page-has-url.js +0 -39
- package/lighthouse-core/audits/manual/pwa-page-transitions.js +0 -39
- package/lighthouse-core/audits/maskable-icon.js +0 -71
- package/lighthouse-core/audits/metrics/cumulative-layout-shift.js +0 -79
- package/lighthouse-core/audits/metrics/experimental-interaction-to-next-paint.js +0 -88
- package/lighthouse-core/audits/metrics/first-contentful-paint-3g.js +0 -67
- package/lighthouse-core/audits/metrics/first-contentful-paint.js +0 -85
- package/lighthouse-core/audits/metrics/first-meaningful-paint.js +0 -89
- package/lighthouse-core/audits/metrics/interactive.js +0 -93
- package/lighthouse-core/audits/metrics/largest-contentful-paint.js +0 -114
- package/lighthouse-core/audits/metrics/max-potential-fid.js +0 -76
- package/lighthouse-core/audits/metrics/speed-index.js +0 -88
- package/lighthouse-core/audits/metrics/total-blocking-time.js +0 -117
- package/lighthouse-core/audits/metrics.js +0 -73
- package/lighthouse-core/audits/multi-check-audit.js +0 -83
- package/lighthouse-core/audits/network-requests.js +0 -130
- package/lighthouse-core/audits/network-rtt.js +0 -90
- package/lighthouse-core/audits/network-server-latency.js +0 -89
- package/lighthouse-core/audits/no-unload-listeners.js +0 -95
- package/lighthouse-core/audits/non-composited-animations.js +0 -206
- package/lighthouse-core/audits/oopif-iframe-test-audit.js +0 -30
- package/lighthouse-core/audits/performance-budget.js +0 -154
- package/lighthouse-core/audits/predictive-perf.js +0 -101
- package/lighthouse-core/audits/preload-fonts.js +0 -107
- package/lighthouse-core/audits/preload-lcp-image.js +0 -272
- package/lighthouse-core/audits/redirects.js +0 -163
- package/lighthouse-core/audits/resource-summary.js +0 -104
- package/lighthouse-core/audits/screenshot-thumbnails.js +0 -163
- package/lighthouse-core/audits/script-treemap-data.js +0 -288
- package/lighthouse-core/audits/seo/canonical.js +0 -218
- package/lighthouse-core/audits/seo/crawlable-anchors.js +0 -94
- package/lighthouse-core/audits/seo/font-size.js +0 -344
- package/lighthouse-core/audits/seo/hreflang.js +0 -149
- package/lighthouse-core/audits/seo/http-status-code.js +0 -70
- package/lighthouse-core/audits/seo/is-crawlable.js +0 -155
- package/lighthouse-core/audits/seo/link-text.js +0 -158
- package/lighthouse-core/audits/seo/manual/structured-data.js +0 -38
- package/lighthouse-core/audits/seo/meta-description.js +0 -67
- package/lighthouse-core/audits/seo/plugins.js +0 -152
- package/lighthouse-core/audits/seo/robots-txt.js +0 -256
- package/lighthouse-core/audits/seo/tap-targets.js +0 -352
- package/lighthouse-core/audits/server-response-time.js +0 -106
- package/lighthouse-core/audits/service-worker.js +0 -179
- package/lighthouse-core/audits/splash-screen.js +0 -99
- package/lighthouse-core/audits/themed-omnibox.js +0 -110
- package/lighthouse-core/audits/third-party-facades.js +0 -221
- package/lighthouse-core/audits/third-party-summary.js +0 -259
- package/lighthouse-core/audits/timing-budget.js +0 -174
- package/lighthouse-core/audits/unsized-images.js +0 -163
- package/lighthouse-core/audits/user-timings.js +0 -120
- package/lighthouse-core/audits/uses-rel-preconnect.js +0 -254
- package/lighthouse-core/audits/uses-rel-preload.js +0 -267
- package/lighthouse-core/audits/valid-source-maps.js +0 -157
- package/lighthouse-core/audits/viewport.js +0 -65
- package/lighthouse-core/audits/violation-audit.js +0 -50
- package/lighthouse-core/audits/work-during-interaction.js +0 -280
- package/lighthouse-core/computed/computed-artifact.js +0 -62
- package/lighthouse-core/computed/critical-request-chains.js +0 -146
- package/lighthouse-core/computed/image-records.js +0 -63
- package/lighthouse-core/computed/js-bundles.js +0 -119
- package/lighthouse-core/computed/load-simulator.js +0 -92
- package/lighthouse-core/computed/main-resource.js +0 -34
- package/lighthouse-core/computed/main-thread-tasks.js +0 -25
- package/lighthouse-core/computed/manifest-values.js +0 -135
- package/lighthouse-core/computed/metrics/cumulative-layout-shift.js +0 -129
- package/lighthouse-core/computed/metrics/first-contentful-paint-all-frames.js +0 -37
- package/lighthouse-core/computed/metrics/first-contentful-paint.js +0 -40
- package/lighthouse-core/computed/metrics/first-meaningful-paint.js +0 -44
- package/lighthouse-core/computed/metrics/interactive.js +0 -193
- package/lighthouse-core/computed/metrics/lantern-first-contentful-paint.js +0 -204
- package/lighthouse-core/computed/metrics/lantern-first-meaningful-paint.js +0 -83
- package/lighthouse-core/computed/metrics/lantern-interactive.js +0 -113
- package/lighthouse-core/computed/metrics/lantern-largest-contentful-paint.js +0 -111
- package/lighthouse-core/computed/metrics/lantern-max-potential-fid.js +0 -93
- package/lighthouse-core/computed/metrics/lantern-metric.js +0 -167
- package/lighthouse-core/computed/metrics/lantern-speed-index.js +0 -150
- package/lighthouse-core/computed/metrics/lantern-total-blocking-time.js +0 -126
- package/lighthouse-core/computed/metrics/largest-contentful-paint-all-frames.js +0 -45
- package/lighthouse-core/computed/metrics/largest-contentful-paint.js +0 -52
- package/lighthouse-core/computed/metrics/max-potential-fid.js +0 -45
- package/lighthouse-core/computed/metrics/metric.js +0 -100
- package/lighthouse-core/computed/metrics/navigation-metric.js +0 -46
- package/lighthouse-core/computed/metrics/responsiveness.js +0 -157
- package/lighthouse-core/computed/metrics/speed-index.js +0 -40
- package/lighthouse-core/computed/metrics/tbt-utils.js +0 -57
- package/lighthouse-core/computed/metrics/timing-summary.js +0 -150
- package/lighthouse-core/computed/metrics/total-blocking-time.js +0 -74
- package/lighthouse-core/computed/module-duplication.js +0 -136
- package/lighthouse-core/computed/network-analysis.js +0 -64
- package/lighthouse-core/computed/network-records.js +0 -21
- package/lighthouse-core/computed/page-dependency-graph.js +0 -488
- package/lighthouse-core/computed/processed-navigation.js +0 -21
- package/lighthouse-core/computed/processed-trace.js +0 -21
- package/lighthouse-core/computed/resource-summary.js +0 -114
- package/lighthouse-core/computed/screenshots.js +0 -29
- package/lighthouse-core/computed/speedline.js +0 -54
- package/lighthouse-core/computed/trace-of-tab.js +0 -30
- package/lighthouse-core/computed/unused-css.js +0 -154
- package/lighthouse-core/computed/unused-javascript-summary.js +0 -175
- package/lighthouse-core/computed/user-timings.js +0 -83
- package/lighthouse-core/computed/viewport-meta.js +0 -56
- package/lighthouse-core/config/budget.js +0 -341
- package/lighthouse-core/config/config-helpers.js +0 -590
- package/lighthouse-core/config/config-plugin.js +0 -225
- package/lighthouse-core/config/config.js +0 -544
- package/lighthouse-core/config/constants.js +0 -169
- package/lighthouse-core/config/default-config.js +0 -632
- package/lighthouse-core/config/desktop-config.js +0 -21
- package/lighthouse-core/config/experimental-config.js +0 -30
- package/lighthouse-core/config/full-config.js +0 -14
- package/lighthouse-core/config/lr-desktop-config.js +0 -25
- package/lighthouse-core/config/lr-mobile-config.js +0 -31
- package/lighthouse-core/config/metrics-to-audits.js +0 -61
- package/lighthouse-core/config/perf-config.js +0 -17
- package/lighthouse-core/fraggle-rock/api.js +0 -77
- package/lighthouse-core/fraggle-rock/config/config.js +0 -281
- package/lighthouse-core/fraggle-rock/config/default-config.js +0 -205
- package/lighthouse-core/fraggle-rock/config/filters.js +0 -335
- package/lighthouse-core/fraggle-rock/config/validation.js +0 -313
- package/lighthouse-core/fraggle-rock/gather/base-artifacts.js +0 -99
- package/lighthouse-core/fraggle-rock/gather/base-gatherer.js +0 -107
- package/lighthouse-core/fraggle-rock/gather/driver.js +0 -88
- package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +0 -339
- package/lighthouse-core/fraggle-rock/gather/runner-helpers.js +0 -160
- package/lighthouse-core/fraggle-rock/gather/session.js +0 -182
- package/lighthouse-core/fraggle-rock/gather/snapshot-runner.js +0 -68
- package/lighthouse-core/fraggle-rock/gather/timespan-runner.js +0 -82
- package/lighthouse-core/fraggle-rock/user-flow.js +0 -229
- package/lighthouse-core/gather/connections/connection.js +0 -179
- package/lighthouse-core/gather/connections/cri.js +0 -171
- package/lighthouse-core/gather/connections/raw.js +0 -58
- package/lighthouse-core/gather/devtools-log.js +0 -61
- package/lighthouse-core/gather/driver/dom.js +0 -58
- package/lighthouse-core/gather/driver/environment.js +0 -105
- package/lighthouse-core/gather/driver/execution-context.js +0 -249
- package/lighthouse-core/gather/driver/navigation.js +0 -179
- package/lighthouse-core/gather/driver/network-monitor.js +0 -290
- package/lighthouse-core/gather/driver/network.js +0 -28
- package/lighthouse-core/gather/driver/prepare.js +0 -226
- package/lighthouse-core/gather/driver/service-workers.js +0 -53
- package/lighthouse-core/gather/driver/storage.js +0 -125
- package/lighthouse-core/gather/driver/target-manager.js +0 -125
- package/lighthouse-core/gather/driver/wait-for-condition.js +0 -535
- package/lighthouse-core/gather/driver.js +0 -482
- package/lighthouse-core/gather/fetcher.js +0 -318
- package/lighthouse-core/gather/gather-runner.js +0 -622
- package/lighthouse-core/gather/gatherers/accessibility.js +0 -172
- package/lighthouse-core/gather/gatherers/anchor-elements.js +0 -133
- package/lighthouse-core/gather/gatherers/cache-contents.js +0 -59
- package/lighthouse-core/gather/gatherers/console-messages.js +0 -173
- package/lighthouse-core/gather/gatherers/css-usage.js +0 -149
- package/lighthouse-core/gather/gatherers/devtools-log-compat.js +0 -36
- package/lighthouse-core/gather/gatherers/devtools-log.js +0 -66
- package/lighthouse-core/gather/gatherers/dobetterweb/doctype.js +0 -46
- package/lighthouse-core/gather/gatherers/dobetterweb/domstats.js +0 -103
- package/lighthouse-core/gather/gatherers/dobetterweb/optimized-images.js +0 -192
- package/lighthouse-core/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.js +0 -50
- package/lighthouse-core/gather/gatherers/dobetterweb/response-compression.js +0 -154
- package/lighthouse-core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +0 -238
- package/lighthouse-core/gather/gatherers/full-page-screenshot.js +0 -235
- package/lighthouse-core/gather/gatherers/gatherer.js +0 -59
- package/lighthouse-core/gather/gatherers/global-listeners.js +0 -92
- package/lighthouse-core/gather/gatherers/iframe-elements.js +0 -65
- package/lighthouse-core/gather/gatherers/image-elements.js +0 -375
- package/lighthouse-core/gather/gatherers/inputs.js +0 -113
- package/lighthouse-core/gather/gatherers/inspector-issues.js +0 -127
- package/lighthouse-core/gather/gatherers/installability-errors.js +0 -48
- package/lighthouse-core/gather/gatherers/js-usage.js +0 -145
- package/lighthouse-core/gather/gatherers/link-elements.js +0 -184
- package/lighthouse-core/gather/gatherers/main-document-content.js +0 -56
- package/lighthouse-core/gather/gatherers/meta-elements.js +0 -68
- package/lighthouse-core/gather/gatherers/network-user-agent.js +0 -42
- package/lighthouse-core/gather/gatherers/script-elements.js +0 -160
- package/lighthouse-core/gather/gatherers/seo/embedded-content.js +0 -64
- package/lighthouse-core/gather/gatherers/seo/font-size.js +0 -380
- package/lighthouse-core/gather/gatherers/seo/robots-txt.js +0 -56
- package/lighthouse-core/gather/gatherers/seo/tap-targets.js +0 -370
- package/lighthouse-core/gather/gatherers/service-worker.js +0 -45
- package/lighthouse-core/gather/gatherers/source-maps.js +0 -150
- package/lighthouse-core/gather/gatherers/stacks.js +0 -125
- package/lighthouse-core/gather/gatherers/trace-compat.js +0 -36
- package/lighthouse-core/gather/gatherers/trace-elements.js +0 -349
- package/lighthouse-core/gather/gatherers/trace.js +0 -131
- package/lighthouse-core/gather/gatherers/viewport-dimensions.js +0 -58
- package/lighthouse-core/gather/gatherers/web-app-manifest.js +0 -102
- package/lighthouse-core/index.js +0 -80
- package/lighthouse-core/lib/arbitrary-equality-map.js +0 -81
- package/lighthouse-core/lib/asset-saver.js +0 -341
- package/lighthouse-core/lib/axe.js +0 -13
- package/lighthouse-core/lib/cdt/Platform.js +0 -55
- package/lighthouse-core/lib/cdt/SDK.js +0 -28
- package/lighthouse-core/lib/cdt/generated/SourceMap.js +0 -346
- package/lighthouse-core/lib/csp-evaluator.js +0 -173
- package/lighthouse-core/lib/dependency-graph/base-node.js +0 -363
- package/lighthouse-core/lib/dependency-graph/cpu-node.js +0 -86
- package/lighthouse-core/lib/dependency-graph/network-node.js +0 -99
- package/lighthouse-core/lib/dependency-graph/simulator/connection-pool.js +0 -171
- package/lighthouse-core/lib/dependency-graph/simulator/dns-cache.js +0 -73
- package/lighthouse-core/lib/dependency-graph/simulator/network-analyzer.js +0 -498
- package/lighthouse-core/lib/dependency-graph/simulator/simulator-timing-map.js +0 -212
- package/lighthouse-core/lib/dependency-graph/simulator/simulator.js +0 -523
- package/lighthouse-core/lib/dependency-graph/simulator/tcp-connection.js +0 -206
- package/lighthouse-core/lib/deprecations-strings.js +0 -573
- package/lighthouse-core/lib/emulation.js +0 -164
- package/lighthouse-core/lib/i18n/README.md +0 -273
- package/lighthouse-core/lib/i18n/i18n.js +0 -221
- package/lighthouse-core/lib/icons.js +0 -85
- package/lighthouse-core/lib/lantern-trace-saver.js +0 -198
- package/lighthouse-core/lib/lh-env.js +0 -14
- package/lighthouse-core/lib/lh-error.js +0 -421
- package/lighthouse-core/lib/lh-trace-processor.js +0 -46
- package/lighthouse-core/lib/manifest-parser.js +0 -513
- package/lighthouse-core/lib/median-run.js +0 -92
- package/lighthouse-core/lib/minification-estimator.js +0 -193
- package/lighthouse-core/lib/minify-devtoolslog.js +0 -87
- package/lighthouse-core/lib/minify-trace.js +0 -173
- package/lighthouse-core/lib/navigation-error.js +0 -145
- package/lighthouse-core/lib/network-recorder.js +0 -337
- package/lighthouse-core/lib/network-request.js +0 -545
- package/lighthouse-core/lib/page-functions.js +0 -559
- package/lighthouse-core/lib/proto-preprocessor.js +0 -133
- package/lighthouse-core/lib/rect-helpers.js +0 -252
- package/lighthouse-core/lib/script-helpers.js +0 -24
- package/lighthouse-core/lib/sentry.js +0 -144
- package/lighthouse-core/lib/stack-packs.js +0 -120
- package/lighthouse-core/lib/statistics.js +0 -104
- package/lighthouse-core/lib/tappable-rects.js +0 -99
- package/lighthouse-core/lib/third-party-web.js +0 -53
- package/lighthouse-core/lib/timing-trace-saver.js +0 -97
- package/lighthouse-core/lib/tracehouse/cpu-profile-model.js +0 -592
- package/lighthouse-core/lib/tracehouse/main-thread-tasks.js +0 -688
- package/lighthouse-core/lib/tracehouse/task-groups.js +0 -112
- package/lighthouse-core/lib/tracehouse/task-summary.js +0 -87
- package/lighthouse-core/lib/tracehouse/trace-processor.js +0 -962
- package/lighthouse-core/lib/traces/pwmetrics-events.js +0 -200
- package/lighthouse-core/lib/url-shim.js +0 -274
- package/lighthouse-core/runner.js +0 -518
- package/lighthouse-core/scoring.js +0 -93
- package/lighthouse-core/scripts/download-chrome.sh +0 -36
- package/lighthouse-core/scripts/manual-chrome-launcher.js +0 -51
- package/lighthouse-core/scripts/package.json +0 -4
- package/lighthouse-core/util-commonjs.js +0 -708
- package/now.json +0 -14
- package/report/.eslintrc.cjs +0 -35
- package/report/generator/package.json +0 -4
- package/report/package.json +0 -4
- package/report/renderer/i18n.js +0 -198
- package/report/renderer/util.js +0 -705
- package/report/test/generator/package.json +0 -4
- package/report/test/renderer/i18n-test.js +0 -140
- package/report/test/renderer/util-test.js +0 -479
- package/report/test-assets/faux-psi-template.html +0 -177
- package/report/test-assets/faux-psi.js +0 -153
- package/third-party/snyk/snapshot.json +0 -182
- package/types/cssstyle/index.d.ts +0 -23
- package/types/global-lh.d.ts +0 -81
- package/types/jest.d.ts +0 -25
- package/types/jsonld/index.d.ts +0 -19
- package/types/lhr/flow.d.ts +0 -32
- package/types/lighthouse-logger/index.d.ts +0 -33
- package/types/lookup-closest-locale/index.d.ts +0 -11
- package/types/node.d.ts +0 -12
- package/types/query-selector.d.ts +0 -36
- package/types/smokehouse.d.ts +0 -80
- package/types/structured-data.d.ts +0 -36
|
@@ -1,545 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright 2018 The Lighthouse Authors. All Rights Reserved.
|
|
3
|
-
* 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
|
|
4
|
-
* 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.
|
|
5
|
-
*/
|
|
6
|
-
'use strict';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @fileoverview Fills most of the role of NetworkManager and NetworkRequest classes from DevTools.
|
|
10
|
-
* @see https://cs.chromium.org/chromium/src/third_party/blink/renderer/devtools/front_end/sdk/NetworkRequest.js
|
|
11
|
-
* @see https://cs.chromium.org/chromium/src/third_party/blink/renderer/devtools/front_end/sdk/NetworkManager.js
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
const URL = require('./url-shim.js');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// Lightrider X-Header names for timing information.
|
|
18
|
-
// See: _updateTransferSizeForLightrider and _updateTimingsForLightrider.
|
|
19
|
-
const HEADER_TCP = 'X-TCPMs';
|
|
20
|
-
const HEADER_SSL = 'X-SSLMs';
|
|
21
|
-
const HEADER_REQ = 'X-RequestMs';
|
|
22
|
-
const HEADER_RES = 'X-ResponseMs';
|
|
23
|
-
const HEADER_TOTAL = 'X-TotalMs';
|
|
24
|
-
const HEADER_FETCHED_SIZE = 'X-TotalFetchedSize';
|
|
25
|
-
const HEADER_PROTOCOL_IS_H2 = 'X-ProtocolIsH2';
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @typedef HeaderEntry
|
|
29
|
-
* @property {string} name
|
|
30
|
-
* @property {string} value
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @typedef ParsedURL
|
|
35
|
-
* @property {string} scheme Equivalent to a `new URL(url).protocol` BUT w/o the trailing colon (:)
|
|
36
|
-
* @property {string} host Equivalent to a `new URL(url).hostname`
|
|
37
|
-
* @property {string} securityOrigin
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @typedef LightriderStatistics
|
|
42
|
-
* The difference in endTime between the observed Lighthouse endTime and Lightrider's derived endTime.
|
|
43
|
-
* @property {number} endTimeDeltaMs
|
|
44
|
-
* The time spent making a TCP connection (connect + SSL).
|
|
45
|
-
* @property {number} TCPMs
|
|
46
|
-
* The time spent requesting a resource from a remote server, we use this to approx RTT.
|
|
47
|
-
* @property {number} requestMs
|
|
48
|
-
* The time spent transferring a resource from a remote server.
|
|
49
|
-
* @property {number} responseMs
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
/** @type {SelfMap<LH.Crdp.Network.ResourceType>} */
|
|
53
|
-
const RESOURCE_TYPES = {
|
|
54
|
-
XHR: 'XHR',
|
|
55
|
-
Fetch: 'Fetch',
|
|
56
|
-
EventSource: 'EventSource',
|
|
57
|
-
Script: 'Script',
|
|
58
|
-
Stylesheet: 'Stylesheet',
|
|
59
|
-
Image: 'Image',
|
|
60
|
-
Media: 'Media',
|
|
61
|
-
Font: 'Font',
|
|
62
|
-
Document: 'Document',
|
|
63
|
-
TextTrack: 'TextTrack',
|
|
64
|
-
WebSocket: 'WebSocket',
|
|
65
|
-
Other: 'Other',
|
|
66
|
-
Manifest: 'Manifest',
|
|
67
|
-
SignedExchange: 'SignedExchange',
|
|
68
|
-
Ping: 'Ping',
|
|
69
|
-
Preflight: 'Preflight',
|
|
70
|
-
CSPViolationReport: 'CSPViolationReport',
|
|
71
|
-
Prefetch: 'Prefetch',
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
class NetworkRequest {
|
|
75
|
-
constructor() {
|
|
76
|
-
this.requestId = '';
|
|
77
|
-
this.connectionId = '0';
|
|
78
|
-
this.connectionReused = false;
|
|
79
|
-
|
|
80
|
-
this.url = '';
|
|
81
|
-
this.protocol = '';
|
|
82
|
-
this.isSecure = false;
|
|
83
|
-
this.isValid = false;
|
|
84
|
-
this.parsedURL = /** @type {ParsedURL} */ ({scheme: ''});
|
|
85
|
-
this.documentURL = '';
|
|
86
|
-
|
|
87
|
-
/** When the renderer process initially discovers a network request. */
|
|
88
|
-
this.rendererStartTime = -1;
|
|
89
|
-
|
|
90
|
-
this.startTime = -1;
|
|
91
|
-
/** @type {number} */
|
|
92
|
-
this.endTime = -1;
|
|
93
|
-
/** @type {number} */
|
|
94
|
-
this.responseReceivedTime = -1;
|
|
95
|
-
|
|
96
|
-
// Go read the comment on _updateTransferSizeForLightrider.
|
|
97
|
-
this.transferSize = 0;
|
|
98
|
-
this.resourceSize = 0;
|
|
99
|
-
this.fromDiskCache = false;
|
|
100
|
-
this.fromMemoryCache = false;
|
|
101
|
-
this.fromPrefetchCache = false;
|
|
102
|
-
|
|
103
|
-
/** @type {LightriderStatistics|undefined} Extra timing information available only when run in Lightrider. */
|
|
104
|
-
this.lrStatistics = undefined;
|
|
105
|
-
|
|
106
|
-
this.finished = false;
|
|
107
|
-
this.requestMethod = '';
|
|
108
|
-
this.statusCode = -1;
|
|
109
|
-
/** @type {NetworkRequest|undefined} The network request that redirected to this one */
|
|
110
|
-
this.redirectSource = undefined;
|
|
111
|
-
/** @type {NetworkRequest|undefined} The network request that this one redirected to */
|
|
112
|
-
this.redirectDestination = undefined;
|
|
113
|
-
/** @type {NetworkRequest[]|undefined} The chain of network requests that redirected to this one */
|
|
114
|
-
this.redirects = undefined;
|
|
115
|
-
this.failed = false;
|
|
116
|
-
this.localizedFailDescription = '';
|
|
117
|
-
|
|
118
|
-
/** @type {LH.Crdp.Network.Initiator} */
|
|
119
|
-
this.initiator = {type: 'other'};
|
|
120
|
-
/** @type {LH.Crdp.Network.ResourceTiming|undefined} */
|
|
121
|
-
this.timing = undefined;
|
|
122
|
-
/** @type {LH.Crdp.Network.ResourceType|undefined} */
|
|
123
|
-
this.resourceType = undefined;
|
|
124
|
-
this.mimeType = '';
|
|
125
|
-
/** @type {LH.Crdp.Network.ResourcePriority} */
|
|
126
|
-
this.priority = 'Low';
|
|
127
|
-
/** @type {NetworkRequest|undefined} */
|
|
128
|
-
this.initiatorRequest = undefined;
|
|
129
|
-
/** @type {HeaderEntry[]} */
|
|
130
|
-
this.responseHeaders = [];
|
|
131
|
-
/** @type {string} */
|
|
132
|
-
this.responseHeadersText = '';
|
|
133
|
-
|
|
134
|
-
this.fetchedViaServiceWorker = false;
|
|
135
|
-
/** @type {string|undefined} */
|
|
136
|
-
this.frameId = '';
|
|
137
|
-
/**
|
|
138
|
-
* @type {string|undefined}
|
|
139
|
-
* Only set for child targets (OOPIFs). This is the sessionId of the protocol connection on
|
|
140
|
-
* which this request was discovered. `undefined` means it came from the root.
|
|
141
|
-
*/
|
|
142
|
-
this.sessionId = undefined;
|
|
143
|
-
this.isLinkPreload = false;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* @return {boolean}
|
|
148
|
-
*/
|
|
149
|
-
hasErrorStatusCode() {
|
|
150
|
-
return this.statusCode >= 400;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* @param {NetworkRequest} initiatorRequest
|
|
155
|
-
*/
|
|
156
|
-
setInitiatorRequest(initiatorRequest) {
|
|
157
|
-
this.initiatorRequest = initiatorRequest;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* @param {LH.Crdp.Network.RequestWillBeSentEvent} data
|
|
162
|
-
*/
|
|
163
|
-
onRequestWillBeSent(data) {
|
|
164
|
-
this.requestId = data.requestId;
|
|
165
|
-
let url;
|
|
166
|
-
try {
|
|
167
|
-
// try to construct the url and fill in request
|
|
168
|
-
url = new URL(data.request.url);
|
|
169
|
-
} catch (e) {
|
|
170
|
-
// isValid left false, all other data is blank
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
this.url = data.request.url;
|
|
174
|
-
this.documentURL = data.documentURL;
|
|
175
|
-
this.parsedURL = {
|
|
176
|
-
scheme: url.protocol.split(':')[0],
|
|
177
|
-
// Intentional, DevTools uses different terminology
|
|
178
|
-
host: url.hostname,
|
|
179
|
-
securityOrigin: url.origin,
|
|
180
|
-
};
|
|
181
|
-
this.isSecure = URL.isSecureScheme(this.parsedURL.scheme);
|
|
182
|
-
|
|
183
|
-
this.rendererStartTime = data.timestamp;
|
|
184
|
-
this.startTime = data.timestamp;
|
|
185
|
-
|
|
186
|
-
this.requestMethod = data.request.method;
|
|
187
|
-
|
|
188
|
-
this.initiator = data.initiator;
|
|
189
|
-
this.resourceType = data.type && RESOURCE_TYPES[data.type];
|
|
190
|
-
this.priority = data.request.initialPriority;
|
|
191
|
-
|
|
192
|
-
this.frameId = data.frameId;
|
|
193
|
-
this.isLinkPreload = data.initiator.type === 'preload' || !!data.request.isLinkPreload;
|
|
194
|
-
this.isValid = true;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
onRequestServedFromCache() {
|
|
198
|
-
this.fromMemoryCache = true;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* @param {LH.Crdp.Network.ResponseReceivedEvent} data
|
|
203
|
-
*/
|
|
204
|
-
onResponseReceived(data) {
|
|
205
|
-
this._onResponse(data.response, data.timestamp, data.type);
|
|
206
|
-
this._updateProtocolForLightrider();
|
|
207
|
-
this.frameId = data.frameId;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* @param {LH.Crdp.Network.DataReceivedEvent} data
|
|
212
|
-
*/
|
|
213
|
-
onDataReceived(data) {
|
|
214
|
-
this.resourceSize += data.dataLength;
|
|
215
|
-
if (data.encodedDataLength !== -1) {
|
|
216
|
-
this.transferSize += data.encodedDataLength;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* @param {LH.Crdp.Network.LoadingFinishedEvent} data
|
|
222
|
-
*/
|
|
223
|
-
onLoadingFinished(data) {
|
|
224
|
-
// On some requests DevTools can send duplicate events, prefer the first one for best timing data
|
|
225
|
-
if (this.finished) return;
|
|
226
|
-
|
|
227
|
-
this.finished = true;
|
|
228
|
-
this.endTime = data.timestamp;
|
|
229
|
-
if (data.encodedDataLength >= 0) {
|
|
230
|
-
this.transferSize = data.encodedDataLength;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
this._updateResponseReceivedTimeIfNecessary();
|
|
234
|
-
this._updateTransferSizeForLightrider();
|
|
235
|
-
this._updateTimingsForLightrider();
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* @param {LH.Crdp.Network.LoadingFailedEvent} data
|
|
240
|
-
*/
|
|
241
|
-
onLoadingFailed(data) {
|
|
242
|
-
// On some requests DevTools can send duplicate events, prefer the first one for best timing data
|
|
243
|
-
if (this.finished) return;
|
|
244
|
-
|
|
245
|
-
this.finished = true;
|
|
246
|
-
this.endTime = data.timestamp;
|
|
247
|
-
|
|
248
|
-
this.failed = true;
|
|
249
|
-
this.resourceType = data.type && RESOURCE_TYPES[data.type];
|
|
250
|
-
this.localizedFailDescription = data.errorText;
|
|
251
|
-
|
|
252
|
-
this._updateResponseReceivedTimeIfNecessary();
|
|
253
|
-
this._updateTransferSizeForLightrider();
|
|
254
|
-
this._updateTimingsForLightrider();
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* @param {LH.Crdp.Network.ResourceChangedPriorityEvent} data
|
|
259
|
-
*/
|
|
260
|
-
onResourceChangedPriority(data) {
|
|
261
|
-
this.priority = data.newPriority;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* @param {LH.Crdp.Network.RequestWillBeSentEvent} data
|
|
266
|
-
*/
|
|
267
|
-
onRedirectResponse(data) {
|
|
268
|
-
if (!data.redirectResponse) throw new Error('Missing redirectResponse data');
|
|
269
|
-
this._onResponse(data.redirectResponse, data.timestamp, data.type);
|
|
270
|
-
this.resourceType = undefined;
|
|
271
|
-
this.finished = true;
|
|
272
|
-
this.endTime = data.timestamp;
|
|
273
|
-
|
|
274
|
-
this._updateResponseReceivedTimeIfNecessary();
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* @param {string=} sessionId
|
|
279
|
-
*/
|
|
280
|
-
setSession(sessionId) {
|
|
281
|
-
this.sessionId = sessionId;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* @param {LH.Crdp.Network.Response} response
|
|
286
|
-
* @param {number} timestamp
|
|
287
|
-
* @param {LH.Crdp.Network.ResponseReceivedEvent['type']=} resourceType
|
|
288
|
-
*/
|
|
289
|
-
_onResponse(response, timestamp, resourceType) {
|
|
290
|
-
this.url = response.url;
|
|
291
|
-
|
|
292
|
-
this.connectionId = String(response.connectionId);
|
|
293
|
-
this.connectionReused = response.connectionReused;
|
|
294
|
-
|
|
295
|
-
if (response.protocol) this.protocol = response.protocol;
|
|
296
|
-
|
|
297
|
-
this.responseReceivedTime = timestamp;
|
|
298
|
-
|
|
299
|
-
this.transferSize = response.encodedDataLength;
|
|
300
|
-
if (typeof response.fromDiskCache === 'boolean') this.fromDiskCache = response.fromDiskCache;
|
|
301
|
-
if (typeof response.fromPrefetchCache === 'boolean') {
|
|
302
|
-
this.fromPrefetchCache = response.fromPrefetchCache;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
this.statusCode = response.status;
|
|
306
|
-
|
|
307
|
-
this.timing = response.timing;
|
|
308
|
-
if (resourceType) this.resourceType = RESOURCE_TYPES[resourceType];
|
|
309
|
-
this.mimeType = response.mimeType;
|
|
310
|
-
this.responseHeadersText = response.headersText || '';
|
|
311
|
-
this.responseHeaders = NetworkRequest._headersDictToHeadersArray(response.headers);
|
|
312
|
-
|
|
313
|
-
this.fetchedViaServiceWorker = !!response.fromServiceWorker;
|
|
314
|
-
|
|
315
|
-
if (this.fromMemoryCache) this.timing = undefined;
|
|
316
|
-
if (this.timing) this._recomputeTimesWithResourceTiming(this.timing);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Resolve differences between conflicting timing signals. Based on the property setters in DevTools.
|
|
321
|
-
* @see https://github.com/ChromeDevTools/devtools-frontend/blob/56a99365197b85c24b732ac92b0ac70feed80179/front_end/sdk/NetworkRequest.js#L485-L502
|
|
322
|
-
* @param {LH.Crdp.Network.ResourceTiming} timing
|
|
323
|
-
*/
|
|
324
|
-
_recomputeTimesWithResourceTiming(timing) {
|
|
325
|
-
// Don't recompute times if the data is invalid. RequestTime should always be a thread timestamp.
|
|
326
|
-
// If we don't have receiveHeadersEnd, we really don't have more accurate data.
|
|
327
|
-
if (timing.requestTime === 0 || timing.receiveHeadersEnd === -1) return;
|
|
328
|
-
// Take startTime and responseReceivedTime from timing data for better accuracy.
|
|
329
|
-
// Timing's requestTime is a baseline in seconds, rest of the numbers there are ticks in millis.
|
|
330
|
-
this.startTime = timing.requestTime;
|
|
331
|
-
const headersReceivedTime = timing.requestTime + timing.receiveHeadersEnd / 1000;
|
|
332
|
-
if (!this.responseReceivedTime || this.responseReceivedTime < 0) {
|
|
333
|
-
this.responseReceivedTime = headersReceivedTime;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
this.responseReceivedTime = Math.min(this.responseReceivedTime, headersReceivedTime);
|
|
337
|
-
this.responseReceivedTime = Math.max(this.responseReceivedTime, this.startTime);
|
|
338
|
-
// We're only at responseReceived (_onResponse) at this point.
|
|
339
|
-
// This endTime may be redefined again after onLoading is done.
|
|
340
|
-
this.endTime = Math.max(this.endTime, this.responseReceivedTime);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Update responseReceivedTime to the endTime if endTime is earlier.
|
|
345
|
-
* A response can't be received after the entire request finished.
|
|
346
|
-
*/
|
|
347
|
-
_updateResponseReceivedTimeIfNecessary() {
|
|
348
|
-
this.responseReceivedTime = Math.min(this.endTime, this.responseReceivedTime);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* LR loses transfer size information, but passes it in the 'X-TotalFetchedSize' header.
|
|
353
|
-
* 'X-TotalFetchedSize' is the canonical transfer size in LR. Nothing should supersede it.
|
|
354
|
-
*
|
|
355
|
-
* The total length of the encoded data is spread out among multiple events. The sum of the
|
|
356
|
-
* values in onResponseReceived and all the onDataReceived events typically equals the value
|
|
357
|
-
* seen on the onLoadingFinished event. In <1% of cases we see the values differ. As we process
|
|
358
|
-
* onResponseReceived and onDataReceived we accumulate the total encodedDataLength. When we
|
|
359
|
-
* process onLoadingFinished, we override the accumulated total. We do this so that if the
|
|
360
|
-
* request is aborted or fails, we still get a value via the accumulation.
|
|
361
|
-
*
|
|
362
|
-
* In Lightrider, due to instrumentation limitations, our values for encodedDataLength are bogus
|
|
363
|
-
* and not valid. However the resource's true encodedDataLength/transferSize is shared via a
|
|
364
|
-
* special response header, X-TotalFetchedSize. In this situation, we read this value from
|
|
365
|
-
* responseReceived, use it for the transferSize and ignore the encodedDataLength values in
|
|
366
|
-
* both dataReceived and loadingFinished.
|
|
367
|
-
*/
|
|
368
|
-
_updateTransferSizeForLightrider() {
|
|
369
|
-
// Bail if we aren't in Lightrider.
|
|
370
|
-
if (!global.isLightrider) return;
|
|
371
|
-
|
|
372
|
-
const totalFetchedSize = this.responseHeaders.find(item => item.name === HEADER_FETCHED_SIZE);
|
|
373
|
-
// Bail if the header was missing.
|
|
374
|
-
if (!totalFetchedSize) return;
|
|
375
|
-
const floatValue = parseFloat(totalFetchedSize.value);
|
|
376
|
-
// Bail if the header cannot be parsed.
|
|
377
|
-
if (isNaN(floatValue)) return;
|
|
378
|
-
this.transferSize = floatValue;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* LR loses protocol information.
|
|
383
|
-
*/
|
|
384
|
-
_updateProtocolForLightrider() {
|
|
385
|
-
// Bail if we aren't in Lightrider.
|
|
386
|
-
if (!global.isLightrider) return;
|
|
387
|
-
|
|
388
|
-
if (this.responseHeaders.some(item => item.name === HEADER_PROTOCOL_IS_H2)) {
|
|
389
|
-
this.protocol = 'h2';
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* LR gets additional, accurate timing information from its underlying fetch infrastructure. This
|
|
395
|
-
* is passed in via X-Headers similar to 'X-TotalFetchedSize'.
|
|
396
|
-
*/
|
|
397
|
-
_updateTimingsForLightrider() {
|
|
398
|
-
// Bail if we aren't in Lightrider.
|
|
399
|
-
if (!global.isLightrider) return;
|
|
400
|
-
|
|
401
|
-
// For more info on timing nomenclature: https://www.w3.org/TR/resource-timing-2/#processing-model
|
|
402
|
-
|
|
403
|
-
// StartTime
|
|
404
|
-
// | ConnectStart
|
|
405
|
-
// | | SSLStart SSLEnd
|
|
406
|
-
// | | | | ConnectEnd
|
|
407
|
-
// | | | | | SendStart/End ReceiveHeadersEnd
|
|
408
|
-
// | | | | | | | EndTime
|
|
409
|
-
// ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
|
|
410
|
-
// [ [TCP [ SSL ] ] [ Request ] [ Response ] ]
|
|
411
|
-
// ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲
|
|
412
|
-
// | | '-SSLMs---' | '-requestMs---' '-responseMs---' |
|
|
413
|
-
// | '----TCPMs--------' |
|
|
414
|
-
// | |
|
|
415
|
-
// '------------------------TotalMs-----------------------'
|
|
416
|
-
|
|
417
|
-
const totalHeader = this.responseHeaders.find(item => item.name === HEADER_TOTAL);
|
|
418
|
-
// Bail if there was no totalTime.
|
|
419
|
-
if (!totalHeader) return;
|
|
420
|
-
|
|
421
|
-
const totalMs = parseInt(totalHeader.value);
|
|
422
|
-
const TCPMsHeader = this.responseHeaders.find(item => item.name === HEADER_TCP);
|
|
423
|
-
const SSLMsHeader = this.responseHeaders.find(item => item.name === HEADER_SSL);
|
|
424
|
-
const requestMsHeader = this.responseHeaders.find(item => item.name === HEADER_REQ);
|
|
425
|
-
const responseMsHeader = this.responseHeaders.find(item => item.name === HEADER_RES);
|
|
426
|
-
|
|
427
|
-
// Make sure all times are initialized and are non-negative.
|
|
428
|
-
const TCPMs = TCPMsHeader ? Math.max(0, parseInt(TCPMsHeader.value)) : 0;
|
|
429
|
-
const SSLMs = SSLMsHeader ? Math.max(0, parseInt(SSLMsHeader.value)) : 0;
|
|
430
|
-
const requestMs = requestMsHeader ? Math.max(0, parseInt(requestMsHeader.value)) : 0;
|
|
431
|
-
const responseMs = responseMsHeader ? Math.max(0, parseInt(responseMsHeader.value)) : 0;
|
|
432
|
-
|
|
433
|
-
// Bail if the timings don't add up.
|
|
434
|
-
if (TCPMs + requestMs + responseMs !== totalMs) {
|
|
435
|
-
return;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
// Bail if SSL time is > TCP time.
|
|
439
|
-
if (SSLMs > TCPMs) {
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
this.lrStatistics = {
|
|
444
|
-
endTimeDeltaMs: (this.endTime - (this.startTime + (totalMs / 1000))) * 1000,
|
|
445
|
-
TCPMs: TCPMs,
|
|
446
|
-
requestMs: requestMs,
|
|
447
|
-
responseMs: responseMs,
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
* Convert the requestId to backend-version by removing the `:redirect` portion
|
|
453
|
-
*
|
|
454
|
-
* @param {string} requestId
|
|
455
|
-
* @return {string}
|
|
456
|
-
*/
|
|
457
|
-
static getRequestIdForBackend(requestId) {
|
|
458
|
-
return requestId.replace(/(:redirect)+$/, '');
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* Based on DevTools NetworkManager.
|
|
463
|
-
* @see https://github.com/ChromeDevTools/devtools-frontend/blob/3415ee28e86a3f4bcc2e15b652d22069938df3a6/front_end/sdk/NetworkManager.js#L285-L297
|
|
464
|
-
* @param {LH.Crdp.Network.Headers} headersDict
|
|
465
|
-
* @return {Array<HeaderEntry>}
|
|
466
|
-
*/
|
|
467
|
-
static _headersDictToHeadersArray(headersDict) {
|
|
468
|
-
const result = [];
|
|
469
|
-
for (const name of Object.keys(headersDict)) {
|
|
470
|
-
const values = headersDict[name].split('\n');
|
|
471
|
-
for (let i = 0; i < values.length; ++i) {
|
|
472
|
-
result.push({name: name, value: values[i]});
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
return result;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
static get TYPES() {
|
|
479
|
-
return RESOURCE_TYPES;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* @param {NetworkRequest} record
|
|
484
|
-
* @return {boolean}
|
|
485
|
-
*/
|
|
486
|
-
static isNonNetworkRequest(record) {
|
|
487
|
-
// The 'protocol' field in devtools a string more like a `scheme`
|
|
488
|
-
return URL.isNonNetworkProtocol(record.protocol) ||
|
|
489
|
-
// But `protocol` can fail to be populated if the request fails, so fallback to scheme.
|
|
490
|
-
URL.isNonNetworkProtocol(record.parsedURL.scheme);
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* Technically there's not alignment on URLs that create "secure connections" vs "secure contexts"
|
|
495
|
-
* https://github.com/GoogleChrome/lighthouse/pull/11766#discussion_r582340683
|
|
496
|
-
* But for our purposes, we don't need to worry too much.
|
|
497
|
-
* @param {NetworkRequest} record
|
|
498
|
-
* @return {boolean}
|
|
499
|
-
*/
|
|
500
|
-
static isSecureRequest(record) {
|
|
501
|
-
return URL.isSecureScheme(record.parsedURL.scheme) ||
|
|
502
|
-
URL.isSecureScheme(record.protocol) ||
|
|
503
|
-
URL.isLikeLocalhost(record.parsedURL.host) ||
|
|
504
|
-
NetworkRequest.isHstsRequest(record);
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* Returns whether the network request was an HSTS redirect request.
|
|
509
|
-
* @param {NetworkRequest} record
|
|
510
|
-
* @return {boolean}
|
|
511
|
-
*/
|
|
512
|
-
static isHstsRequest(record) {
|
|
513
|
-
const destination = record.redirectDestination;
|
|
514
|
-
if (!destination) return false;
|
|
515
|
-
|
|
516
|
-
const reasonHeader = record.responseHeaders
|
|
517
|
-
.find(header => header.name === 'Non-Authoritative-Reason');
|
|
518
|
-
const reason = reasonHeader?.value;
|
|
519
|
-
return reason === 'HSTS' && NetworkRequest.isSecureRequest(destination);
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
/**
|
|
523
|
-
* Resource size is almost always the right one to be using because of the below:
|
|
524
|
-
* `transferSize = resourceSize + headers.length`.
|
|
525
|
-
* HOWEVER, there are some cases where an image is compressed again over the network and transfer size
|
|
526
|
-
* is smaller (see https://github.com/GoogleChrome/lighthouse/pull/4968).
|
|
527
|
-
* Use the min of the two numbers to be safe.
|
|
528
|
-
* `tranferSize` of cached records is 0
|
|
529
|
-
* @param {NetworkRequest} networkRecord
|
|
530
|
-
* @return {number}
|
|
531
|
-
*/
|
|
532
|
-
static getResourceSizeOnNetwork(networkRecord) {
|
|
533
|
-
return Math.min(networkRecord.resourceSize || 0, networkRecord.transferSize || Infinity);
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
NetworkRequest.HEADER_TCP = HEADER_TCP;
|
|
538
|
-
NetworkRequest.HEADER_SSL = HEADER_SSL;
|
|
539
|
-
NetworkRequest.HEADER_REQ = HEADER_REQ;
|
|
540
|
-
NetworkRequest.HEADER_RES = HEADER_RES;
|
|
541
|
-
NetworkRequest.HEADER_TOTAL = HEADER_TOTAL;
|
|
542
|
-
NetworkRequest.HEADER_FETCHED_SIZE = HEADER_FETCHED_SIZE;
|
|
543
|
-
NetworkRequest.HEADER_PROTOCOL_IS_H2 = HEADER_PROTOCOL_IS_H2;
|
|
544
|
-
|
|
545
|
-
module.exports = NetworkRequest;
|