lighthouse 13.5.0 → 13.6.0-dev.20261027
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/.agents/skills/update-ard-port/SKILL.md +171 -0
- package/.agents/skills/update-trace-engine/SKILL.md +154 -0
- package/cli/bin.d.ts +2 -2
- package/cli/bin.js +5 -4
- package/cli/cli-flags.d.ts +16 -1
- package/cli/cli-flags.js +53 -2
- package/cli/printer.js +5 -8
- package/cli/run.d.ts +5 -5
- package/cli/run.js +97 -47
- package/cli/sentry-prompt.js +3 -4
- package/cli/test/smokehouse/__snapshots__/report-assert-test.js.snap +1 -1
- package/cli/test/smokehouse/config/exclusions.js +3 -1
- package/cli/test/smokehouse/frontends/smokehouse-bin.js +5 -3
- package/cli/test/smokehouse/report-assert-test.js +65 -0
- package/cli/test/smokehouse/report-assert.js +24 -39
- package/cli/test/smokehouse/smokehouse-test.d.ts +2 -0
- package/cli/test/smokehouse/smokehouse-test.js +120 -0
- package/cli/test/smokehouse/smokehouse.js +37 -15
- package/cli/test/smokehouse/version-check-test.js +5 -0
- package/cli/test/smokehouse/version-check.d.ts +1 -1
- package/cli/test/smokehouse/version-check.js +1 -1
- package/commitlint.config.js +1 -1
- package/core/audits/accessibility/accesskeys.js +1 -1
- package/core/audits/accessibility/aria-allowed-attr.js +1 -1
- package/core/audits/accessibility/aria-allowed-role.js +1 -1
- package/core/audits/accessibility/aria-command-name.js +1 -1
- package/core/audits/accessibility/aria-conditional-attr.js +1 -1
- package/core/audits/accessibility/aria-deprecated-role.js +1 -1
- package/core/audits/accessibility/aria-dialog-name.js +1 -1
- package/core/audits/accessibility/aria-hidden-body.js +1 -1
- package/core/audits/accessibility/aria-hidden-focus.js +1 -1
- package/core/audits/accessibility/aria-input-field-name.js +1 -1
- package/core/audits/accessibility/aria-meter-name.js +1 -1
- package/core/audits/accessibility/aria-progressbar-name.js +1 -1
- package/core/audits/accessibility/aria-prohibited-attr.js +1 -1
- package/core/audits/accessibility/aria-required-attr.js +1 -1
- package/core/audits/accessibility/aria-required-children.js +1 -1
- package/core/audits/accessibility/aria-required-parent.js +1 -1
- package/core/audits/accessibility/aria-roles.js +1 -1
- package/core/audits/accessibility/aria-text.js +1 -1
- package/core/audits/accessibility/aria-toggle-field-name.js +1 -1
- package/core/audits/accessibility/aria-tooltip-name.js +1 -1
- package/core/audits/accessibility/aria-treeitem-name.js +1 -1
- package/core/audits/accessibility/aria-valid-attr-value.js +1 -1
- package/core/audits/accessibility/aria-valid-attr.js +1 -1
- package/core/audits/accessibility/autocomplete-valid.js +1 -1
- package/core/audits/accessibility/button-name.js +1 -1
- package/core/audits/accessibility/bypass.js +1 -1
- package/core/audits/accessibility/color-contrast.js +1 -1
- package/core/audits/accessibility/definition-list.js +1 -1
- package/core/audits/accessibility/dlitem.js +1 -1
- package/core/audits/accessibility/document-title.js +1 -1
- package/core/audits/accessibility/duplicate-id-aria.js +1 -1
- package/core/audits/accessibility/empty-heading.js +1 -1
- package/core/audits/accessibility/form-field-multiple-labels.js +1 -1
- package/core/audits/accessibility/frame-title.js +1 -1
- package/core/audits/accessibility/heading-order.js +1 -1
- package/core/audits/accessibility/html-has-lang.js +1 -1
- package/core/audits/accessibility/html-lang-valid.js +1 -1
- package/core/audits/accessibility/html-xml-lang-mismatch.js +1 -1
- package/core/audits/accessibility/identical-links-same-purpose.js +1 -1
- package/core/audits/accessibility/image-alt.js +1 -1
- package/core/audits/accessibility/image-redundant-alt.js +1 -1
- package/core/audits/accessibility/input-button-name.js +1 -1
- package/core/audits/accessibility/input-image-alt.js +1 -1
- package/core/audits/accessibility/label-content-name-mismatch.js +1 -1
- package/core/audits/accessibility/label.js +1 -1
- package/core/audits/accessibility/landmark-one-main.js +1 -1
- package/core/audits/accessibility/link-in-text-block.js +1 -1
- package/core/audits/accessibility/link-name.js +1 -1
- package/core/audits/accessibility/list.js +1 -1
- package/core/audits/accessibility/listitem.js +1 -1
- package/core/audits/accessibility/meta-refresh.js +1 -1
- package/core/audits/accessibility/meta-viewport.js +1 -1
- package/core/audits/accessibility/object-alt.js +1 -1
- package/core/audits/accessibility/presentation-role-conflict.js +1 -1
- package/core/audits/accessibility/select-name.js +1 -1
- package/core/audits/accessibility/skip-link.js +1 -1
- package/core/audits/accessibility/svg-img-alt.js +1 -1
- package/core/audits/accessibility/tabindex.js +1 -1
- package/core/audits/accessibility/table-duplicate-name.js +1 -1
- package/core/audits/accessibility/table-fake-caption.js +1 -1
- package/core/audits/accessibility/target-size.js +1 -1
- package/core/audits/accessibility/td-has-header.js +1 -1
- package/core/audits/accessibility/td-headers-attr.js +1 -1
- package/core/audits/accessibility/th-has-data-cells.js +1 -1
- package/core/audits/accessibility/valid-lang.js +1 -1
- package/core/audits/accessibility/video-caption.js +1 -1
- package/core/audits/agentic/ard-schema.d.ts +13 -0
- package/core/audits/agentic/ard-schema.js +81 -33
- package/core/audits/agentic/llms-txt.js +5 -2
- package/core/audits/baseline.d.ts +29 -7
- package/core/audits/baseline.js +19 -6
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +2 -2
- package/core/audits/insights/insight-audit.d.ts +9 -0
- package/core/audits/insights/insight-audit.js +35 -28
- package/core/audits/long-tasks.js +2 -1
- package/core/audits/predictive-perf.js +2 -2
- package/core/audits/screenshot-thumbnails.d.ts +0 -13
- package/core/audits/screenshot-thumbnails.js +0 -45
- package/core/audits/script-treemap-data.js +26 -6
- package/core/audits/seo/robots-txt.js +3 -8
- package/core/audits/unsized-images.d.ts +0 -7
- package/core/audits/unsized-images.js +7 -26
- package/core/computed/lcp-image-record.d.ts +2 -23
- package/core/computed/lcp-image-record.js +3 -67
- package/core/computed/lcp-network-record.d.ts +24 -0
- package/core/computed/lcp-network-record.js +74 -0
- package/core/computed/metrics/lantern-metric.js +1 -1
- package/core/computed/metrics/lcp-breakdown.js +6 -6
- package/core/computed/metrics/time-to-first-byte.js +5 -3
- package/core/computed/navigation-insights.js +3 -2
- package/core/computed/page-dependency-graph.js +55 -5
- package/core/computed/speedline.js +20 -5
- package/core/computed/trace-engine-result.js +25 -5
- package/core/computed/unused-css.js +15 -2
- package/core/config/config-helpers.d.ts +5 -0
- package/core/config/config-helpers.js +8 -28
- package/core/config/config.js +1 -2
- package/core/config/constants.d.ts +2 -28
- package/core/config/lr-desktop-config.js +13 -0
- package/core/config/lr-mobile-config.js +13 -0
- package/core/gather/base-artifacts.js +7 -1
- package/core/gather/driver/storage.js +3 -2
- package/core/gather/gatherers/agentic/ard.d.ts +59 -4
- package/core/gather/gatherers/agentic/ard.js +218 -56
- package/core/gather/gatherers/full-page-screenshot.js +2 -2
- package/core/gather/gatherers/image-elements.d.ts +7 -0
- package/core/gather/gatherers/image-elements.js +75 -24
- package/core/gather/gatherers/inspector-issues.js +2 -0
- package/core/gather/gatherers/js-usage.js +2 -0
- package/core/gather/gatherers/scripts.d.ts +16 -3
- package/core/gather/gatherers/scripts.js +157 -14
- package/core/gather/gatherers/stylesheets.js +2 -0
- package/core/gather/gatherers/trace-elements.js +2 -1
- package/core/gather/gatherers/trace.d.ts +6 -0
- package/core/gather/gatherers/trace.js +56 -16
- package/core/lib/arbitrary-equality-map.d.ts +14 -3
- package/core/lib/arbitrary-equality-map.js +113 -6
- package/core/lib/baseline/web-features-data.json +32 -11
- package/core/lib/baseline/web-features-metadata.json +1 -1
- package/core/lib/bf-cache-strings.js +237 -254
- package/core/lib/cdt/Common.d.ts +1 -1
- package/core/lib/cdt/Common.js +2 -2
- package/core/lib/cdt/Platform.d.ts +7 -7
- package/core/lib/cdt/Platform.js +11 -8
- package/core/lib/cdt/SDK.d.ts +5 -1
- package/core/lib/cdt/SDK.js +4 -2
- package/core/lib/cdt/generated/ParsedURL.d.ts +0 -1
- package/core/lib/cdt/generated/ParsedURL.js +3 -9
- package/core/lib/cdt/generated/SourceMap.d.ts +24 -25
- package/core/lib/cdt/generated/SourceMap.js +7 -15
- package/core/lib/deprecations-strings.d.ts +93 -88
- package/core/lib/deprecations-strings.js +20 -14
- package/core/lib/i18n/i18n.d.ts +0 -1
- package/core/lib/i18n/i18n.js +17 -11
- package/core/lib/legacy-javascript/legacy-javascript.d.ts +3 -2
- package/core/lib/legacy-javascript/legacy-javascript.js +235 -111
- package/core/lib/legacy-javascript/polyfill-graph-data.json +94 -89
- package/core/lib/legacy-javascript/polyfill-module-data.json +48 -7
- package/core/lib/minification-estimator.js +10 -10
- package/core/lib/network-request.d.ts +2 -0
- package/core/lib/network-request.js +21 -0
- package/core/lib/page-functions.js +2 -5
- package/core/lib/sentry.d.ts +1 -0
- package/core/lib/sentry.js +3 -0
- package/core/lib/trace-engine.d.ts +1 -0
- package/core/lib/trace-engine.js +2 -0
- package/core/runner.js +9 -3
- package/dist/report/bundle.esm.js +10 -10
- package/dist/report/flow.js +13 -13
- package/dist/report/standalone.js +5 -5
- package/flow-report/src/common.tsx +5 -2
- package/flow-report/src/i18n/i18n.d.ts +2 -0
- package/flow-report/src/summary/summary.tsx +9 -1
- package/flow-report/src/util.d.ts +1 -1
- package/package.json +62 -98
- package/readme.md +13 -18
- package/report/generator/file-namer.d.ts +1 -1
- package/report/generator/file-namer.js +5 -4
- package/report/generator/flow-report-assets.js +1 -3
- package/report/generator/report-assets.js +1 -2
- package/report/renderer/category-renderer.js +2 -2
- package/report/renderer/details-renderer.js +3 -2
- package/report/renderer/dom.d.ts +8 -2
- package/report/renderer/dom.js +29 -1
- package/report/renderer/element-screenshot-renderer.js +3 -0
- package/report/renderer/performance-category-renderer.js +3 -1
- package/report/renderer/report-renderer.js +4 -0
- package/report/renderer/report-utils.d.ts +1 -0
- package/report/renderer/report-utils.js +2 -0
- package/report/renderer/text-encoding.js +2 -2
- package/report/types/augment-dom.d.ts +4 -0
- package/shared/esm-utils.d.ts +0 -8
- package/shared/esm-utils.js +0 -18
- package/shared/localization/format.js +1 -2
- package/shared/localization/locales/ar-XB.json +157 -142
- package/shared/localization/locales/ar.json +157 -142
- package/shared/localization/locales/bg.json +154 -139
- package/shared/localization/locales/ca.json +157 -142
- package/shared/localization/locales/cs.json +148 -133
- package/shared/localization/locales/da.json +153 -138
- package/shared/localization/locales/de.json +152 -137
- package/shared/localization/locales/el.json +153 -138
- package/shared/localization/locales/en-GB.json +160 -145
- package/shared/localization/locales/en-US.json +239 -218
- package/shared/localization/locales/en-XL.json +239 -218
- package/shared/localization/locales/es-419.json +150 -135
- package/shared/localization/locales/es.json +149 -134
- package/shared/localization/locales/fi.json +151 -136
- package/shared/localization/locales/fil.json +154 -139
- package/shared/localization/locales/fr.json +150 -135
- package/shared/localization/locales/he.json +160 -145
- package/shared/localization/locales/hi.json +156 -141
- package/shared/localization/locales/hr.json +154 -139
- package/shared/localization/locales/hu.json +111 -96
- package/shared/localization/locales/id.json +153 -138
- package/shared/localization/locales/it.json +153 -138
- package/shared/localization/locales/ja.json +150 -135
- package/shared/localization/locales/ko.json +42 -27
- package/shared/localization/locales/lt.json +152 -137
- package/shared/localization/locales/lv.json +93 -78
- package/shared/localization/locales/nl.json +149 -134
- package/shared/localization/locales/no.json +152 -137
- package/shared/localization/locales/pl.json +153 -138
- package/shared/localization/locales/pt-PT.json +152 -137
- package/shared/localization/locales/pt.json +157 -142
- package/shared/localization/locales/ro.json +149 -134
- package/shared/localization/locales/ru.json +76 -61
- package/shared/localization/locales/sk.json +153 -138
- package/shared/localization/locales/sl.json +149 -134
- package/shared/localization/locales/sr-Latn.json +151 -136
- package/shared/localization/locales/sr.json +151 -136
- package/shared/localization/locales/sv.json +152 -137
- package/shared/localization/locales/ta.json +156 -141
- package/shared/localization/locales/te.json +157 -142
- package/shared/localization/locales/th.json +111 -96
- package/shared/localization/locales/tr.json +153 -138
- package/shared/localization/locales/uk.json +149 -134
- package/shared/localization/locales/vi.json +162 -147
- package/shared/localization/locales/zh-HK.json +150 -135
- package/shared/localization/locales/zh-TW.json +154 -139
- package/shared/localization/locales/zh.json +152 -137
- package/shared/localization/swap-locale.js +10 -5
- package/shared/root.js +1 -3
- package/third-party/ard/README.md +19 -10
- package/third-party/ard/ard-test.js +189 -266
- package/third-party/ard/ard.d.ts +18 -1
- package/third-party/ard/ard.js +282 -45
- package/third-party/ard/schema-validator.d.ts +14 -5
- package/third-party/ard/schema-validator.js +921 -1177
- package/third-party/ard/spec/schemas/ard-entry.schema.json +176 -0
- package/tsconfig.json +0 -2
- package/types/artifacts.d.ts +43 -7
- package/types/externs.d.ts +4 -0
- package/types/internal/test.d.ts +1 -0
- package/build-tracker.config.js +0 -16
- package/core/lib/cdt/package.json +0 -4
- package/eslint-local-rules.d.cts +0 -9
- package/eslint.config.mjs +0 -242
- package/third-party/ard/spec/schemas/ai-catalog.schema.json +0 -292
- package/third-party/esbuild-plugins-polyfills/LICENSE +0 -3
- package/third-party/esbuild-plugins-polyfills/README.md +0 -7
- package/third-party/esbuild-plugins-polyfills/esbuild-polyfills.d.ts +0 -9
- package/third-party/esbuild-plugins-polyfills/esbuild-polyfills.js +0 -129
- package/types/internal/lookup-closest-locale.d.ts +0 -13
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lighthouse",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "13.
|
|
4
|
+
"version": "13.6.0-dev.20261027",
|
|
5
5
|
"description": "Automated auditing, performance metrics, and best practices for the web.",
|
|
6
6
|
"main": "./core/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -37,8 +37,9 @@
|
|
|
37
37
|
"reset-link": "(yarn unlink || true) && yarn link && yarn link lighthouse",
|
|
38
38
|
"clean": "rm -r dist proto/scripts/*.json proto/scripts/*_pb2.* proto/scripts/*_pb.* proto/scripts/__pycache__ proto/scripts/*.pyc *.report.html *.report.dom.html *.report.json *.devtoolslog.json *.trace.json shared/localization/locales/*.ctc.json || true",
|
|
39
39
|
"clean-types": "git clean -xfq '*.d.ts' '*.d.cts' -e 'node_modules/' -e 'dist/' -e '.tmp/' -e '**/types/'",
|
|
40
|
-
"lint": "[ \"$CI\" = true ] && eslint --quiet
|
|
41
|
-
"
|
|
40
|
+
"lint": "[ \"$CI\" = true ] && eslint --quiet . || eslint .",
|
|
41
|
+
"zizmor": "uvx zizmor@1.25.2 --gh-token=\"$(gh auth token)\" .github/workflows",
|
|
42
|
+
"smoke": "node --enable-source-maps cli/test/smokehouse/frontends/smokehouse-bin.js",
|
|
42
43
|
"debug": "node --inspect-brk ./cli/index.js",
|
|
43
44
|
"start": "yarn build-report --standalone && node ./cli/index.js",
|
|
44
45
|
"mocha": "node core/test/scripts/run-mocha-tests.js",
|
|
@@ -53,14 +54,13 @@
|
|
|
53
54
|
"test-proto": "yarn compile-proto && yarn build-proto-roundtrip",
|
|
54
55
|
"unit-core": "yarn mocha core",
|
|
55
56
|
"unit-cli": "yarn mocha --testMatch cli/**/*-test.js",
|
|
56
|
-
"unit-lantern-trace": "INTERNAL_LANTERN_USE_TRACE=1 yarn mocha core/test/computed/metrics core/test/audits",
|
|
57
|
+
"unit-lantern-trace": "INTERNAL_LANTERN_USE_TRACE=1 yarn mocha core/test/computed/metrics core/test/computed/page-dependency-graph-test.js core/test/computed/tbt-impact-tasks-test.js core/test/audits",
|
|
57
58
|
"unit-report": "yarn mocha --testMatch report/**/*-test.js",
|
|
58
59
|
"unit-treemap": "yarn mocha --testMatch treemap/**/*-test.js",
|
|
59
60
|
"unit-viewer": "yarn mocha --testMatch viewer/**/*-test.js",
|
|
60
61
|
"unit-flow": "bash flow-report/test/run-flow-report-tests.sh",
|
|
61
62
|
"unit": "yarn unit-flow && yarn mocha && yarn unit-lantern-trace",
|
|
62
63
|
"unit:ci": "NODE_OPTIONS=--max-old-space-size=8192 npm run unit",
|
|
63
|
-
"unit-lantern-trace:ci": "NODE_OPTIONS=--max-old-space-size=8192 npm run unit-lantern-trace",
|
|
64
64
|
"core-unit": "yarn unit-core",
|
|
65
65
|
"cli-unit": "yarn unit-cli",
|
|
66
66
|
"viewer-unit": "yarn unit-viewer",
|
|
@@ -71,9 +71,8 @@
|
|
|
71
71
|
"deploy-treemap": "yarn build-treemap --deploy",
|
|
72
72
|
"deploy-viewer": "yarn build-viewer --deploy",
|
|
73
73
|
"vercel-build": "yarn build-sample-reports && yarn build-viewer && yarn build-treemap",
|
|
74
|
-
"dogfood-lhci": "./core/scripts/dogfood-lhci.sh",
|
|
75
74
|
"timing-trace": "node core/scripts/generate-timing-trace.js",
|
|
76
|
-
"changelog": "conventional-changelog --config ./build/changelog-generator/index.
|
|
75
|
+
"changelog": "conventional-changelog --config ./build/changelog-generator/index.js --infile changelog.md",
|
|
77
76
|
"type-check": "tsc --build ./tsconfig-all.json",
|
|
78
77
|
"i18n:checks": "./core/scripts/i18n/assert-strings-collected.sh",
|
|
79
78
|
"i18n:collect-strings": "node core/scripts/i18n/collect-strings.js",
|
|
@@ -101,119 +100,85 @@
|
|
|
101
100
|
"generate-insight-audits": "node core/scripts/generate-insight-audits.js"
|
|
102
101
|
},
|
|
103
102
|
"devDependencies": {
|
|
104
|
-
"@build-tracker/cli": "^1.0.0-beta.15",
|
|
105
|
-
"@esbuild-kit/esm-loader": "^2.6.5",
|
|
106
|
-
"@esbuild-plugins/node-modules-polyfill": "^0.1.4",
|
|
107
|
-
"@eslint/compat": "^1.3.0",
|
|
108
|
-
"@eslint/eslintrc": "^3.3.1",
|
|
109
103
|
"@eslint/js": "^9.28.0",
|
|
110
104
|
"@formatjs/icu-messageformat-parser": "^2.6.2",
|
|
111
|
-
"@jest/fake-timers": "^
|
|
112
|
-
"@testing-library/preact": "^3.
|
|
113
|
-
"@
|
|
114
|
-
"@types/
|
|
115
|
-
"@types/
|
|
116
|
-
"@types/
|
|
117
|
-
"@types/
|
|
118
|
-
"@types/
|
|
119
|
-
"@types/eslint": "^9.6.1",
|
|
120
|
-
"@types/estree": "^0.0.50",
|
|
121
|
-
"@types/gh-pages": "^2.0.0",
|
|
122
|
-
"@types/google.analytics": "0.0.39",
|
|
105
|
+
"@jest/fake-timers": "^30.5.2",
|
|
106
|
+
"@testing-library/preact": "^3.2.4",
|
|
107
|
+
"@types/archiver": "^8.0.0",
|
|
108
|
+
"@types/chrome": "^0.3.5",
|
|
109
|
+
"@types/debug": "^4.1.13",
|
|
110
|
+
"@types/estree": "^1.0.9",
|
|
111
|
+
"@types/gh-pages": "^6.1.0",
|
|
112
|
+
"@types/google.analytics": "0.0.46",
|
|
123
113
|
"@types/gtag.js": "0.0.20",
|
|
124
|
-
"@types/
|
|
125
|
-
"@types/
|
|
126
|
-
"@types/lodash-es": "^4.17.12",
|
|
127
|
-
"@types/mocha": "^9.0.0",
|
|
114
|
+
"@types/jsdom": "^28.0.3",
|
|
115
|
+
"@types/mocha": "^10.0.10",
|
|
128
116
|
"@types/node": "*",
|
|
129
|
-
"@types/
|
|
130
|
-
"@types/
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"acorn": "^8.5.0",
|
|
140
|
-
"angular": "^1.7.4",
|
|
141
|
-
"archiver": "^7.0.1",
|
|
142
|
-
"builtin-modules": "^3.3.0",
|
|
143
|
-
"chalk": "^2.4.1",
|
|
144
|
-
"chrome-devtools-frontend": "1.0.1684555",
|
|
145
|
-
"colors": "^1.4.0",
|
|
146
|
-
"concurrently": "^9.2.1",
|
|
147
|
-
"conventional-changelog-cli": "^2.1.1",
|
|
148
|
-
"core-js-compat": "^3.44.0",
|
|
149
|
-
"cpy": "^8.1.2",
|
|
150
|
-
"csv-validator": "^0.0.3",
|
|
151
|
-
"esbuild": "0.28.0",
|
|
117
|
+
"@types/yargs": "^17.0.35",
|
|
118
|
+
"@types/yargs-parser": "^21.0.3",
|
|
119
|
+
"acorn": "^8.19.0",
|
|
120
|
+
"ajv": "^8.20.0",
|
|
121
|
+
"archiver": "^8.0.0",
|
|
122
|
+
"chrome-devtools-frontend": "1.0.1726686",
|
|
123
|
+
"concurrently": "^10.0.6",
|
|
124
|
+
"conventional-changelog": "^8.1.3",
|
|
125
|
+
"core-js-compat": "^3.51.0",
|
|
126
|
+
"esbuild": "0.28.2",
|
|
152
127
|
"eslint": "^9.28.0",
|
|
153
|
-
"eslint-
|
|
154
|
-
"
|
|
155
|
-
"
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
"
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
"
|
|
162
|
-
"idb-keyval": "2.2.0",
|
|
163
|
-
"jest-mock": "^29.7.0",
|
|
164
|
-
"jest-snapshot": "^29.7.0",
|
|
165
|
-
"jsdom": "^12.2.0",
|
|
128
|
+
"eslint-plugin-import": "^2.32.0",
|
|
129
|
+
"expect": "^30.5.2",
|
|
130
|
+
"firebase": "^12.19.0",
|
|
131
|
+
"gh-pages": "^6.3.0",
|
|
132
|
+
"globals": "^17.13.0",
|
|
133
|
+
"idb-keyval": "^6.3.0",
|
|
134
|
+
"jest-mock": "^30.5.2",
|
|
135
|
+
"jest-snapshot": "^30.5.2",
|
|
136
|
+
"jsdom": "^29.1.1",
|
|
166
137
|
"lighthouse-plugin-soft-navigation": "^1.1.0",
|
|
167
|
-
"magic-string": "^
|
|
168
|
-
"mime-types": "^
|
|
169
|
-
"mocha": "^
|
|
170
|
-
"pako": "^
|
|
171
|
-
"preact": "^10.
|
|
138
|
+
"magic-string": "^1.4.3",
|
|
139
|
+
"mime-types": "^3.0.2",
|
|
140
|
+
"mocha": "^12.0.3",
|
|
141
|
+
"pako": "^3.0.2",
|
|
142
|
+
"preact": "^10.29.8",
|
|
172
143
|
"pretty-json-stringify": "^0.0.2",
|
|
173
|
-
"puppeteer": "^25.
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"testdouble": "^3.20.2",
|
|
179
|
-
"typed-query-selector": "^2.12.0",
|
|
144
|
+
"puppeteer": "^25.16.0",
|
|
145
|
+
"terser": "^5.51.2",
|
|
146
|
+
"testdouble": "^4.0.0",
|
|
147
|
+
"tsx": "^4.23.15",
|
|
148
|
+
"typed-query-selector": "^2.12.3",
|
|
180
149
|
"typescript": "6.0.3",
|
|
181
|
-
"
|
|
150
|
+
"typescript-eslint": "^8.60.1",
|
|
151
|
+
"wait-for-expect": "^4.0.0",
|
|
152
|
+
"web-features": "^3.44.0",
|
|
182
153
|
"webtreemap-cdt": "^3.2.1"
|
|
183
154
|
},
|
|
184
155
|
"dependencies": {
|
|
185
|
-
"@paulirish/trace_engine": "0.0.
|
|
186
|
-
"@sentry/node": "^
|
|
187
|
-
"ajv": "^8.20.0",
|
|
156
|
+
"@paulirish/trace_engine": "0.0.67",
|
|
157
|
+
"@sentry/node": "^11.8.0",
|
|
188
158
|
"ajv-formats": "^3.0.1",
|
|
189
|
-
"axe-core": "
|
|
190
|
-
"chrome-launcher": "^1.2.
|
|
191
|
-
"configstore": "^
|
|
159
|
+
"axe-core": "4.14.0",
|
|
160
|
+
"chrome-launcher": "^1.2.2",
|
|
161
|
+
"configstore": "^8.0.0",
|
|
192
162
|
"csp_evaluator": "1.1.8",
|
|
193
|
-
"devtools-protocol": "0.0.
|
|
163
|
+
"devtools-protocol": "0.0.1727723",
|
|
194
164
|
"enquirer": "^2.3.6",
|
|
195
165
|
"http-link-header": "^1.1.1",
|
|
196
166
|
"intl-messageformat": "^10.5.3",
|
|
197
|
-
"jpeg-js": "^0.4.4",
|
|
198
167
|
"js-library-detector": "^6.7.0",
|
|
199
168
|
"lighthouse-logger": "^2.0.2",
|
|
200
169
|
"lighthouse-stack-packs": "1.12.3",
|
|
201
|
-
"
|
|
202
|
-
"
|
|
203
|
-
"open": "^8.4.0",
|
|
204
|
-
"puppeteer-core": "^25.9.0",
|
|
170
|
+
"open": "^11.0.4",
|
|
171
|
+
"puppeteer-core": "^25.16.0",
|
|
205
172
|
"robots-parser": "^3.0.1",
|
|
206
173
|
"speedline-core": "^1.4.3",
|
|
207
174
|
"third-party-web": "^0.30.0",
|
|
208
|
-
"tldts-icann": "^7.4.
|
|
209
|
-
"
|
|
210
|
-
"
|
|
211
|
-
"yargs": "^17.3.1",
|
|
212
|
-
"yargs-parser": "^21.0.0"
|
|
175
|
+
"tldts-icann": "^7.4.19",
|
|
176
|
+
"yargs": "^18.2.0",
|
|
177
|
+
"yargs-parser": "^22.0.0"
|
|
213
178
|
},
|
|
214
179
|
"resolutions": {
|
|
215
|
-
"puppeteer/**/devtools-protocol": "0.0.
|
|
216
|
-
"puppeteer-core/**/devtools-protocol": "0.0.
|
|
180
|
+
"puppeteer/**/devtools-protocol": "0.0.1727723",
|
|
181
|
+
"puppeteer-core/**/devtools-protocol": "0.0.1727723"
|
|
217
182
|
},
|
|
218
183
|
"repository": {
|
|
219
184
|
"type": "git",
|
|
@@ -229,6 +194,5 @@
|
|
|
229
194
|
"bugs": {
|
|
230
195
|
"url": "https://github.com/GoogleChrome/lighthouse/issues"
|
|
231
196
|
},
|
|
232
|
-
"homepage": "https://github.com/GoogleChrome/lighthouse#readme"
|
|
233
|
-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
197
|
+
"homepage": "https://github.com/GoogleChrome/lighthouse#readme"
|
|
234
198
|
}
|
package/readme.md
CHANGED
|
@@ -106,10 +106,14 @@ Configuration:
|
|
|
106
106
|
--only-categories Only run the specified categories. Available categories: accessibility, best-practices, performance, seo [array]
|
|
107
107
|
--skip-audits Run everything except these audits [array]
|
|
108
108
|
--disable-full-page-screenshot Disables collection of the full page screenshot, which can be quite large [boolean]
|
|
109
|
+
--ignore-status-code Disables failing on all error status codes, and instead issues a warning. [boolean]
|
|
110
|
+
--url-file The path to a file containing newline-delimited URLs to audit. [string]
|
|
111
|
+
--fail-fast Stop auditing remaining URLs immediately if a run fails. [boolean]
|
|
109
112
|
|
|
110
113
|
Output:
|
|
111
114
|
--output Reporter for the results, supports multiple values. choices: "json", "html", "csv" [array] [default: ["html"]]
|
|
112
|
-
--output-path The file path to output the results. Use 'stdout' to write to stdout.
|
|
115
|
+
--output-path The file or directory path to output the results. Use 'stdout' to write to stdout.
|
|
116
|
+
Directories in the path must already exist. If a directory is specified, the file name will be based on the test URL and date.
|
|
113
117
|
If using JSON output, default is stdout.
|
|
114
118
|
If using HTML or CSV output, default is a file in the working directory with a name based on the test URL and date.
|
|
115
119
|
If using multiple outputs, --output-path is appended with the standard extension for each output type. "reports/my-run" -> "reports/my-run.report.html", "reports/my-run.report.json", etc.
|
|
@@ -177,6 +181,12 @@ lighthouse --output-path=~/mydir/foo.out --save-assets
|
|
|
177
181
|
|
|
178
182
|
lighthouse --output-path=./report.json --output json
|
|
179
183
|
# saves `./report.json`
|
|
184
|
+
|
|
185
|
+
lighthouse https://example.com https://example.org
|
|
186
|
+
# audits multiple URLs sequentially and saves `./<HOST>_<DATE>.report.html` for each
|
|
187
|
+
|
|
188
|
+
lighthouse --url-file=./urls.txt --output-path=./reports
|
|
189
|
+
# audits all URLs in `./urls.txt` and saves reports into the existing `./reports` directory
|
|
180
190
|
```
|
|
181
191
|
|
|
182
192
|
##### Lifecycle Examples
|
|
@@ -394,32 +404,17 @@ This section details services that have integrated Lighthouse data. If you're wo
|
|
|
394
404
|
Other awesome open source projects that use Lighthouse.
|
|
395
405
|
|
|
396
406
|
* **[auto-lighthouse](https://github.com/TGiles/auto-lighthouse)** - a CLI for crawling a domain and generating mobile and desktop reports for each page.
|
|
397
|
-
* **[Exthouse](https://github.com/treosh/exthouse)** - Analyze the impact of a browser extension on web performance.
|
|
398
|
-
* **[Gimbal](https://labs.moduscreate.com/gimbal-web-performance-audit-budgeting)** - An [open source (MIT licensed)](https://github.com/ModusCreateOrg/gimbal) tool used to measure, analyze, and budget aspects of a web application. Gimbal also integrates reports with GitHub pull requests.
|
|
399
|
-
* **[Gradle Lighthouse Plugin](https://github.com/Cognifide/gradle-lighthouse-plugin)** - An open source Gradle plugin that runs Lighthouse tests on multiple URLs and asserts category score thresholds (useful in continuous integration).
|
|
400
407
|
* **[lighthouse-badges](https://github.com/emazzotta/lighthouse-badges)** - Generate gh-badges (shields.io) based on Lighthouse performance.
|
|
401
|
-
* **[lighthouse-batch](https://github.com/mikestead/lighthouse-batch)** - Run Lighthouse over a number of sites and generate a summary of their metrics/scores.
|
|
402
|
-
* **[lighthouse-batch-parallel](https://github.com/Carr1005/lighthouse-batch-parallel)** - Run multiple Lighthouse runs in parallel to accelerate the data collecting process, get the result stream (csv, json, js object) in your own process (warning: performance results may be volatile).
|
|
403
408
|
* **[lighthouse-check-action](https://github.com/foo-software/lighthouse-check-action)** - A GitHub Action to run Lighthouse in a workflow, featuring Slack notifications and report upload to S3.
|
|
404
409
|
* **[lighthouse-check-orb](https://circleci.com/orbs/registry/orb/foo-software/lighthouse-check)** - A CircleCI Orb to run Lighthouse in a workflow, featuring Slack notifications and report upload to S3.
|
|
405
|
-
* **[andreasonny83/lighthouse-ci](https://github.com/andreasonny83/lighthouse-ci)** - Run Lighthouse and assert scores satisfy your custom thresholds.
|
|
406
410
|
* **[GoogleChrome/lighthouse-ci](https://github.com/GoogleChrome/lighthouse-ci)** - (**official**) Automate running Lighthouse for every commit, viewing the changes, and preventing regressions.
|
|
407
411
|
* **[lighthouse-ci-action](https://github.com/treosh/lighthouse-ci-action)** - A GitHub Action that makes it easy to run Lighthouse in CI and keep your pages small using performance budgets.
|
|
408
|
-
* **[lighthouse-gh-reporter](https://github.com/carlesnunez/lighthouse-gh-reporter)** - Run Lighthouse in CI and report back in a comment on your pull requests
|
|
409
|
-
* **[lighthouse-jest-example](https://github.com/justinribeiro/lighthouse-jest-example)** - Gather performance metrics via Lighthouse and assert results with Jest; uses Puppeteer to start Chrome with network emulation settings defined by WebPageTest.
|
|
410
|
-
* **[lighthouse-lambda](https://github.com/Otterseer/lighthouse-lambda)** - Run Lighthouse on AWS Lambda with prebuilt stable desktop Headless Chrome.
|
|
411
412
|
* **[lighthouse-matchers](https://github.com/ackama/lighthouse-matchers)** - Provides RSpec matchers for executing and evaluating Google Chrome Lighthouse audit scores.
|
|
412
|
-
* **[lighthouse-mocha-example](https://github.com/rishichawda/lighthouse-mocha-example)** - Run Lighthouse performance tests with Mocha and chrome-launcher.
|
|
413
|
-
* **[lighthouse-monitor](https://github.com/verivox/lighthouse-monitor)** - Run Lighthouse against all your URLs. Send metrics to any backend you want, save all reports with automatic data retention, and compare any two results in a web UI.
|
|
414
413
|
* **[lighthouse-persist](https://github.com/foo-software/lighthouse-persist)** - Run Lighthouse and upload HTML reports to an AWS S3 bucket.
|
|
415
414
|
* **[lighthouse-viewer](https://github.com/dvelasquez/lighthouse-viewer/tree/main/packages/lighthouse-viewer)** - Render the Lighthouse JSON into a report, using the Lighthouse Report Renderer repackaged as UMD and ESM. Also available with React, Svelte and Vue wrappers.
|
|
416
|
-
* **[
|
|
417
|
-
* **[react-lighthouse-viewer](https://www.npmjs.com/package/react-lighthouse-viewer)** - Render a Lighthouse JSON report in a React Component.
|
|
415
|
+
* **[react-lighthouse-viewer](https://github.com/blencorp/react-lighthouse-viewer)** - Render a Lighthouse JSON report in a React Component.
|
|
418
416
|
* **[site-audit-seo](https://github.com/viasite/site-audit-seo)** - CLI tool for SEO site audit, crawl site, lighthouse each page. Output to console and tables in csv, xlsx, json, web or Google Drive.
|
|
419
|
-
* **[
|
|
420
|
-
* **[cypress-audit](https://github.com/mfrachet/cypress-audit)** - Run Lighthouse and Pa11y audits directly in your E2E test suites.
|
|
421
|
-
* **[laravel-lighthouse](https://github.com/adityadees/laravel-lighthouse)** - Google Lighthouse wrapper for laravel framework to run Google Lighthouse CLI with custom option and can automatically save result in your server directory.
|
|
422
|
-
* **[Neodymium](https://github.com/Xceptance/neodymium/wiki/Accessibility)** - The Neodymium test automation framework integrates Lighthouse for accessibility and Web Vitals verification, allowing programmatic validation and assertion of all audit values.
|
|
417
|
+
* **[Neodymium](https://docs.xceptance.com/neodymium/features/accessibility/)** - The Neodymium test automation framework integrates Lighthouse for accessibility and Web Vitals verification, allowing programmatic validation and assertion of all audit values.
|
|
423
418
|
|
|
424
419
|
## FAQ
|
|
425
420
|
|
|
@@ -28,19 +28,20 @@ function getFilenamePrefix(name, fetchTime) {
|
|
|
28
28
|
dateParts.unshift(dateParts.pop());
|
|
29
29
|
const dateStr = dateParts.join('-');
|
|
30
30
|
|
|
31
|
-
const filenamePrefix = `${name}_${dateStr}_${timeStr}`;
|
|
31
|
+
const filenamePrefix = `${name.slice(0, 200)}_${dateStr}_${timeStr}`;
|
|
32
32
|
// replace characters that are unfriendly to filenames
|
|
33
33
|
return filenamePrefix.replace(/[/?<>\\:*|"]/g, '-');
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Generate a filenamePrefix of
|
|
37
|
+
* Generate a filenamePrefix of hostname-pathname_YYYY-MM-DD_HH-MM-SS.
|
|
38
38
|
* @param {{finalDisplayedUrl: string, fetchTime: string}} lhr
|
|
39
39
|
* @return {string}
|
|
40
40
|
*/
|
|
41
41
|
function getLhrFilenamePrefix(lhr) {
|
|
42
|
-
const hostname = new URL(lhr.finalDisplayedUrl)
|
|
43
|
-
|
|
42
|
+
const {hostname, pathname} = new URL(lhr.finalDisplayedUrl);
|
|
43
|
+
const name = hostname + pathname.replace(/\/$/, '');
|
|
44
|
+
return getFilenamePrefix(name, lhr.fetchTime);
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
/**
|
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import fs from 'fs';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const moduleDir = getModuleDirectory(import.meta);
|
|
10
|
+
const moduleDir = import.meta.dirname;
|
|
13
11
|
|
|
14
12
|
/* eslint-disable max-len */
|
|
15
13
|
const FLOW_REPORT_TEMPLATE = fs.readFileSync(`${moduleDir}/../../flow-report/assets/standalone-flow-template.html`, 'utf8');
|
|
@@ -8,9 +8,8 @@
|
|
|
8
8
|
import fs from 'fs';
|
|
9
9
|
|
|
10
10
|
import {flowReportAssets} from './flow-report-assets.js';
|
|
11
|
-
import {getModuleDirectory} from '../../shared/esm-utils.js';
|
|
12
11
|
|
|
13
|
-
const moduleDir =
|
|
12
|
+
const moduleDir = import.meta.dirname;
|
|
14
13
|
|
|
15
14
|
const REPORT_TEMPLATE = fs.readFileSync(moduleDir + '/../assets/standalone-template.html',
|
|
16
15
|
'utf8');
|
|
@@ -71,7 +71,7 @@ export class CategoryRenderer {
|
|
|
71
71
|
if (audit.stackPacks) {
|
|
72
72
|
audit.stackPacks.forEach(pack => {
|
|
73
73
|
const packElmImg = this.dom.createElement('img', 'lh-audit__stackpack__img');
|
|
74
|
-
packElmImg
|
|
74
|
+
this.dom.safelySetImageSrc(packElmImg, pack.iconDataURL);
|
|
75
75
|
packElmImg.alt = pack.title;
|
|
76
76
|
|
|
77
77
|
const snippets = this.dom.convertMarkdownLinkSnippets(pack.description, {
|
|
@@ -141,7 +141,7 @@ export class CategoryRenderer {
|
|
|
141
141
|
|
|
142
142
|
const imgEl = this.dom.createElement('img', 'lh-final-ss-image');
|
|
143
143
|
const finalScreenshotDataUri = audit.details.data;
|
|
144
|
-
imgEl
|
|
144
|
+
this.dom.safelySetImageSrc(imgEl, finalScreenshotDataUri);
|
|
145
145
|
imgEl.alt = audit.title;
|
|
146
146
|
|
|
147
147
|
const firstCatHeaderEl = this.dom.find('.lh-category .lh-category-header', categoriesEl);
|
|
@@ -202,7 +202,7 @@ export class DetailsRenderer {
|
|
|
202
202
|
_renderThumbnail(details) {
|
|
203
203
|
const element = this._dom.createElement('img', 'lh-thumbnail');
|
|
204
204
|
const strValue = details;
|
|
205
|
-
element
|
|
205
|
+
this._dom.safelySetImageSrc(element, strValue);
|
|
206
206
|
element.title = strValue;
|
|
207
207
|
element.alt = '';
|
|
208
208
|
return element;
|
|
@@ -429,6 +429,7 @@ export class DetailsRenderer {
|
|
|
429
429
|
this._dom.safelySetHref(entityLinkEl, matchedEntity.homepage);
|
|
430
430
|
if (entityLinkEl.href) {
|
|
431
431
|
entityLinkEl.target = '_blank';
|
|
432
|
+
entityLinkEl.rel = 'noopener';
|
|
432
433
|
entityLinkEl.title = Globals.strings.openInANewTabTooltip;
|
|
433
434
|
entityLinkEl.classList.add('lh-report-icon--external');
|
|
434
435
|
firstTdEl.append(' ', entityLinkEl);
|
|
@@ -735,7 +736,7 @@ export class DetailsRenderer {
|
|
|
735
736
|
for (const thumbnail of details.items) {
|
|
736
737
|
const frameEl = this._dom.createChildOf(filmstripEl, 'div', 'lh-filmstrip__frame');
|
|
737
738
|
const imgEl = this._dom.createChildOf(frameEl, 'img', 'lh-filmstrip__thumbnail');
|
|
738
|
-
imgEl
|
|
739
|
+
this._dom.safelySetImageSrc(imgEl, thumbnail.data);
|
|
739
740
|
imgEl.alt = `Screenshot`;
|
|
740
741
|
}
|
|
741
742
|
return filmstripEl;
|
package/report/renderer/dom.d.ts
CHANGED
|
@@ -68,15 +68,21 @@ export class DOM {
|
|
|
68
68
|
* Set link href, but safely, preventing `javascript:` protocol, etc.
|
|
69
69
|
* @see https://github.com/google/safevalues/
|
|
70
70
|
* @param {HTMLAnchorElement} elem
|
|
71
|
-
* @param {string} url
|
|
71
|
+
* @param {string|undefined} url
|
|
72
72
|
*/
|
|
73
|
-
safelySetHref(elem: HTMLAnchorElement, url: string): void;
|
|
73
|
+
safelySetHref(elem: HTMLAnchorElement, url: string | undefined): void;
|
|
74
74
|
/**
|
|
75
75
|
* Only create blob URLs for JSON & HTML
|
|
76
76
|
* @param {HTMLAnchorElement} elem
|
|
77
77
|
* @param {Blob} blob
|
|
78
78
|
*/
|
|
79
79
|
safelySetBlobHref(elem: HTMLAnchorElement, blob: Blob): void;
|
|
80
|
+
/**
|
|
81
|
+
* Set img src, but safely, only allowing `https:`, `http:`, and `data:image/`.
|
|
82
|
+
* @param {HTMLImageElement} elem
|
|
83
|
+
* @param {string} url
|
|
84
|
+
*/
|
|
85
|
+
safelySetImageSrc(elem: HTMLImageElement, url: string): void;
|
|
80
86
|
/**
|
|
81
87
|
* @param {string} markdownText
|
|
82
88
|
* @return {Element}
|
package/report/renderer/dom.js
CHANGED
|
@@ -169,7 +169,7 @@ export class DOM {
|
|
|
169
169
|
* Set link href, but safely, preventing `javascript:` protocol, etc.
|
|
170
170
|
* @see https://github.com/google/safevalues/
|
|
171
171
|
* @param {HTMLAnchorElement} elem
|
|
172
|
-
* @param {string} url
|
|
172
|
+
* @param {string|undefined} url
|
|
173
173
|
*/
|
|
174
174
|
safelySetHref(elem, url) {
|
|
175
175
|
// Defaults to '' to fix proto roundtrip issue. See https://github.com/GoogleChrome/lighthouse/issues/12868
|
|
@@ -189,6 +189,8 @@ export class DOM {
|
|
|
189
189
|
|
|
190
190
|
if (parsed && allowedProtocols.includes(parsed.protocol)) {
|
|
191
191
|
elem.href = parsed.href;
|
|
192
|
+
} else {
|
|
193
|
+
elem.removeAttribute('href');
|
|
192
194
|
}
|
|
193
195
|
}
|
|
194
196
|
|
|
@@ -205,6 +207,32 @@ export class DOM {
|
|
|
205
207
|
elem.href = href;
|
|
206
208
|
}
|
|
207
209
|
|
|
210
|
+
/**
|
|
211
|
+
* Set img src, but safely, only allowing `https:`, `http:`, and `data:image/`.
|
|
212
|
+
* @param {HTMLImageElement} elem
|
|
213
|
+
* @param {string} url
|
|
214
|
+
*/
|
|
215
|
+
safelySetImageSrc(elem, url) {
|
|
216
|
+
url = url || '';
|
|
217
|
+
|
|
218
|
+
if (url.startsWith('data:image/')) {
|
|
219
|
+
elem.src = url;
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const allowedProtocols = ['https:', 'http:'];
|
|
224
|
+
let parsed;
|
|
225
|
+
try {
|
|
226
|
+
parsed = new URL(url);
|
|
227
|
+
} catch (_) {}
|
|
228
|
+
|
|
229
|
+
if (parsed && allowedProtocols.includes(parsed.protocol)) {
|
|
230
|
+
elem.src = parsed.href;
|
|
231
|
+
} else {
|
|
232
|
+
elem.removeAttribute('src');
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
208
236
|
/**
|
|
209
237
|
* @param {string} markdownText
|
|
210
238
|
* @return {Element}
|
|
@@ -134,6 +134,9 @@ export class ElementScreenshotRenderer {
|
|
|
134
134
|
* @param {LH.Result.FullPageScreenshot['screenshot']} screenshot
|
|
135
135
|
*/
|
|
136
136
|
static installFullPageScreenshot(el, screenshot) {
|
|
137
|
+
if (!screenshot.data.startsWith('data:image/') || /['"()\\\r\n]/.test(screenshot.data)) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
137
140
|
el.style.setProperty('--element-screenshot-url', `url('${screenshot.data}')`);
|
|
138
141
|
}
|
|
139
142
|
|
|
@@ -183,6 +183,7 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
|
|
|
183
183
|
// Add link to score calculator.
|
|
184
184
|
const calculatorLink = this.dom.createChildOf(estValuesEl, 'a', 'lh-calclink');
|
|
185
185
|
calculatorLink.target = '_blank';
|
|
186
|
+
calculatorLink.rel = 'noopener';
|
|
186
187
|
calculatorLink.textContent = strings.calculatorLink;
|
|
187
188
|
this.dom.safelySetHref(calculatorLink, this._getScoringCalculatorHref(category.auditRefs));
|
|
188
189
|
}
|
|
@@ -226,7 +227,8 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
|
|
|
226
227
|
* @return {Element|null}
|
|
227
228
|
*/
|
|
228
229
|
renderFilterableSection(category, groups, groupNames, metricAudits) {
|
|
229
|
-
|
|
230
|
+
groupNames = groupNames.filter(groupName => Boolean(groups[groupName]));
|
|
231
|
+
if (!groupNames.length) return null;
|
|
230
232
|
|
|
231
233
|
const element = this.dom.createElement('div');
|
|
232
234
|
|
|
@@ -119,6 +119,7 @@ export class ReportRenderer {
|
|
|
119
119
|
const channel = report.configSettings.channel;
|
|
120
120
|
const benchmarkIndex = report.environment.benchmarkIndex.toFixed(0);
|
|
121
121
|
const axeVersion = report.environment.credits?.['axe-core'];
|
|
122
|
+
const ardVersion = report.environment.credits?.['ard'];
|
|
122
123
|
|
|
123
124
|
const devicesTooltipTextLines = [
|
|
124
125
|
`${Globals.strings.runtimeSettingsBenchmark}: ${benchmarkIndex}`,
|
|
@@ -131,6 +132,9 @@ export class ReportRenderer {
|
|
|
131
132
|
if (axeVersion) {
|
|
132
133
|
devicesTooltipTextLines.push(`${Globals.strings.runtimeSettingsAxeVersion}: ${axeVersion}`);
|
|
133
134
|
}
|
|
135
|
+
if (ardVersion) {
|
|
136
|
+
devicesTooltipTextLines.push(`${Globals.strings.runtimeSettingsArdVersion}: ${ardVersion}`);
|
|
137
|
+
}
|
|
134
138
|
|
|
135
139
|
let stopwatchLabel = Globals.strings.runtimeAnalysisWindow;
|
|
136
140
|
if (report.gatherMode === 'timespan') {
|
|
@@ -116,6 +116,7 @@ export namespace UIStrings {
|
|
|
116
116
|
let runtimeSettingsUANetwork: string;
|
|
117
117
|
let runtimeSettingsBenchmark: string;
|
|
118
118
|
let runtimeSettingsAxeVersion: string;
|
|
119
|
+
let runtimeSettingsArdVersion: string;
|
|
119
120
|
let runtimeSettingsScreenEmulation: string;
|
|
120
121
|
let footerIssue: string;
|
|
121
122
|
let runtimeNoEmulation: string;
|
|
@@ -441,6 +441,8 @@ const UIStrings = {
|
|
|
441
441
|
runtimeSettingsBenchmark: 'Unthrottled CPU/Memory Power',
|
|
442
442
|
/** Label for a row in a table that shows the version of the Axe library used. Example row values: 2.1.0, 3.2.3 */
|
|
443
443
|
runtimeSettingsAxeVersion: 'Axe version',
|
|
444
|
+
/** Label for a row in a table that shows the version of the Agentic Resource Discovery (ARD) specification used. "ARD" should not be translated. Example row values: 0.91 (f073b1e), 1.0 (a1b2c3d) */
|
|
445
|
+
runtimeSettingsArdVersion: 'ARD version',
|
|
444
446
|
/** Label for a row in a table that shows the screen resolution and DPR that was emulated for the Lighthouse run. Example values: '800x600, DPR: 3' */
|
|
445
447
|
runtimeSettingsScreenEmulation: 'Screen emulation',
|
|
446
448
|
|
|
@@ -36,7 +36,7 @@ async function toBase64(string, options) {
|
|
|
36
36
|
} else {
|
|
37
37
|
/** @type {typeof import('pako')=} */
|
|
38
38
|
const pako = window.pako;
|
|
39
|
-
bytes =
|
|
39
|
+
bytes = pako.gzip(string);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -62,7 +62,7 @@ function fromBase64(encoded, options) {
|
|
|
62
62
|
if (options.gzip) {
|
|
63
63
|
/** @type {typeof import('pako')=} */
|
|
64
64
|
const pako = window.pako;
|
|
65
|
-
return pako.ungzip(bytes, {
|
|
65
|
+
return pako.ungzip(bytes, {toText: true});
|
|
66
66
|
} else {
|
|
67
67
|
return new TextDecoder().decode(bytes);
|
|
68
68
|
}
|
package/shared/esm-utils.d.ts
CHANGED
|
@@ -3,12 +3,4 @@
|
|
|
3
3
|
* @param {string} packageName
|
|
4
4
|
*/
|
|
5
5
|
export function resolveModulePath(packageName: string): string;
|
|
6
|
-
/**
|
|
7
|
-
* @param {ImportMeta} importMeta
|
|
8
|
-
*/
|
|
9
|
-
export function getModulePath(importMeta: ImportMeta): string;
|
|
10
|
-
/**
|
|
11
|
-
* @param {ImportMeta} importMeta
|
|
12
|
-
*/
|
|
13
|
-
export function getModuleDirectory(importMeta: ImportMeta): string;
|
|
14
6
|
//# sourceMappingURL=esm-utils.d.ts.map
|
package/shared/esm-utils.js
CHANGED
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {createRequire} from 'module';
|
|
8
|
-
import url from 'url';
|
|
9
|
-
import path from 'path';
|
|
10
8
|
|
|
11
9
|
/**
|
|
12
10
|
* Commonjs equivalent of `require.resolve`.
|
|
@@ -17,22 +15,6 @@ function resolveModulePath(packageName) {
|
|
|
17
15
|
return require.resolve(packageName);
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
/**
|
|
21
|
-
* @param {ImportMeta} importMeta
|
|
22
|
-
*/
|
|
23
|
-
function getModulePath(importMeta) {
|
|
24
|
-
return url.fileURLToPath(importMeta.url);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @param {ImportMeta} importMeta
|
|
29
|
-
*/
|
|
30
|
-
function getModuleDirectory(importMeta) {
|
|
31
|
-
return path.dirname(getModulePath(importMeta));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
18
|
export {
|
|
35
19
|
resolveModulePath,
|
|
36
|
-
getModulePath,
|
|
37
|
-
getModuleDirectory,
|
|
38
20
|
};
|