lighthouse 9.3.1 → 9.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/report/bundle.esm.js +38 -24
  2. package/dist/report/flow.js +5 -5
  3. package/dist/report/standalone.js +9 -9
  4. package/flow-report/src/topbar.tsx +1 -1
  5. package/flow-report/src/wrappers/report.tsx +2 -1
  6. package/flow-report/test/topbar-test.tsx +1 -1
  7. package/lighthouse-cli/bin.js +1 -4
  8. package/lighthouse-cli/run.js +1 -1
  9. package/lighthouse-cli/test/smokehouse/core-tests.js +4 -5
  10. package/lighthouse-cli/test/smokehouse/readme.md +4 -0
  11. package/lighthouse-cli/test/smokehouse/report-assert.js +36 -0
  12. package/lighthouse-core/audits/autocomplete.js +34 -37
  13. package/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js +1 -0
  14. package/lighthouse-core/audits/seo/hreflang.js +2 -17
  15. package/lighthouse-core/config/default-config.js +2 -2
  16. package/lighthouse-core/fraggle-rock/config/default-config.js +3 -3
  17. package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +50 -31
  18. package/lighthouse-core/fraggle-rock/gather/snapshot-runner.js +4 -5
  19. package/lighthouse-core/fraggle-rock/gather/timespan-runner.js +4 -5
  20. package/lighthouse-core/fraggle-rock/user-flow.js +8 -6
  21. package/lighthouse-core/gather/driver/navigation.js +29 -10
  22. package/lighthouse-core/gather/driver/network-monitor.js +8 -6
  23. package/lighthouse-core/gather/driver/prepare.js +13 -7
  24. package/lighthouse-core/gather/driver/wait-for-condition.js +11 -4
  25. package/lighthouse-core/gather/gather-runner.js +1 -1
  26. package/lighthouse-core/gather/gatherers/full-page-screenshot.js +35 -9
  27. package/lighthouse-core/gather/gatherers/inputs.js +113 -0
  28. package/lighthouse-core/index.js +3 -3
  29. package/lighthouse-core/lib/page-functions.js +11 -1
  30. package/lighthouse-core/lib/sentry.js +39 -24
  31. package/lighthouse-core/runner.js +79 -52
  32. package/lighthouse-core/util-commonjs.js +4 -0
  33. package/package.json +2 -3
  34. package/readme.md +1 -1
  35. package/report/assets/templates.html +2 -5
  36. package/report/renderer/components.js +3 -3
  37. package/report/renderer/dom.js +1 -3
  38. package/report/renderer/report-ui-features.js +25 -17
  39. package/report/renderer/topbar-features.js +5 -1
  40. package/report/renderer/util.js +4 -0
  41. package/report/test/renderer/__snapshots__/report-renderer-axe-test.js.snap +107 -0
  42. package/report/test/renderer/report-renderer-axe-test.js +38 -17
  43. package/report/test-assets/faux-psi.js +2 -1
  44. package/report/types/report-renderer.d.ts +21 -2
  45. package/shared/localization/locales/en-US.json +7 -1
  46. package/shared/localization/locales/en-XL.json +7 -1
  47. package/third-party/axe/LICENSE +362 -0
  48. package/third-party/axe/README.md +6 -0
  49. package/third-party/axe/valid-langs.js +110 -0
  50. package/third-party/snyk/snapshot.json +1 -0
  51. package/tsconfig.json +1 -0
  52. package/types/artifacts.d.ts +14 -14
  53. package/types/global-lh.d.ts +1 -0
  54. package/types/parse-cache-control/index.d.ts +1 -0
  55. package/types/smokehouse.d.ts +3 -0
  56. package/changelog.md +0 -5803
  57. package/lighthouse-core/gather/gatherers/form-elements.js +0 -113
  58. package/lighthouse-core/scripts/package.json +0 -4
