lighthouse 13.2.0 → 13.4.0-dev.20260625
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/lighthouse-verification/SKILL.md +23 -0
- package/cli/cli-flags.d.ts +8 -9
- package/cli/cli-flags.js +2 -2
- package/cli/test/smokehouse/config/exclusions.js +2 -0
- package/cli/test/smokehouse/lighthouse-runners/bundle.js +7 -3
- package/cli/test/smokehouse/lighthouse-runners/cli.js +5 -1
- package/cli/test/smokehouse/lighthouse-runners/devtools-mcp.js +7 -3
- package/cli/test/smokehouse/lighthouse-runners/devtools.js +4 -1
- package/cli/test/smokehouse/smokehouse.js +7 -2
- package/cli/test/smokehouse/version-check.d.ts +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/agent-accessibility-tree.js +1 -1
- package/core/audits/agentic/llms-txt.d.ts +1 -0
- package/core/audits/agentic/llms-txt.js +23 -10
- package/core/audits/baseline.js +10 -12
- package/core/audits/dobetterweb/geolocation-on-start.js +2 -1
- package/core/audits/network-requests.js +2 -0
- package/core/audits/seo/canonical.js +19 -7
- package/core/audits/seo/robots-txt.d.ts +1 -0
- package/core/audits/seo/robots-txt.js +22 -8
- package/core/audits/webmcp-form-coverage.js +2 -2
- package/core/audits/webmcp-registered-tools.js +1 -1
- package/core/audits/webmcp-schema-validity.js +1 -1
- package/core/computed/js-bundles.d.ts +1 -1
- package/core/computed/load-simulator.d.ts +1 -1
- package/core/computed/metrics/first-contentful-paint-all-frames.d.ts +1 -1
- package/core/computed/metrics/first-contentful-paint.d.ts +1 -1
- package/core/computed/metrics/interactive.d.ts +1 -1
- package/core/computed/metrics/lantern-metric.d.ts +6 -6
- package/core/computed/metrics/largest-contentful-paint-all-frames.d.ts +1 -1
- package/core/computed/metrics/largest-contentful-paint.d.ts +1 -1
- package/core/computed/metrics/max-potential-fid.d.ts +1 -1
- package/core/computed/metrics/speed-index.d.ts +1 -1
- package/core/computed/metrics/time-to-first-byte.d.ts +1 -1
- package/core/computed/metrics/total-blocking-time.d.ts +1 -1
- package/core/computed/module-duplication.d.ts +1 -1
- package/core/computed/page-dependency-graph.d.ts +1 -1
- package/core/computed/unused-css.d.ts +1 -1
- package/core/config/agentic-browsing-config.d.ts +1 -0
- package/core/config/agentic-browsing-config.js +3 -2
- package/core/config/config-helpers.d.ts +1 -0
- package/core/config/config-helpers.js +1 -1
- package/core/config/config-plugin.d.ts +1 -0
- package/core/config/config-plugin.js +1 -0
- package/core/config/config.d.ts +1 -0
- package/core/config/config.js +1 -0
- package/core/config/constants.d.ts +1 -0
- package/core/config/constants.js +1 -0
- package/core/config/default-config.js +45 -0
- package/core/config/experimental-config.d.ts +1 -9
- package/core/config/experimental-config.js +2 -0
- package/core/config/filters.d.ts +1 -0
- package/core/config/filters.js +1 -0
- package/core/config/full-config.d.ts +1 -5
- package/core/config/full-config.js +2 -0
- package/core/config/lr-desktop-config.d.ts +1 -0
- package/core/config/lr-desktop-config.js +1 -0
- package/core/config/lr-mobile-config.d.ts +1 -5
- package/core/config/lr-mobile-config.js +2 -0
- package/core/config/perf-config.d.ts +1 -5
- package/core/config/perf-config.js +2 -0
- package/core/config/validation.d.ts +1 -0
- package/core/config/validation.js +1 -0
- package/core/gather/driver/execution-context.d.ts +23 -0
- package/core/gather/driver/execution-context.js +86 -1
- package/core/gather/driver/storage.js +13 -0
- package/core/gather/driver.d.ts +1 -1
- package/core/gather/gatherers/accessibility.js +1 -0
- package/core/gather/gatherers/agentic/llms-txt.js +5 -1
- package/core/gather/gatherers/seo/robots-txt.js +6 -1
- package/core/gather/gatherers/trace-elements.d.ts +4 -1
- package/core/gather/gatherers/trace-elements.js +24 -28
- package/core/gather/gatherers/webmcp-schema.js +9 -16
- package/core/gather/gatherers/webmcp.d.ts +5 -0
- package/core/gather/gatherers/webmcp.js +34 -27
- package/core/index.d.ts +0 -1
- package/core/index.js +0 -1
- package/core/lib/baseline/web-features-data.json +1179 -0
- package/core/lib/baseline/web-features-metadata.json +1 -1
- package/core/lib/deprecations-strings.d.ts +117 -87
- package/core/lib/deprecations-strings.js +31 -0
- package/core/lib/script-helpers.js +13 -1
- package/core/scoring.d.ts +58 -58
- package/dist/report/bundle.esm.js +4 -7
- package/dist/report/flow.js +6 -9
- package/dist/report/standalone.js +20 -12
- package/flow-report/types/flow-report.d.ts +2 -2
- package/package.json +31 -31
- package/report/assets/styles.css +1 -4
- package/report/renderer/components.js +1 -1
- package/report/renderer/details-renderer.d.ts +6 -1
- package/report/renderer/details-renderer.js +11 -3
- package/report/renderer/explodey-gauge.js +9 -7
- package/report/renderer/i18n-formatter.d.ts +1 -1
- package/report/renderer/logger.js +18 -4
- package/report/renderer/text-encoding.js +1 -1
- package/report/types/html-renderer.d.ts +2 -2
- package/shared/localization/locales/ar-XB.json +290 -65
- package/shared/localization/locales/ar.json +290 -65
- package/shared/localization/locales/bg.json +290 -65
- package/shared/localization/locales/ca.json +295 -70
- package/shared/localization/locales/cs.json +290 -65
- package/shared/localization/locales/da.json +294 -69
- package/shared/localization/locales/de.json +295 -70
- package/shared/localization/locales/el.json +290 -65
- package/shared/localization/locales/en-GB.json +290 -65
- package/shared/localization/locales/en-US.json +112 -76
- package/shared/localization/locales/en-XA.json +253 -64
- package/shared/localization/locales/en-XL.json +112 -76
- package/shared/localization/locales/es-419.json +290 -65
- package/shared/localization/locales/es.json +298 -73
- package/shared/localization/locales/fi.json +290 -65
- package/shared/localization/locales/fil.json +290 -65
- package/shared/localization/locales/fr.json +294 -69
- package/shared/localization/locales/he.json +293 -68
- package/shared/localization/locales/hi.json +291 -66
- package/shared/localization/locales/hr.json +290 -65
- package/shared/localization/locales/hu.json +290 -65
- package/shared/localization/locales/id.json +290 -65
- package/shared/localization/locales/it.json +294 -69
- package/shared/localization/locales/ja.json +290 -65
- package/shared/localization/locales/ko.json +290 -65
- package/shared/localization/locales/lt.json +290 -65
- package/shared/localization/locales/lv.json +290 -65
- package/shared/localization/locales/nl.json +290 -65
- package/shared/localization/locales/no.json +290 -65
- package/shared/localization/locales/pl.json +290 -65
- package/shared/localization/locales/pt-PT.json +291 -66
- package/shared/localization/locales/pt.json +290 -65
- package/shared/localization/locales/ro.json +290 -65
- package/shared/localization/locales/ru.json +301 -76
- package/shared/localization/locales/sk.json +291 -66
- package/shared/localization/locales/sl.json +290 -65
- package/shared/localization/locales/sr-Latn.json +290 -65
- package/shared/localization/locales/sr.json +290 -65
- package/shared/localization/locales/sv.json +297 -72
- package/shared/localization/locales/ta.json +291 -66
- package/shared/localization/locales/te.json +293 -68
- package/shared/localization/locales/th.json +291 -66
- package/shared/localization/locales/tr.json +290 -65
- package/shared/localization/locales/uk.json +290 -65
- package/shared/localization/locales/vi.json +291 -66
- package/shared/localization/locales/zh-HK.json +292 -67
- package/shared/localization/locales/zh-TW.json +291 -66
- package/shared/localization/locales/zh.json +291 -66
- package/shared/types/shared.d.ts +1 -1
- package/tsconfig-base.json +2 -1
- package/tsconfig.json +2 -0
- package/types/artifacts.d.ts +1 -1
- package/types/internal/rxjs.d.ts +1 -1
- package/types/internal/smokehouse.d.ts +8 -2
- package/types.d.ts +2 -0
- package/types.js +11 -0
|
@@ -18,7 +18,7 @@ const UIStrings = {
|
|
|
18
18
|
/** Title of an accessibility audit that checks if heading elements (<h1>, <h2>, etc) appear in numeric order and only ever increase in steps of 1. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
|
|
19
19
|
failureTitle: 'Heading elements are not in a sequentially-descending order',
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
|
-
description: 'Properly ordered headings that do not skip levels convey the semantic structure of the page, making it easier to navigate and understand when using assistive technologies. [Learn more about heading order](https://dequeuniversity.com/rules/axe/4.
|
|
21
|
+
description: 'Properly ordered headings that do not skip levels convey the semantic structure of the page, making it easier to navigate and understand when using assistive technologies. [Learn more about heading order](https://dequeuniversity.com/rules/axe/4.12/heading-order).',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -22,7 +22,7 @@ const UIStrings = {
|
|
|
22
22
|
'that the page is in the default language that the user chose when setting up the ' +
|
|
23
23
|
'screen reader. If the page isn\'t actually in the default language, then the screen ' +
|
|
24
24
|
'reader might not announce the page\'s text correctly. ' +
|
|
25
|
-
'[Learn more about the `lang` attribute](https://dequeuniversity.com/rules/axe/4.
|
|
25
|
+
'[Learn more about the `lang` attribute](https://dequeuniversity.com/rules/axe/4.12/html-has-lang).',
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
22
22
|
description: 'Specifying a valid [BCP 47 language](https://www.w3.org/International/questions/qa-choosing-language-tags#question) ' +
|
|
23
23
|
'helps screen readers announce text properly. ' +
|
|
24
|
-
'[Learn how to use the `lang` attribute](https://dequeuniversity.com/rules/axe/4.
|
|
24
|
+
'[Learn how to use the `lang` attribute](https://dequeuniversity.com/rules/axe/4.12/html-lang-valid).',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -23,7 +23,7 @@ const UIStrings = {
|
|
|
23
23
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
24
24
|
description: 'If the webpage does not specify a consistent language, then the screen ' +
|
|
25
25
|
'reader might not announce the page\'s text correctly. ' +
|
|
26
|
-
'[Learn more about the `lang` attribute](https://dequeuniversity.com/rules/axe/4.
|
|
26
|
+
'[Learn more about the `lang` attribute](https://dequeuniversity.com/rules/axe/4.12/html-xml-lang-mismatch).',
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Links with the same destination should have the same description, to help users ' +
|
|
22
22
|
'understand the link\'s purpose and decide whether to follow it. ' +
|
|
23
|
-
'[Learn more about identical links](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn more about identical links](https://dequeuniversity.com/rules/axe/4.12/identical-links-same-purpose).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Informative elements should aim for short, descriptive alternate text. ' +
|
|
22
22
|
'Decorative elements can be ignored with an empty alt attribute. ' +
|
|
23
|
-
'[Learn more about the `alt` attribute](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn more about the `alt` attribute](https://dequeuniversity.com/rules/axe/4.12/image-alt).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
description: 'Informative elements should aim for short, descriptive alternative text. ' +
|
|
22
22
|
'Alternative text that is exactly the same as the text adjacent to the link or image is ' +
|
|
23
23
|
'potentially confusing for screen reader users, because the text will be read twice. ' +
|
|
24
|
-
'[Learn more about the `alt` attribute](https://dequeuniversity.com/rules/axe/4.
|
|
24
|
+
'[Learn more about the `alt` attribute](https://dequeuniversity.com/rules/axe/4.12/image-redundant-alt).',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Adding discernable and accessible text to input buttons may help screen reader ' +
|
|
22
22
|
'users understand the purpose of the input button. ' +
|
|
23
|
-
'[Learn more about input buttons](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn more about input buttons](https://dequeuniversity.com/rules/axe/4.12/input-button-name).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'When an image is being used as an `<input>` button, providing alternative ' +
|
|
22
22
|
'text can help screen reader users understand the purpose of the button. ' +
|
|
23
|
-
'[Learn about input image alt text](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn about input image alt text](https://dequeuniversity.com/rules/axe/4.12/input-image-alt).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Visible text labels that do not match the accessible name can result in a ' +
|
|
22
22
|
'confusing experience for screen reader users. ' +
|
|
23
|
-
'[Learn more about accessible names](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn more about accessible names](https://dequeuniversity.com/rules/axe/4.12/label-content-name-mismatch).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Labels ensure that form controls are announced properly by assistive ' +
|
|
22
22
|
'technologies, like screen readers. [Learn ' +
|
|
23
|
-
'more about form element labels](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'more about form element labels](https://dequeuniversity.com/rules/axe/4.12/label).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -19,7 +19,7 @@ const UIStrings = {
|
|
|
19
19
|
failureTitle: 'Document does not have a main landmark.',
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'One main landmark helps screen reader users navigate a web page. ' +
|
|
22
|
-
'[Learn more about landmarks](https://dequeuniversity.com/rules/axe/4.
|
|
22
|
+
'[Learn more about landmarks](https://dequeuniversity.com/rules/axe/4.12/landmark-one-main).',
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Low-contrast text is difficult or impossible for many users to read. Link text ' +
|
|
22
22
|
'that is discernible improves the experience for users with low vision. ' +
|
|
23
|
-
'[Learn how to make links distinguishable](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn how to make links distinguishable](https://dequeuniversity.com/rules/axe/4.12/link-in-text-block).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
description: 'Link text (and alternate text for images, when used as links) that is ' +
|
|
22
22
|
'discernible, unique, and focusable improves the navigation experience for ' +
|
|
23
23
|
'screen reader users. ' +
|
|
24
|
-
'[Learn how to make links accessible](https://dequeuniversity.com/rules/axe/4.
|
|
24
|
+
'[Learn how to make links accessible](https://dequeuniversity.com/rules/axe/4.12/link-name).',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -22,7 +22,7 @@ const UIStrings = {
|
|
|
22
22
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
23
23
|
description: 'Screen readers have a specific way of announcing lists. Ensuring proper list ' +
|
|
24
24
|
'structure aids screen reader output. ' +
|
|
25
|
-
'[Learn more about proper list structure](https://dequeuniversity.com/rules/axe/4.
|
|
25
|
+
'[Learn more about proper list structure](https://dequeuniversity.com/rules/axe/4.12/list).',
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
22
22
|
description: 'Screen readers require list items (`<li>`) to be contained within a ' +
|
|
23
23
|
'parent `<ul>`, `<ol>` or `<menu>` to be announced properly. ' +
|
|
24
|
-
'[Learn more about proper list structure](https://dequeuniversity.com/rules/axe/4.
|
|
24
|
+
'[Learn more about proper list structure](https://dequeuniversity.com/rules/axe/4.12/listitem).',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
description: 'Users do not expect a page to refresh automatically, and doing so will move ' +
|
|
22
22
|
'focus back to the top of the page. This may create a frustrating or ' +
|
|
23
23
|
'confusing experience. ' +
|
|
24
|
-
'[Learn more about the refresh meta tag](https://dequeuniversity.com/rules/axe/4.
|
|
24
|
+
'[Learn more about the refresh meta tag](https://dequeuniversity.com/rules/axe/4.12/meta-refresh).',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -22,7 +22,7 @@ const UIStrings = {
|
|
|
22
22
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
23
23
|
description: 'Disabling zooming is problematic for users with low vision who rely on ' +
|
|
24
24
|
'screen magnification to properly see the contents of a web page. ' +
|
|
25
|
-
'[Learn more about the viewport meta tag](https://dequeuniversity.com/rules/axe/4.
|
|
25
|
+
'[Learn more about the viewport meta tag](https://dequeuniversity.com/rules/axe/4.12/meta-viewport).',
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Screen readers cannot translate non-text content. Adding alternate text to ' +
|
|
22
22
|
'`<object>` elements helps screen readers convey meaning to users. ' +
|
|
23
|
-
'[Learn more about alt text for `object` elements](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn more about alt text for `object` elements](https://dequeuniversity.com/rules/axe/4.12/object-alt).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -22,7 +22,7 @@ const UIStrings = {
|
|
|
22
22
|
'or `role="presentation"` does not resolve to none or presentation. To ensure the ' +
|
|
23
23
|
'element remains removed from the accessibility tree, you should not add any global ' +
|
|
24
24
|
'ARIA attributes to the element or make it focusable. ' +
|
|
25
|
-
'[Learn more about presentation role conflict](https://dequeuniversity.com/rules/axe/4.
|
|
25
|
+
'[Learn more about presentation role conflict](https://dequeuniversity.com/rules/axe/4.12/presentation-role-conflict).',
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Form elements without effective labels can create frustrating experiences ' +
|
|
22
22
|
'for screen reader users. ' +
|
|
23
|
-
'[Learn more about the `select` element](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn more about the `select` element](https://dequeuniversity.com/rules/axe/4.12/select-name).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -19,7 +19,7 @@ const UIStrings = {
|
|
|
19
19
|
failureTitle: 'Skip links are not focusable.',
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Including a skip link can help users skip to the main content to save time. ' +
|
|
22
|
-
'[Learn more about skip links](https://dequeuniversity.com/rules/axe/4.
|
|
22
|
+
'[Learn more about skip links](https://dequeuniversity.com/rules/axe/4.12/skip-link).',
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with \'Learn\' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Ensures SVG elements with an `img`, `graphics-document` or `graphics-symbol` ' +
|
|
22
22
|
'role have an accessible text alternative. ' +
|
|
23
|
-
'[Learn more about SVG alt text](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn more about SVG alt text](https://dequeuniversity.com/rules/axe/4.12/svg-img-alt).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'A value greater than 0 implies an explicit navigation ordering. ' +
|
|
22
22
|
'Although technically valid, this often creates frustrating experiences ' +
|
|
23
|
-
'for users who rely on assistive technologies. [Learn more about the `tabindex` attribute](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'for users who rely on assistive technologies. [Learn more about the `tabindex` attribute](https://dequeuniversity.com/rules/axe/4.12/tabindex).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'The summary attribute should describe the table structure, while `<caption>` ' +
|
|
22
22
|
'should have the onscreen title. Accurate table mark-up helps users of screen readers. ' +
|
|
23
|
-
'[Learn more about summary and caption](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn more about summary and caption](https://dequeuniversity.com/rules/axe/4.12/table-duplicate-name).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -23,7 +23,7 @@ const UIStrings = {
|
|
|
23
23
|
description: 'Screen readers have features to make navigating tables easier. Ensuring ' +
|
|
24
24
|
'that tables use the actual caption element instead of cells with the `[colspan]` ' +
|
|
25
25
|
'attribute may improve the experience for screen reader users. ' +
|
|
26
|
-
'[Learn more about captions](https://dequeuniversity.com/rules/axe/4.
|
|
26
|
+
'[Learn more about captions](https://dequeuniversity.com/rules/axe/4.12/table-fake-caption).',
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Touch targets with sufficient size and spacing help users who may have ' +
|
|
22
22
|
'difficulty targeting small controls to activate the targets. ' +
|
|
23
|
-
'[Learn more about touch targets](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn more about touch targets](https://dequeuniversity.com/rules/axe/4.12/target-size).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
description: 'Screen readers have features to make navigating tables easier. Ensuring ' +
|
|
22
22
|
'that `<td>` elements in a large table (3 or more cells in width and height) have an ' +
|
|
23
23
|
'associated table header may improve the experience for screen reader users. ' +
|
|
24
|
-
'[Learn more about table headers](https://dequeuniversity.com/rules/axe/4.
|
|
24
|
+
'[Learn more about table headers](https://dequeuniversity.com/rules/axe/4.12/td-has-header).',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -24,7 +24,7 @@ const UIStrings = {
|
|
|
24
24
|
description: 'Screen readers have features to make navigating tables easier. Ensuring ' +
|
|
25
25
|
'`<td>` cells using the `[headers]` attribute only refer to other cells in the same ' +
|
|
26
26
|
'table may improve the experience for screen reader users. ' +
|
|
27
|
-
'[Learn more about the `headers` attribute](https://dequeuniversity.com/rules/axe/4.
|
|
27
|
+
'[Learn more about the `headers` attribute](https://dequeuniversity.com/rules/axe/4.12/td-headers-attr).',
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -23,7 +23,7 @@ const UIStrings = {
|
|
|
23
23
|
description: 'Screen readers have features to make navigating tables easier. Ensuring ' +
|
|
24
24
|
'table headers always refer to some set of cells may improve the experience for screen ' +
|
|
25
25
|
'reader users. ' +
|
|
26
|
-
'[Learn more about table headers](https://dequeuniversity.com/rules/axe/4.
|
|
26
|
+
'[Learn more about table headers](https://dequeuniversity.com/rules/axe/4.12/th-has-data-cells).',
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Specifying a valid [BCP 47 language](https://www.w3.org/International/questions/qa-choosing-language-tags#question) ' +
|
|
22
22
|
'on elements helps ensure that text is pronounced correctly by a screen reader. ' +
|
|
23
|
-
'[Learn how to use the `lang` attribute](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn how to use the `lang` attribute](https://dequeuniversity.com/rules/axe/4.12/valid-lang).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
22
22
|
description: 'When a video provides a caption it is easier for deaf and hearing impaired ' +
|
|
23
23
|
'users to access its information. ' +
|
|
24
|
-
'[Learn more about video captions](https://dequeuniversity.com/rules/axe/4.
|
|
24
|
+
'[Learn more about video captions](https://dequeuniversity.com/rules/axe/4.12/video-caption).',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -13,7 +13,7 @@ const UIStrings = {
|
|
|
13
13
|
/** Title shown when one or more agent accessibility checks fail. */
|
|
14
14
|
failureTitle: 'Accessibility tree is not well-formed',
|
|
15
15
|
/** Description of a Lighthouse audit that tells the user *why* they need a well-formed accessibility tree. */
|
|
16
|
-
description: 'A well-formed accessibility tree helps AI agents to ' +
|
|
16
|
+
description: 'A well-formed [accessibility tree](http://goo.gle/lighthouse-agentic-a11y) helps AI agents to ' +
|
|
17
17
|
'navigate and interact with the page.',
|
|
18
18
|
/** Label of a table column that identifies the accessibility rule that failed. */
|
|
19
19
|
columnRule: 'Failing Rule',
|
|
@@ -11,20 +11,25 @@ const HTTP_CLIENT_ERROR_CODE_LOW = 400;
|
|
|
11
11
|
const HTTP_SERVER_ERROR_CODE_LOW = 500;
|
|
12
12
|
|
|
13
13
|
const UIStrings = {
|
|
14
|
-
/** Title of a Lighthouse audit that provides detail on the site's llms.txt file. Note: "llms.txt" is a canonical filename and should not be translated. This descriptive title is shown when the llms.txt file
|
|
15
|
-
title: 'llms.txt
|
|
16
|
-
/** Title of a Lighthouse audit that provides detail on the site's llms.txt file. Note: "llms.txt" is a canonical filename and should not be translated. This descriptive title is shown when the llms.txt file
|
|
17
|
-
failureTitle: 'llms.txt
|
|
18
|
-
/** Description of a Lighthouse audit that tells the user *why* they
|
|
19
|
-
description: 'If your llms.txt file
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'[
|
|
14
|
+
/** Title of a Lighthouse audit that provides detail on the site's llms.txt file. Note: "llms.txt" is a canonical filename and should not be translated. This descriptive title is shown when the llms.txt file follows community recommendations. */
|
|
15
|
+
title: 'llms.txt follows recommendations',
|
|
16
|
+
/** Title of a Lighthouse audit that provides detail on the site's llms.txt file. Note: "llms.txt" is a canonical filename and should not be translated. This descriptive title is shown when the llms.txt file does not follow community recommendations. */
|
|
17
|
+
failureTitle: 'llms.txt does not follow recommendations',
|
|
18
|
+
/** Description of a Lighthouse audit that tells the user *why* they should have an llms.txt file. Note: "llms.txt" is a canonical filename and should not be translated. This is displayed after a user expands the section to see more. No character length limits. */
|
|
19
|
+
description: 'If your llms.txt file does not follow recommendations, ' +
|
|
20
|
+
'large language models may not be able to ' +
|
|
21
|
+
'understand how you want your website to be crawled or used for training. The ' +
|
|
22
|
+
'[llms.txt](https://llmstxt.org/) file should be a Markdown file containing at least one H1 header.',
|
|
23
23
|
/**
|
|
24
24
|
* @description Label for the audit identifying that the request failed with a specific HTTP status code.
|
|
25
25
|
* @example {500} statusCode
|
|
26
26
|
* */
|
|
27
27
|
displayValueHttpBadCode: 'Failed with HTTP status {statusCode}',
|
|
28
|
+
/**
|
|
29
|
+
* @description Explanatory message stating that there was a failure in an audit caused by Lighthouse not being able to download the llms.txt file for the site. Note: "llms.txt" is a canonical filename and should not be translated.
|
|
30
|
+
* @example {Timed out fetching resource} error
|
|
31
|
+
* */
|
|
32
|
+
explanationWithError: 'Fetch of llms.txt failed: {error}',
|
|
28
33
|
/** Explanatory message stating that there was a failure in an audit caused by Lighthouse not being able to download the llms.txt file for the site. Note: "llms.txt" is a canonical filename and should not be translated. */
|
|
29
34
|
explanation: 'Fetch of llms.txt failed',
|
|
30
35
|
/** Message indicating that the file is missing a required H1 header. */
|
|
@@ -59,8 +64,16 @@ class LlmsTxt extends Audit {
|
|
|
59
64
|
const {
|
|
60
65
|
status,
|
|
61
66
|
content,
|
|
67
|
+
errorMessage,
|
|
62
68
|
} = artifacts.LlmsTxt;
|
|
63
69
|
|
|
70
|
+
if (errorMessage) {
|
|
71
|
+
return {
|
|
72
|
+
score: 0,
|
|
73
|
+
explanation: str_(UIStrings.explanationWithError, {error: errorMessage}),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
64
77
|
if (!status) {
|
|
65
78
|
return {
|
|
66
79
|
score: 0,
|
|
@@ -84,7 +97,7 @@ class LlmsTxt extends Audit {
|
|
|
84
97
|
throw new Error(`Status ${status} was valid, but content was null`);
|
|
85
98
|
}
|
|
86
99
|
|
|
87
|
-
const hasH1 =
|
|
100
|
+
const hasH1 = /^\s*#\s+.+/m.test(content);
|
|
88
101
|
const hasLink = /\[.+\]\(.+\)/.test(content);
|
|
89
102
|
const isTooShort = content.length < 50;
|
|
90
103
|
|
package/core/audits/baseline.js
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import data from 'web-features
|
|
8
|
-
|
|
7
|
+
import data from '../lib/baseline/web-features-data.json' with {type: 'json'};
|
|
9
8
|
import {Audit} from './audit.js';
|
|
10
9
|
import metadata from '../lib/baseline/web-features-metadata.json' with {type: 'json'};
|
|
11
10
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
@@ -27,7 +26,6 @@ const UIStrings = {
|
|
|
27
26
|
};
|
|
28
27
|
|
|
29
28
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
30
|
-
const {features} = /** @type {any} */ (data);
|
|
31
29
|
|
|
32
30
|
|
|
33
31
|
/** @typedef {LH.TraceEvent & {args: {feature: string, url?: string, lineNumber?: number, columnNumber?: number}}} DXFeatureEvent */
|
|
@@ -90,21 +88,21 @@ class Baseline extends Audit {
|
|
|
90
88
|
continue;
|
|
91
89
|
}
|
|
92
90
|
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
if (!featureData || !('status' in featureData)) {
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
91
|
+
const featureId = feature.featureId;
|
|
98
92
|
|
|
99
93
|
let displayStatus = 'Limited Availability';
|
|
100
94
|
let baselineTier = 'limited';
|
|
101
95
|
|
|
102
|
-
if (
|
|
103
|
-
|
|
96
|
+
if (featureId in data.high) {
|
|
97
|
+
const highData = /** @type {Record<string, string>} */ (data.high);
|
|
98
|
+
displayStatus = `Widely Available (${highData[featureId]})`;
|
|
104
99
|
baselineTier = 'high';
|
|
105
|
-
} else if (
|
|
106
|
-
|
|
100
|
+
} else if (featureId in data.low) {
|
|
101
|
+
const lowData = /** @type {Record<string, string>} */ (data.low);
|
|
102
|
+
displayStatus = `Newly Available (${lowData[featureId]})`;
|
|
107
103
|
baselineTier = 'low';
|
|
104
|
+
} else if (!data.limited.includes(featureId)) {
|
|
105
|
+
continue;
|
|
108
106
|
}
|
|
109
107
|
|
|
110
108
|
baselineStatus.push({
|
|
@@ -21,7 +21,8 @@ const UIStrings = {
|
|
|
21
21
|
/** Description of a Lighthouse audit that tells the user why they should not ask for geolocation permissions on load. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
22
22
|
description: 'Users are mistrustful of or confused by sites that request their ' +
|
|
23
23
|
'location without context. Consider tying the request to a user action instead. ' +
|
|
24
|
-
'[Learn more about the geolocation permission](https://developer.chrome.com/docs/lighthouse/best-practices/geolocation-on-start/).'
|
|
24
|
+
'[Learn more about the geolocation permission](https://developer.chrome.com/docs/lighthouse/best-practices/geolocation-on-start/). ' +
|
|
25
|
+
'Also consider using the [`<geolocation>` element](https://developer.chrome.com/blog/geolocation-html-element).',
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -70,6 +70,8 @@ class NetworkRequests extends Audit {
|
|
|
70
70
|
url: UrlUtils.elideDataURI(record.url),
|
|
71
71
|
sessionTargetType: record.sessionTargetType,
|
|
72
72
|
protocol: record.protocol,
|
|
73
|
+
cache: record.fromDiskCache ? 'disk' :
|
|
74
|
+
record.fromMemoryCache ? 'memory' : record.fromPrefetchCache ? 'prefetch' : 'none',
|
|
73
75
|
rendererStartTime: normalizeTime(record.rendererStartTime),
|
|
74
76
|
networkRequestTime: normalizeTime(record.networkRequestTime),
|
|
75
77
|
networkEndTime: normalizeTime(record.networkEndTime),
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {Audit} from '../audit.js';
|
|
8
|
-
import UrlUtils from '../../lib/url-utils.js';
|
|
9
8
|
import {MainResource} from '../../computed/main-resource.js';
|
|
10
9
|
import * as i18n from '../../lib/i18n/i18n.js';
|
|
11
10
|
|
|
@@ -90,12 +89,25 @@ class Canonical extends Audit {
|
|
|
90
89
|
// Links that don't have an href aren't canonical references for SEO, skip them
|
|
91
90
|
if (!link.hrefRaw) continue;
|
|
92
91
|
|
|
93
|
-
// Links that
|
|
94
|
-
if (!link.href)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
92
|
+
// Links that don't have an href are invalid, flag them
|
|
93
|
+
if (!link.href) {
|
|
94
|
+
invalidCanonicalLink = link;
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (URL.parse(link.hrefRaw, 'https://example.com') === null) {
|
|
99
|
+
// Links that are syntactically INVALID with a base, flag them
|
|
100
|
+
invalidCanonicalLink = link;
|
|
101
|
+
} else {
|
|
102
|
+
// Links that are syntactically VALID with a base:
|
|
103
|
+
if (URL.parse(link.hrefRaw) === null) {
|
|
104
|
+
// Links that are INVALID without a base must be relative, flag them
|
|
105
|
+
relativeCanonicallink = link;
|
|
106
|
+
} else {
|
|
107
|
+
// Links that are valid without a base are absolute
|
|
108
|
+
uniqueCanonicalURLs.add(link.href);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
99
111
|
} else if (link.rel === 'alternate') {
|
|
100
112
|
if (link.href && link.hreflang) hreflangURLs.add(link.href);
|
|
101
113
|
}
|
|
@@ -50,8 +50,13 @@ const UIStrings = {
|
|
|
50
50
|
=1 {1 error found}
|
|
51
51
|
other {# errors found}
|
|
52
52
|
}`,
|
|
53
|
+
/**
|
|
54
|
+
* @description Explanatory message stating that there was a failure in an audit caused by Lighthouse not being able to download the robots.txt file for the site. Note: "robots.txt" is a canonical filename and should not be translated.
|
|
55
|
+
* @example {Timed out fetching resource} error
|
|
56
|
+
* */
|
|
57
|
+
explanationWithError: 'Fetch of robots.txt failed: {error}',
|
|
53
58
|
/** Explanatory message stating that there was a failure in an audit caused by Lighthouse not being able to download the robots.txt file for the site. Note: "robots.txt" is a canonical filename and should not be translated. */
|
|
54
|
-
explanation: '
|
|
59
|
+
explanation: 'Fetch of robots.txt failed',
|
|
55
60
|
};
|
|
56
61
|
|
|
57
62
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -200,24 +205,33 @@ class RobotsTxt extends Audit {
|
|
|
200
205
|
const {
|
|
201
206
|
status,
|
|
202
207
|
content,
|
|
208
|
+
errorMessage,
|
|
203
209
|
} = artifacts.RobotsTxt;
|
|
204
210
|
|
|
205
|
-
|
|
211
|
+
// Do specific error messages first.
|
|
212
|
+
if (status && status >= HTTP_SERVER_ERROR_CODE_LOW) {
|
|
206
213
|
return {
|
|
207
214
|
score: 0,
|
|
208
|
-
|
|
215
|
+
displayValue: str_(UIStrings.displayValueHttpBadCode, {statusCode: status}),
|
|
216
|
+
};
|
|
217
|
+
} else if (status && status >= HTTP_CLIENT_ERROR_CODE_LOW || content === '') {
|
|
218
|
+
return {
|
|
219
|
+
score: 1,
|
|
220
|
+
notApplicable: true,
|
|
209
221
|
};
|
|
210
222
|
}
|
|
211
223
|
|
|
212
|
-
if (
|
|
224
|
+
if (errorMessage) {
|
|
213
225
|
return {
|
|
214
226
|
score: 0,
|
|
215
|
-
|
|
227
|
+
explanation: str_(UIStrings.explanationWithError, {error: errorMessage}),
|
|
216
228
|
};
|
|
217
|
-
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (!status) {
|
|
218
232
|
return {
|
|
219
|
-
score:
|
|
220
|
-
|
|
233
|
+
score: 0,
|
|
234
|
+
explanation: str_(UIStrings.explanation),
|
|
221
235
|
};
|
|
222
236
|
}
|
|
223
237
|
|