lighthouse 8.6.0-dev.20211029 → 8.6.0-dev.20211102

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 (116) hide show
  1. package/dist/report/flow.js +14 -14
  2. package/dist/report/standalone.js +12 -12
  3. package/flow-report/.eslintrc.cjs +2 -0
  4. package/flow-report/assets/styles.css +1 -1
  5. package/flow-report/src/app.tsx +10 -11
  6. package/flow-report/src/common.tsx +22 -9
  7. package/flow-report/src/header.tsx +3 -3
  8. package/flow-report/src/i18n/i18n.tsx +10 -6
  9. package/flow-report/src/icons.tsx +21 -9
  10. package/flow-report/src/sidebar/flow.tsx +3 -3
  11. package/flow-report/src/sidebar/sidebar.tsx +12 -6
  12. package/flow-report/src/summary/category.tsx +9 -4
  13. package/flow-report/src/summary/summary.tsx +9 -3
  14. package/flow-report/src/util.ts +31 -19
  15. package/flow-report/src/wrappers/report-renderer.tsx +9 -3
  16. package/flow-report/src/wrappers/report.tsx +17 -7
  17. package/flow-report/test/common-test.tsx +25 -10
  18. package/flow-report/test/header-test.tsx +6 -6
  19. package/flow-report/test/setup/env-setup.ts +1 -1
  20. package/flow-report/test/summary/category-test.tsx +5 -5
  21. package/flow-report/test/util-test.tsx +32 -11
  22. package/lighthouse-cli/.eslintrc.cjs +2 -0
  23. package/lighthouse-cli/cli-flags.js +1 -1
  24. package/lighthouse-cli/test/smokehouse/lighthouse-runners/bundle.js +4 -2
  25. package/lighthouse-cli/test/smokehouse/smokehouse.js +1 -1
  26. package/lighthouse-core/audits/audit.js +1 -1
  27. package/lighthouse-core/computed/metrics/lantern-total-blocking-time.js +3 -4
  28. package/lighthouse-core/computed/metrics/tbt-utils.js +57 -0
  29. package/lighthouse-core/computed/metrics/total-blocking-time.js +3 -53
  30. package/lighthouse-core/computed/resource-summary.js +1 -1
  31. package/lighthouse-core/config/config-helpers.js +20 -10
  32. package/lighthouse-core/config/default-config.js +59 -55
  33. package/lighthouse-core/fraggle-rock/config/default-config.js +1 -1
  34. package/lighthouse-core/fraggle-rock/gather/base-gatherer.js +6 -1
  35. package/lighthouse-core/gather/connections/cri.js +1 -1
  36. package/lighthouse-core/gather/gatherers/dobetterweb/response-compression.js +1 -0
  37. package/lighthouse-core/lib/asset-saver.js +4 -1
  38. package/lighthouse-core/lib/lh-env.js +2 -0
  39. package/lighthouse-core/lib/proto-preprocessor.js +14 -2
  40. package/lighthouse-core/lib/tappable-rects.js +8 -15
  41. package/lighthouse-core/lib/url-shim.js +1 -1
  42. package/lighthouse-core/runner.js +1 -1
  43. package/lighthouse-core/util-commonjs.js +25 -11
  44. package/package.json +11 -8
  45. package/report/.eslintrc.cjs +2 -0
  46. package/report/assets/styles.css +226 -250
  47. package/report/assets/templates.html +19 -29
  48. package/report/clients/standalone.js +0 -2
  49. package/report/renderer/category-renderer.js +21 -17
  50. package/report/renderer/components.js +21 -54
  51. package/report/renderer/crc-details-renderer.js +15 -12
  52. package/report/renderer/element-screenshot-renderer.js +2 -2
  53. package/report/renderer/open-tab.js +9 -3
  54. package/report/renderer/performance-category-renderer.js +51 -24
  55. package/report/renderer/report-renderer.js +2 -1
  56. package/report/renderer/report-ui-features.js +2 -3
  57. package/report/renderer/util.js +26 -11
  58. package/report/test/renderer/category-renderer-test.js +2 -2
  59. package/report/test/renderer/performance-category-renderer-test.js +35 -9
  60. package/report/test/renderer/report-renderer-test.js +1 -1
  61. package/report/test/renderer/report-ui-features-test.js +10 -9
  62. package/report/test/renderer/util-test.js +13 -31
  63. package/report/test-assets/faux-psi.js +5 -5
  64. package/shared/localization/format.js +9 -4
  65. package/shared/localization/locales/ar-XB.json +0 -15
  66. package/shared/localization/locales/ar.json +0 -15
  67. package/shared/localization/locales/bg.json +0 -15
  68. package/shared/localization/locales/ca.json +0 -15
  69. package/shared/localization/locales/cs.json +0 -15
  70. package/shared/localization/locales/da.json +0 -15
  71. package/shared/localization/locales/de.json +0 -15
  72. package/shared/localization/locales/el.json +0 -15
  73. package/shared/localization/locales/en-GB.json +0 -15
  74. package/shared/localization/locales/en-US.json +19 -16
  75. package/shared/localization/locales/en-XA.json +0 -15
  76. package/shared/localization/locales/en-XL.json +19 -16
  77. package/shared/localization/locales/es-419.json +0 -15
  78. package/shared/localization/locales/es.json +0 -15
  79. package/shared/localization/locales/fi.json +0 -15
  80. package/shared/localization/locales/fil.json +0 -15
  81. package/shared/localization/locales/fr.json +0 -15
  82. package/shared/localization/locales/he.json +0 -15
  83. package/shared/localization/locales/hi.json +0 -15
  84. package/shared/localization/locales/hr.json +0 -15
  85. package/shared/localization/locales/hu.json +0 -15
  86. package/shared/localization/locales/id.json +0 -15
  87. package/shared/localization/locales/it.json +0 -15
  88. package/shared/localization/locales/ja.json +0 -15
  89. package/shared/localization/locales/ko.json +0 -15
  90. package/shared/localization/locales/lt.json +0 -15
  91. package/shared/localization/locales/lv.json +0 -15
  92. package/shared/localization/locales/nl.json +0 -15
  93. package/shared/localization/locales/no.json +0 -15
  94. package/shared/localization/locales/pl.json +0 -15
  95. package/shared/localization/locales/pt-PT.json +0 -15
  96. package/shared/localization/locales/pt.json +0 -15
  97. package/shared/localization/locales/ro.json +0 -15
  98. package/shared/localization/locales/ru.json +0 -15
  99. package/shared/localization/locales/sk.json +0 -15
  100. package/shared/localization/locales/sl.json +0 -15
  101. package/shared/localization/locales/sr-Latn.json +0 -15
  102. package/shared/localization/locales/sr.json +0 -15
  103. package/shared/localization/locales/sv.json +0 -15
  104. package/shared/localization/locales/ta.json +0 -15
  105. package/shared/localization/locales/te.json +0 -15
  106. package/shared/localization/locales/th.json +0 -15
  107. package/shared/localization/locales/tr.json +0 -15
  108. package/shared/localization/locales/uk.json +0 -15
  109. package/shared/localization/locales/vi.json +0 -15
  110. package/shared/localization/locales/zh-HK.json +0 -15
  111. package/shared/localization/locales/zh-TW.json +0 -15
  112. package/shared/localization/locales/zh.json +0 -15
  113. package/third-party/chromium-synchronization/installability-errors-test.js +2 -0
  114. package/types/lhr/flow.d.ts +3 -2
  115. package/types/rollup-plugin-postprocess.d.ts +10 -0
  116. package/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js +0 -96