@@ -1,113 +0,0 @@
1
- /**
2
- * @license Copyright 2020 The Lighthouse Authors. All Rights Reserved.
3
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5
- */
6
- 'use strict';
7
-
8
- /* global getNodeDetails */
9
-
10
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
11
- const pageFunctions = require('../../lib/page-functions.js');
12
-
13
- /* eslint-env browser, node */
14
-
15
- /**
16
- * @return {LH.Artifacts['FormElements']}
17
- */
18
- /* c8 ignore start */
19
- function collectFormElements() {
20
- // @ts-expect-error - put into scope via stringification
21
- const formChildren = getElementsInDocument('textarea, input, label, select'); // eslint-disable-line no-undef
22
- /** @type {Map<HTMLFormElement|string, LH.Artifacts.Form>} */
23
- const forms = new Map();
24
- /** @type {LH.Artifacts.Form} */
25
- const formlessObj = {
26
- node: null,
27
- inputs: [],
28
- labels: [],
29
- };
30
- for (const child of formChildren) {
31
- const isButton = child instanceof HTMLInputElement &&
32
- (child.type === 'submit' || child.type === 'button');
33
- if (isButton) continue;
34
-
35
- const parentFormElement = child.form;
36
- const hasForm = !!parentFormElement;
37
- if (hasForm && !forms.has(parentFormElement)) {
38
- const newFormObj = {
39
- attributes: {
40
- id: parentFormElement.id,
41
- name: parentFormElement.name,
42
- autocomplete: parentFormElement.autocomplete,
43
- },
44
- // @ts-expect-error - getNodeDetails put into scope via stringification
45
- node: getNodeDetails(parentFormElement),
46
- inputs: [],
47
- labels: [],
48
- };
49
- forms.set(parentFormElement, newFormObj);
50
- }
51
- const formObj = forms.get(parentFormElement) || formlessObj;
52
- if (child instanceof HTMLInputElement || child instanceof HTMLTextAreaElement ||
53
- child instanceof HTMLSelectElement) {
54
- formObj.inputs.push({
55
- id: child.id,
56
- name: child.name,
57
- placeholder: child instanceof HTMLSelectElement ? undefined : child.placeholder,
58
- autocomplete: {
59
- property: child.autocomplete,
60
- // Requires `--enable-features=AutofillShowTypePredictions`.
61
- attribute: child.getAttribute('autocomplete'),
62
- prediction: child.getAttribute('autofill-prediction'),
63
- },
64
- // @ts-expect-error - getNodeDetails put into scope via stringification
65
- node: getNodeDetails(child),
66
- });
67
- }
68
- if (child instanceof HTMLLabelElement) {
69
- formObj.labels.push({
70
- for: child.htmlFor,
71
- // @ts-expect-error - getNodeDetails put into scope via stringification
72
- node: getNodeDetails(child),
73
- });
74
- }
75
- }
76
-
77
- if (formlessObj.inputs.length > 0 || formlessObj.labels.length > 0) {
78
- forms.set('formless', {
79
- node: formlessObj.node,
80
- inputs: formlessObj.inputs,
81
- labels: formlessObj.labels,
82
- });
83
- }
84
- return [...forms.values()];
85
- }
86
- /* c8 ignore stop */
87
-
88
- class FormElements extends FRGatherer {
89
- /** @type {LH.Gatherer.GathererMeta} */
90
- meta = {
91
- supportedModes: ['snapshot', 'navigation'],
92
- };
93
-
94
- /**
95
- * @param {LH.Gatherer.FRTransitionalContext} passContext
96
- * @return {Promise<LH.Artifacts['FormElements']>}
97
- */
98
- async getArtifact(passContext) {
99
- const driver = passContext.driver;
100
-
101
- const formElements = await driver.executionContext.evaluate(collectFormElements, {
102
- args: [],
103
- useIsolation: true,
104
- deps: [
105
- pageFunctions.getElementsInDocumentString,
106
- pageFunctions.getNodeDetailsString,
107
- ],
108
- });
109
- return formElements;
110
- }
111
- }
112
-
113
- module.exports = FormElements;
@@ -1,4 +0,0 @@
1
- {
2
- "type": "module",
3
- "//": "Any directory that uses `import ... from` or `export ...` must be type module. Temporary file until root package.json is type: module"
4
- }