@@ -1,96 +0,0 @@
1
- /**
2
- * @license Copyright 2016 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
- const URL = require('../../lib/url-shim.js');
9
- const Audit = require('../audit.js');
10
- const i18n = require('../../lib/i18n/i18n.js');
11
-
12
- const UIStrings = {
13
- /** Title of a Lighthouse audit that provides detail on the cross-origin links that the web page contains, and whether the links can be considered safe. This descriptive title is shown to users when all links are safe. */
14
- title: 'Links to cross-origin destinations are safe',
15
- /** Title of a Lighthouse audit that provides detail on the cross-origin links that the web page contains, and whether the links can be considered safe. This descriptive title is shown to users when not all links can be considered safe. */
16
- failureTitle: 'Links to cross-origin destinations are unsafe',
17
- /** Description of a Lighthouse audit that tells the user why and how they should secure cross-origin links. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
18
- description: 'Add `rel="noopener"` or `rel="noreferrer"` to any external links to improve ' +
19
- 'performance and prevent security vulnerabilities. ' +
20
- '[Learn more](https://web.dev/external-anchors-use-rel-noopener/).',
21
- /**
22
- * @description Warning that some links' destinations cannot be determined and therefore the audit cannot evaluate the link's safety.
23
- * @example {<a target="_blank">} anchorHTML
24
- */
25
- warning: 'Unable to determine the destination for anchor ({anchorHTML}). ' +
26
- 'If not used as a hyperlink, consider removing target=_blank.',
27
- /** Label for a column in a data table; entries will be the HTML elements that failed the audit. Anchors are DOM elements that are links. */
28
- columnFailingAnchors: 'Failing Anchors',
29
- };
30
-
31
- const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
32
-
33
- class ExternalAnchorsUseRelNoopenerAudit extends Audit {
34
- /**
35
- * @return {LH.Audit.Meta}
36
- */
37
- static get meta() {
38
- return {
39
- id: 'external-anchors-use-rel-noopener',
40
- title: str_(UIStrings.title),
41
- failureTitle: str_(UIStrings.failureTitle),
42
- description: str_(UIStrings.description),
43
- requiredArtifacts: ['URL', 'AnchorElements'],
44
- };
45
- }
46
-
47
- /**
48
- * @param {LH.Artifacts} artifacts
49
- * @return {LH.Audit.Product}
50
- */
51
- static audit(artifacts) {
52
- /** @type {LH.IcuMessage[]} */
53
- const warnings = [];
54
- const pageHost = new URL(artifacts.URL.finalUrl).host;
55
- const failingAnchors = artifacts.AnchorElements
56
- .filter(anchor => anchor.target === '_blank' && !anchor.rel.includes('noopener') &&
57
- !anchor.rel.includes('noreferrer'))
58
- // Filter usages to exclude anchors that are same origin
59
- .filter(anchor => {
60
- try {
61
- return new URL(anchor.href).host !== pageHost;
62
- } catch (err) {
63
- warnings.push(str_(UIStrings.warning, {anchorHTML: anchor.node.snippet}));
64
- return true;
65
- }
66
- })
67
- .filter(anchor => {
68
- return !anchor.href || anchor.href.toLowerCase().startsWith('http');
69
- })
70
- .map(anchor => {
71
- return {
72
- node: Audit.makeNodeItem(anchor.node),
73
- href: anchor.href || 'Unknown',
74
- target: anchor.target || '',
75
- rel: anchor.rel || '',
76
- outerHTML: anchor.node.snippet || '',
77
- };
78
- });
79
-
80
- /** @type {LH.Audit.Details.Table['headings']} */
81
- const headings = [
82
- {key: 'node', itemType: 'node', text: str_(UIStrings.columnFailingAnchors)},
83
- ];
84
-
85
- const details = Audit.makeTableDetails(headings, failingAnchors);
86
-
87
- return {
88
- score: Number(failingAnchors.length === 0),
89
- details,
90
- warnings,
91
- };
92
- }
93
- }
94
-
95
- module.exports = ExternalAnchorsUseRelNoopenerAudit;
96
- module.exports.UIStrings = UIStrings;