lighthouse 11.7.0-dev.20240408 → 11.7.1

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 (141) hide show
  1. package/CONTRIBUTING.md +2 -2
  2. package/cli/test/smokehouse/core-tests.js +2 -0
  3. package/core/audits/accessibility/duplicate-id-active.d.ts +10 -0
  4. package/core/audits/accessibility/duplicate-id-active.js +42 -0
  5. package/core/audits/accessibility/target-size.js +1 -0
  6. package/core/audits/byte-efficiency/byte-efficiency-audit.d.ts +16 -0
  7. package/core/audits/byte-efficiency/byte-efficiency-audit.js +38 -1
  8. package/core/audits/byte-efficiency/offscreen-images.d.ts +11 -0
  9. package/core/audits/byte-efficiency/offscreen-images.js +15 -0
  10. package/core/audits/dobetterweb/uses-http2.d.ts +13 -0
  11. package/core/audits/dobetterweb/uses-http2.js +34 -2
  12. package/core/audits/layout-shift-elements.d.ts +16 -0
  13. package/core/audits/layout-shift-elements.js +101 -0
  14. package/core/audits/no-unload-listeners.d.ts +16 -0
  15. package/core/audits/no-unload-listeners.js +86 -0
  16. package/core/audits/preload-fonts.d.ts +5 -1
  17. package/core/audits/preload-fonts.js +10 -1
  18. package/core/audits/script-elements-test-audit.d.ts +14 -0
  19. package/core/audits/script-elements-test-audit.js +29 -0
  20. package/core/audits/seo/is-crawlable.d.ts +1 -2
  21. package/core/audits/seo/plugins.d.ts +15 -0
  22. package/core/audits/seo/plugins.js +150 -0
  23. package/core/audits/seo/tap-targets.d.ts +50 -0
  24. package/core/audits/seo/tap-targets.js +352 -0
  25. package/core/audits/uses-rel-preload.d.ts +5 -1
  26. package/core/audits/uses-rel-preload.js +11 -1
  27. package/core/audits/work-during-interaction.d.ts +2 -2
  28. package/core/audits/work-during-interaction.js +2 -2
  29. package/core/computed/js-bundles.d.ts +1 -1
  30. package/core/computed/metrics/lantern-first-contentful-paint.d.ts +82 -13
  31. package/core/computed/metrics/lantern-first-contentful-paint.js +178 -15
  32. package/core/computed/metrics/lantern-first-meaningful-paint.d.ts +12 -13
  33. package/core/computed/metrics/lantern-first-meaningful-paint.js +49 -10
  34. package/core/computed/metrics/lantern-interactive.d.ts +21 -13
  35. package/core/computed/metrics/lantern-interactive.js +84 -11
  36. package/core/computed/metrics/lantern-largest-contentful-paint.d.ts +25 -13
  37. package/core/computed/metrics/lantern-largest-contentful-paint.js +80 -12
  38. package/core/computed/metrics/lantern-max-potential-fid.d.ts +24 -13
  39. package/core/computed/metrics/lantern-max-potential-fid.js +64 -11
  40. package/core/computed/metrics/lantern-metric.d.ts +18 -9
  41. package/core/computed/metrics/lantern-metric.js +31 -13
  42. package/core/computed/metrics/lantern-speed-index.d.ts +32 -13
  43. package/core/computed/metrics/lantern-speed-index.js +116 -12
  44. package/core/computed/metrics/lantern-total-blocking-time.d.ts +25 -13
  45. package/core/computed/metrics/lantern-total-blocking-time.js +94 -10
  46. package/core/computed/metrics/metric.js +3 -1
  47. package/core/computed/module-duplication.d.ts +1 -1
  48. package/core/computed/page-dependency-graph.js +1 -2
  49. package/core/config/default-config.js +74 -46
  50. package/core/config/experimental-config.js +0 -11
  51. package/core/config/metrics-to-audits.d.ts +19 -0
  52. package/core/config/metrics-to-audits.js +62 -0
  53. package/core/gather/gatherers/accessibility.js +3 -1
  54. package/core/gather/gatherers/global-listeners.d.ts +27 -0
  55. package/core/gather/gatherers/global-listeners.js +108 -0
  56. package/core/gather/gatherers/script-elements.d.ts +21 -0
  57. package/core/gather/gatherers/script-elements.js +100 -0
  58. package/core/gather/gatherers/seo/embedded-content.d.ts +10 -0
  59. package/core/gather/gatherers/seo/embedded-content.js +63 -0
  60. package/core/gather/gatherers/seo/tap-targets.d.ts +21 -0
  61. package/core/gather/gatherers/seo/tap-targets.js +389 -0
  62. package/core/gather/gatherers/trace-elements.d.ts +10 -0
  63. package/core/gather/gatherers/trace-elements.js +19 -0
  64. package/core/lib/lantern/page-dependency-graph.d.ts +4 -4
  65. package/core/lib/lantern/page-dependency-graph.js +5 -5
  66. package/core/lib/lighthouse-compatibility.js +10 -53
  67. package/dist/report/bundle.esm.js +1 -1
  68. package/dist/report/flow.js +14 -14
  69. package/dist/report/standalone.js +1 -1
  70. package/flow-report/src/summary/category.tsx +12 -10
  71. package/package.json +1 -1
  72. package/report/renderer/performance-category-renderer.d.ts +7 -0
  73. package/report/renderer/performance-category-renderer.js +11 -1
  74. package/report/renderer/report-utils.js +10 -13
  75. package/shared/localization/locales/ar-XB.json +64 -1
  76. package/shared/localization/locales/ar.json +64 -1
  77. package/shared/localization/locales/bg.json +64 -1
  78. package/shared/localization/locales/ca.json +64 -1
  79. package/shared/localization/locales/cs.json +64 -1
  80. package/shared/localization/locales/da.json +64 -1
  81. package/shared/localization/locales/de.json +64 -1
  82. package/shared/localization/locales/el.json +64 -1
  83. package/shared/localization/locales/en-GB.json +64 -1
  84. package/shared/localization/locales/en-US.json +65 -2
  85. package/shared/localization/locales/en-XA.json +64 -1
  86. package/shared/localization/locales/en-XL.json +65 -2
  87. package/shared/localization/locales/es-419.json +64 -1
  88. package/shared/localization/locales/es.json +64 -1
  89. package/shared/localization/locales/fi.json +64 -1
  90. package/shared/localization/locales/fil.json +64 -1
  91. package/shared/localization/locales/fr.json +64 -1
  92. package/shared/localization/locales/he.json +64 -1
  93. package/shared/localization/locales/hi.json +64 -1
  94. package/shared/localization/locales/hr.json +64 -1
  95. package/shared/localization/locales/hu.json +64 -1
  96. package/shared/localization/locales/id.json +64 -1
  97. package/shared/localization/locales/it.json +64 -1
  98. package/shared/localization/locales/ja.json +64 -1
  99. package/shared/localization/locales/ko.json +64 -1
  100. package/shared/localization/locales/lt.json +64 -1
  101. package/shared/localization/locales/lv.json +64 -1
  102. package/shared/localization/locales/nl.json +64 -1
  103. package/shared/localization/locales/no.json +64 -1
  104. package/shared/localization/locales/pl.json +64 -1
  105. package/shared/localization/locales/pt-PT.json +64 -1
  106. package/shared/localization/locales/pt.json +64 -1
  107. package/shared/localization/locales/ro.json +64 -1
  108. package/shared/localization/locales/ru.json +64 -1
  109. package/shared/localization/locales/sk.json +64 -1
  110. package/shared/localization/locales/sl.json +64 -1
  111. package/shared/localization/locales/sr-Latn.json +64 -1
  112. package/shared/localization/locales/sr.json +64 -1
  113. package/shared/localization/locales/sv.json +64 -1
  114. package/shared/localization/locales/ta.json +64 -1
  115. package/shared/localization/locales/te.json +64 -1
  116. package/shared/localization/locales/th.json +64 -1
  117. package/shared/localization/locales/tr.json +64 -1
  118. package/shared/localization/locales/uk.json +64 -1
  119. package/shared/localization/locales/vi.json +64 -1
  120. package/shared/localization/locales/zh-HK.json +64 -1
  121. package/shared/localization/locales/zh-TW.json +64 -1
  122. package/shared/localization/locales/zh.json +64 -1
  123. package/tsconfig.json +0 -1
  124. package/types/artifacts.d.ts +17 -3
  125. package/types/config.d.ts +1 -0
  126. package/types/lhr/audit-details.d.ts +4 -9
  127. package/types/lhr/lhr.d.ts +2 -0
  128. package/core/lib/lantern/metrics/first-contentful-paint.d.ts +0 -79
  129. package/core/lib/lantern/metrics/first-contentful-paint.js +0 -200
  130. package/core/lib/lantern/metrics/first-meaningful-paint.d.ts +0 -6
  131. package/core/lib/lantern/metrics/first-meaningful-paint.js +0 -66
  132. package/core/lib/lantern/metrics/interactive.d.ts +0 -26
  133. package/core/lib/lantern/metrics/interactive.js +0 -112
  134. package/core/lib/lantern/metrics/largest-contentful-paint.d.ts +0 -19
  135. package/core/lib/lantern/metrics/largest-contentful-paint.js +0 -108
  136. package/core/lib/lantern/metrics/max-potential-fid.d.ts +0 -30
  137. package/core/lib/lantern/metrics/max-potential-fid.js +0 -92
  138. package/core/lib/lantern/metrics/speed-index.d.ts +0 -38
  139. package/core/lib/lantern/metrics/speed-index.js +0 -145
  140. package/core/lib/lantern/metrics/total-blocking-time.d.ts +0 -31
  141. package/core/lib/lantern/metrics/total-blocking-time.js +0 -128
@@ -236,6 +236,15 @@
236
236
  "core/audits/accessibility/document-title.js | title": {
237
237
  "message": "文件具備 `<title>` 元素"
238
238
  },
239
+ "core/audits/accessibility/duplicate-id-active.js | description": {
240
+ "message": "所有可聚焦元素都必須有不重複的 `id`,以確保輔助技術可以查看這些元素。[瞭解如何修正 `id` 重複的問題](https://dequeuniversity.com/rules/axe/4.8/duplicate-id-active)。"
241
+ },
242
+ "core/audits/accessibility/duplicate-id-active.js | failureTitle": {
243
+ "message": "已啟用且可聚焦的元素有重複的 `[id]` 屬性"
244
+ },
245
+ "core/audits/accessibility/duplicate-id-active.js | title": {
246
+ "message": "已啟用且可聚焦的元素沒有重複的 `[id]` 屬性"
247
+ },
239
248
  "core/audits/accessibility/duplicate-id-aria.js | description": {
240
249
  "message": "ARIA ID 的值不可重複,以免輔助技術忽略其他例項。[瞭解如何修正重複的 ARIA ID](https://dequeuniversity.com/rules/axe/4.8/duplicate-id-aria)。"
241
250
  },
@@ -1148,6 +1157,15 @@
1148
1157
  "core/audits/largest-contentful-paint-element.js | title": {
1149
1158
  "message": "「最大內容繪製」元素"
1150
1159
  },
1160
+ "core/audits/layout-shift-elements.js | columnContribution": {
1161
+ "message": "受版面配置轉移影響的元素數量"
1162
+ },
1163
+ "core/audits/layout-shift-elements.js | description": {
1164
+ "message": "版面配置轉移對這些 DOM 元素造成的影響最大。由於[視窗化](https://web.dev/articles/cls#what_is_cls),部分版面配置轉移可能不會包含在 CLS 數據值中。[瞭解如何改善累計版面配置轉移 (CLS)](https://web.dev/articles/optimize-cls)"
1165
+ },
1166
+ "core/audits/layout-shift-elements.js | title": {
1167
+ "message": "避免大幅度的版面配置轉移"
1168
+ },
1151
1169
  "core/audits/layout-shifts.js | columnScore": {
1152
1170
  "message": "版面配置轉移分數"
1153
1171
  },
@@ -1268,6 +1286,15 @@
1268
1286
  "core/audits/network-server-latency.js | title": {
1269
1287
  "message": "伺服器後端延遲時間"
1270
1288
  },
1289
+ "core/audits/no-unload-listeners.js | description": {
1290
+ "message": "「`unload`」事件無法保證觸發,而偵聽此事件可能會防礙瀏覽器優化項目操作,例如向前/返回快取。請改用「`pagehide`」或「`visibilitychange`」事件。[進一步瞭解卸載事件監聽器](https://web.dev/articles/bfcache#never_use_the_unload_event)"
1291
+ },
1292
+ "core/audits/no-unload-listeners.js | failureTitle": {
1293
+ "message": "發現 `unload` 偵聽器"
1294
+ },
1295
+ "core/audits/no-unload-listeners.js | title": {
1296
+ "message": "避免 `unload` 事件偵聽器"
1297
+ },
1271
1298
  "core/audits/non-composited-animations.js | description": {
1272
1299
  "message": "未合成的動畫可能無法順暢播放,而且會增加累計版面配置轉移 (CLS)。[瞭解如何避免使用非合成動畫](https://developer.chrome.com/docs/lighthouse/performance/non-composited-animations/)"
1273
1300
  },
@@ -1454,6 +1481,15 @@
1454
1481
  "core/audits/seo/meta-description.js | title": {
1455
1482
  "message": "文件具有中繼說明"
1456
1483
  },
1484
+ "core/audits/seo/plugins.js | description": {
1485
+ "message": "搜尋引擎無法為外掛程式內容加入索引,而且很多裝置對外掛程式都設有限制甚至不提供支援。[進一步瞭解如何避免使用外掛程式](https://developer.chrome.com/docs/lighthouse/seo/plugins/)。"
1486
+ },
1487
+ "core/audits/seo/plugins.js | failureTitle": {
1488
+ "message": "文件使用外掛程式"
1489
+ },
1490
+ "core/audits/seo/plugins.js | title": {
1491
+ "message": "文件避免使用外掛程式"
1492
+ },
1457
1493
  "core/audits/seo/robots-txt.js | description": {
1458
1494
  "message": "如果您的 robots.txt 檔案格式錯誤,檢索器可能無法瞭解您偏好的網站檢索或加入索引方式。[進一步瞭解 robots.txt](https://developer.chrome.com/docs/lighthouse/seo/invalid-robots-txt/)。"
1459
1495
  },
@@ -1472,6 +1508,27 @@
1472
1508
  "core/audits/seo/robots-txt.js | title": {
1473
1509
  "message": "robots.txt 有效"
1474
1510
  },
1511
+ "core/audits/seo/tap-targets.js | description": {
1512
+ "message": "按鈕和連結等互動元素的大小應至少有 48x48 像素,或周圍應保留足夠空間以便使用者輕按,同時避免與其他元素重疊的情況。[進一步瞭解輕按目標](https://developer.chrome.com/docs/lighthouse/seo/tap-targets/)。"
1513
+ },
1514
+ "core/audits/seo/tap-targets.js | displayValue": {
1515
+ "message": "{decimalProportion, number, percent} 的輕按目標大小適中"
1516
+ },
1517
+ "core/audits/seo/tap-targets.js | explanationViewportMetaNotOptimized": {
1518
+ "message": "由於網頁沒有為流動裝置螢幕設定合適的檢視區中繼標記,因此輕按目標太小"
1519
+ },
1520
+ "core/audits/seo/tap-targets.js | failureTitle": {
1521
+ "message": "輕按目標未設定成適當大小"
1522
+ },
1523
+ "core/audits/seo/tap-targets.js | overlappingTargetHeader": {
1524
+ "message": "重疊的目標"
1525
+ },
1526
+ "core/audits/seo/tap-targets.js | tapTargetHeader": {
1527
+ "message": "輕按目標"
1528
+ },
1529
+ "core/audits/seo/tap-targets.js | title": {
1530
+ "message": "輕按目標已設定成適當大小"
1531
+ },
1475
1532
  "core/audits/server-response-time.js | description": {
1476
1533
  "message": "請確保主要文件的伺服器回應時間不會太長,因為這會影響所有其他要求。[進一步瞭解「首個字節時間」數據](https://developer.chrome.com/docs/lighthouse/performance/time-to-first-byte/)。"
1477
1534
  },
@@ -1661,7 +1718,7 @@
1661
1718
  "core/audits/work-during-interaction.js | presentationDelay": {
1662
1719
  "message": "螢幕畫面分享延遲"
1663
1720
  },
1664
- "core/audits/work-during-interaction.js | processingDuration": {
1721
+ "core/audits/work-during-interaction.js | processingTime": {
1665
1722
  "message": "處理時間"
1666
1723
  },
1667
1724
  "core/audits/work-during-interaction.js | title": {
@@ -1757,6 +1814,12 @@
1757
1814
  "core/config/default-config.js | firstPaintImprovementsGroupTitle": {
1758
1815
  "message": "首次繪製改進"
1759
1816
  },
1817
+ "core/config/default-config.js | loadOpportunitiesGroupDescription": {
1818
+ "message": "這些建議可加快網頁載入速度,但不會[直接影響](https://developer.chrome.com/docs/lighthouse/performance/performance-scoring/)「效能」分數。"
1819
+ },
1820
+ "core/config/default-config.js | loadOpportunitiesGroupTitle": {
1821
+ "message": "優化建議"
1822
+ },
1760
1823
  "core/config/default-config.js | metricGroupTitle": {
1761
1824
  "message": "數據"
1762
1825
  },
@@ -236,6 +236,15 @@
236
236
  "core/audits/accessibility/document-title.js | title": {
237
237
  "message": "文件具有 `<title>` 元素"
238
238
  },
239
+ "core/audits/accessibility/duplicate-id-active.js | description": {
240
+ "message": "所有可聚焦的元素都必須擁有專屬的 `id`,以確保輔助技術可查看這些元素。[瞭解如何修正 `id` 重複的問題](https://dequeuniversity.com/rules/axe/4.8/duplicate-id-active)。"
241
+ },
242
+ "core/audits/accessibility/duplicate-id-active.js | failureTitle": {
243
+ "message": "已啟用的可聚焦元素有重複的 `[id]` 屬性"
244
+ },
245
+ "core/audits/accessibility/duplicate-id-active.js | title": {
246
+ "message": "已啟用的可聚焦元素沒有重複的 `[id]` 屬性"
247
+ },
239
248
  "core/audits/accessibility/duplicate-id-aria.js | description": {
240
249
  "message": "ARIA ID 的值不得重複,以免輔助技術忽略其他重複的執行個體。[瞭解如何修正重複的 ARIA ID](https://dequeuniversity.com/rules/axe/4.8/duplicate-id-aria)。"
241
250
  },
@@ -1148,6 +1157,15 @@
1148
1157
  "core/audits/largest-contentful-paint-element.js | title": {
1149
1158
  "message": "最大內容繪製元素"
1150
1159
  },
1160
+ "core/audits/layout-shift-elements.js | columnContribution": {
1161
+ "message": "受版面配置位移影響的元素數量"
1162
+ },
1163
+ "core/audits/layout-shift-elements.js | description": {
1164
+ "message": "版面配置位移對這些 DOM 元素造成的影響最大。由於[執行時間較短](https://web.dev/articles/cls#what_is_cls),部分版面配置位移可能不會包含在 CLS 指標值中。[瞭解如何改善 CLS](https://web.dev/articles/optimize-cls)"
1165
+ },
1166
+ "core/audits/layout-shift-elements.js | title": {
1167
+ "message": "避免大量版面配置轉移"
1168
+ },
1151
1169
  "core/audits/layout-shifts.js | columnScore": {
1152
1170
  "message": "版面配置位移分數"
1153
1171
  },
@@ -1268,6 +1286,15 @@
1268
1286
  "core/audits/network-server-latency.js | title": {
1269
1287
  "message": "伺服器後端延遲時間"
1270
1288
  },
1289
+ "core/audits/no-unload-listeners.js | description": {
1290
+ "message": "`unload` 事件無法穩定觸發,監聽該活動可能會妨礙系統進行某些瀏覽器最佳化作業 (例如往返快取)。請改用 `pagehide` 或 `visibilitychange` 事件。[進一步瞭解卸載事件監聽器](https://web.dev/articles/bfcache#never_use_the_unload_event)"
1291
+ },
1292
+ "core/audits/no-unload-listeners.js | failureTitle": {
1293
+ "message": "註冊 `unload` 事件監聽器"
1294
+ },
1295
+ "core/audits/no-unload-listeners.js | title": {
1296
+ "message": "避免使用 `unload` 事件監聽器"
1297
+ },
1271
1298
  "core/audits/non-composited-animations.js | description": {
1272
1299
  "message": "未合成的動畫可能無法順暢播放,而且會增加 CLS。[瞭解如何避免使用非合成動畫](https://developer.chrome.com/docs/lighthouse/performance/non-composited-animations/)"
1273
1300
  },
@@ -1454,6 +1481,15 @@
1454
1481
  "core/audits/seo/meta-description.js | title": {
1455
1482
  "message": "文件具有中繼說明"
1456
1483
  },
1484
+ "core/audits/seo/plugins.js | description": {
1485
+ "message": "搜尋引擎無法為外掛程式內容建立索引,而且許多裝置對外掛程式設有限制或不提供支援。[進一步瞭解如何避免使用外掛程式](https://developer.chrome.com/docs/lighthouse/seo/plugins/)。"
1486
+ },
1487
+ "core/audits/seo/plugins.js | failureTitle": {
1488
+ "message": "文件使用外掛程式"
1489
+ },
1490
+ "core/audits/seo/plugins.js | title": {
1491
+ "message": "文件盡量不使用外掛程式"
1492
+ },
1457
1493
  "core/audits/seo/robots-txt.js | description": {
1458
1494
  "message": "如果 robots.txt 檔案格式錯誤,檢索器可能無法瞭解你偏好的網站檢索方式或索引建立方式。[進一步瞭解 robots.txt](https://developer.chrome.com/docs/lighthouse/seo/invalid-robots-txt/)。"
1459
1495
  },
@@ -1472,6 +1508,27 @@
1472
1508
  "core/audits/seo/robots-txt.js | title": {
1473
1509
  "message": "robots.txt 有效"
1474
1510
  },
1511
+ "core/audits/seo/tap-targets.js | description": {
1512
+ "message": "按鈕和連結等互動元素的大小應至少有 48x48 像素,或周圍保有足夠空間,方便使用者輕觸,同時避免與其他元素重疊的情況。[進一步瞭解輕觸目標](https://developer.chrome.com/docs/lighthouse/seo/tap-targets/)。"
1513
+ },
1514
+ "core/audits/seo/tap-targets.js | displayValue": {
1515
+ "message": "{decimalProportion, number, percent} 的輕觸目標大小適中"
1516
+ },
1517
+ "core/audits/seo/tap-targets.js | explanationViewportMetaNotOptimized": {
1518
+ "message": "輕觸目標太小,這是因為網頁沒有針對行動裝置螢幕設定合適的可視區域中繼標記"
1519
+ },
1520
+ "core/audits/seo/tap-targets.js | failureTitle": {
1521
+ "message": "輕觸目標未設定成適當大小"
1522
+ },
1523
+ "core/audits/seo/tap-targets.js | overlappingTargetHeader": {
1524
+ "message": "重疊的目標"
1525
+ },
1526
+ "core/audits/seo/tap-targets.js | tapTargetHeader": {
1527
+ "message": "輕觸目標"
1528
+ },
1529
+ "core/audits/seo/tap-targets.js | title": {
1530
+ "message": "輕觸目標已設定成適當大小"
1531
+ },
1475
1532
  "core/audits/server-response-time.js | description": {
1476
1533
  "message": "請確保伺服器能快速回應主要文件,因為這會影響到所有其他要求的回應時間。[進一步瞭解「第一個位元組時間」指標](https://developer.chrome.com/docs/lighthouse/performance/time-to-first-byte/)。"
1477
1534
  },
@@ -1661,7 +1718,7 @@
1661
1718
  "core/audits/work-during-interaction.js | presentationDelay": {
1662
1719
  "message": "回應顯示延遲"
1663
1720
  },
1664
- "core/audits/work-during-interaction.js | processingDuration": {
1721
+ "core/audits/work-during-interaction.js | processingTime": {
1665
1722
  "message": "處理時間"
1666
1723
  },
1667
1724
  "core/audits/work-during-interaction.js | title": {
@@ -1757,6 +1814,12 @@
1757
1814
  "core/config/default-config.js | firstPaintImprovementsGroupTitle": {
1758
1815
  "message": "改進首次繪製程序"
1759
1816
  },
1817
+ "core/config/default-config.js | loadOpportunitiesGroupDescription": {
1818
+ "message": "這些建議有助於提升網頁載入速度,但不會[直接影響](https://developer.chrome.com/docs/lighthouse/performance/performance-scoring/)「效能」分數。"
1819
+ },
1820
+ "core/config/default-config.js | loadOpportunitiesGroupTitle": {
1821
+ "message": "最佳化建議"
1822
+ },
1760
1823
  "core/config/default-config.js | metricGroupTitle": {
1761
1824
  "message": "指標"
1762
1825
  },
@@ -236,6 +236,15 @@
236
236
  "core/audits/accessibility/document-title.js | title": {
237
237
  "message": "文档包含 `<title>` 元素"
238
238
  },
239
+ "core/audits/accessibility/duplicate-id-active.js | description": {
240
+ "message": "所有可聚焦的元素都必须具有独一无二的 `id`,以确保能被辅助技术识别。[了解如何修正重复的 `id`](https://dequeuniversity.com/rules/axe/4.8/duplicate-id-active)。"
241
+ },
242
+ "core/audits/accessibility/duplicate-id-active.js | failureTitle": {
243
+ "message": "处于活动状态的可聚焦元素的 `[id]` 属性不是独一无二的"
244
+ },
245
+ "core/audits/accessibility/duplicate-id-active.js | title": {
246
+ "message": "处于活动状态的可聚焦元素的 `[id]` 属性都是独一无二的"
247
+ },
239
248
  "core/audits/accessibility/duplicate-id-aria.js | description": {
240
249
  "message": "ARIA ID 的值必须独一无二,才能防止其他实例被辅助技术忽略。[了解如何修正重复的 ARIA ID](https://dequeuniversity.com/rules/axe/4.8/duplicate-id-aria)。"
241
250
  },
@@ -1148,6 +1157,15 @@
1148
1157
  "core/audits/largest-contentful-paint-element.js | title": {
1149
1158
  "message": "最大内容渲染时间元素"
1150
1159
  },
1160
+ "core/audits/layout-shift-elements.js | columnContribution": {
1161
+ "message": "布局偏移的影响"
1162
+ },
1163
+ "core/audits/layout-shift-elements.js | description": {
1164
+ "message": "这些 DOM 元素受布局偏移的影响最大。由于[窗口化](https://web.dev/articles/cls#what_is_cls)的原因,某些布局偏移可能未包含在 CLS 指标值中。[了解如何改善 CLS](https://web.dev/articles/optimize-cls)"
1165
+ },
1166
+ "core/audits/layout-shift-elements.js | title": {
1167
+ "message": "请避免出现大幅度的布局偏移"
1168
+ },
1151
1169
  "core/audits/layout-shifts.js | columnScore": {
1152
1170
  "message": "布局偏移分数"
1153
1171
  },
@@ -1268,6 +1286,15 @@
1268
1286
  "core/audits/network-server-latency.js | title": {
1269
1287
  "message": "服务器后端延迟"
1270
1288
  },
1289
+ "core/audits/no-unload-listeners.js | description": {
1290
+ "message": "“`unload`”事件不会可靠地触发,而且监听该事件可能会妨碍系统实施“往返缓存”之类的浏览器优化策略。请改用“`pagehide`”或“`visibilitychange`”事件。[详细了解如何卸载事件监听器](https://web.dev/articles/bfcache#never_use_the_unload_event)"
1291
+ },
1292
+ "core/audits/no-unload-listeners.js | failureTitle": {
1293
+ "message": "注册“`unload`”事件监听器"
1294
+ },
1295
+ "core/audits/no-unload-listeners.js | title": {
1296
+ "message": "避免使用“`unload`”事件监听器"
1297
+ },
1271
1298
  "core/audits/non-composited-animations.js | description": {
1272
1299
  "message": "未合成的动画可能会卡顿并增加 CLS。[了解如何避免使用未合成的动画](https://developer.chrome.com/docs/lighthouse/performance/non-composited-animations/)"
1273
1300
  },
@@ -1454,6 +1481,15 @@
1454
1481
  "core/audits/seo/meta-description.js | title": {
1455
1482
  "message": "文档有 meta 描述"
1456
1483
  },
1484
+ "core/audits/seo/plugins.js | description": {
1485
+ "message": "搜索引擎无法将插件内容编入索引,而且许多设备都限制或不支持使用插件。[详细了解如何避免使用插件](https://developer.chrome.com/docs/lighthouse/seo/plugins/)。"
1486
+ },
1487
+ "core/audits/seo/plugins.js | failureTitle": {
1488
+ "message": "文档使用了插件"
1489
+ },
1490
+ "core/audits/seo/plugins.js | title": {
1491
+ "message": "文档中没有插件"
1492
+ },
1457
1493
  "core/audits/seo/robots-txt.js | description": {
1458
1494
  "message": "如果 robots.txt 文件的格式不正确,抓取工具可能无法理解您希望以何种方式抓取网站内容或将其编入索引。[详细了解 robots.txt](https://developer.chrome.com/docs/lighthouse/seo/invalid-robots-txt/)。"
1459
1495
  },
@@ -1472,6 +1508,27 @@
1472
1508
  "core/audits/seo/robots-txt.js | title": {
1473
1509
  "message": "robots.txt 有效"
1474
1510
  },
1511
+ "core/audits/seo/tap-targets.js | description": {
1512
+ "message": "交互式元素(例如按钮和链接)应足够大 (48x48px),或者周围有足够的空间以便用户轻松点按,且不遮挡其他元素。[详细了解点按目标](https://developer.chrome.com/docs/lighthouse/seo/tap-targets/)。"
1513
+ },
1514
+ "core/audits/seo/tap-targets.js | displayValue": {
1515
+ "message": "{decimalProportion, number, percent} 的点按目标大小合适"
1516
+ },
1517
+ "core/audits/seo/tap-targets.js | explanationViewportMetaNotOptimized": {
1518
+ "message": "点按目标过小,因为缺少已针对移动设备屏幕进行优化的 viewport meta 标记"
1519
+ },
1520
+ "core/audits/seo/tap-targets.js | failureTitle": {
1521
+ "message": "点按目标的大小不合适"
1522
+ },
1523
+ "core/audits/seo/tap-targets.js | overlappingTargetHeader": {
1524
+ "message": "点按目标重叠"
1525
+ },
1526
+ "core/audits/seo/tap-targets.js | tapTargetHeader": {
1527
+ "message": "点按目标"
1528
+ },
1529
+ "core/audits/seo/tap-targets.js | title": {
1530
+ "message": "点按目标的大小合适"
1531
+ },
1475
1532
  "core/audits/server-response-time.js | description": {
1476
1533
  "message": "请确保服务器响应主文档的用时较短,因为这会影响到所有其他请求的响应时长。[详细了解 Time to First Byte 指标](https://developer.chrome.com/docs/lighthouse/performance/time-to-first-byte/)。"
1477
1534
  },
@@ -1661,7 +1718,7 @@
1661
1718
  "core/audits/work-during-interaction.js | presentationDelay": {
1662
1719
  "message": "展示延迟时间"
1663
1720
  },
1664
- "core/audits/work-during-interaction.js | processingDuration": {
1721
+ "core/audits/work-during-interaction.js | processingTime": {
1665
1722
  "message": "处理时间"
1666
1723
  },
1667
1724
  "core/audits/work-during-interaction.js | title": {
@@ -1757,6 +1814,12 @@
1757
1814
  "core/config/default-config.js | firstPaintImprovementsGroupTitle": {
1758
1815
  "message": "改进首次绘制"
1759
1816
  },
1817
+ "core/config/default-config.js | loadOpportunitiesGroupDescription": {
1818
+ "message": "这些建议可以帮助您提高网页加载速度。它们不会[直接影响](https://developer.chrome.com/docs/lighthouse/performance/performance-scoring/)性能得分。"
1819
+ },
1820
+ "core/config/default-config.js | loadOpportunitiesGroupTitle": {
1821
+ "message": "优化建议"
1822
+ },
1760
1823
  "core/config/default-config.js | metricGroupTitle": {
1761
1824
  "message": "指标"
1762
1825
  },
package/tsconfig.json CHANGED
@@ -70,7 +70,6 @@
70
70
  "core/test/lib/i18n/i18n-test.js",
71
71
  "core/test/lib/icons-test.js",
72
72
  "core/test/lib/lantern/base-node-test.js",
73
- "core/test/lib/lantern/metrics/*",
74
73
  "core/test/lib/lantern/page-dependency-graph-test.js",
75
74
  "core/test/lib/lantern/simulator/connection-pool-test.js",
76
75
  "core/test/lib/lantern/simulator/dns-cache-test.js",
@@ -89,8 +89,8 @@ interface PublicGathererArtifacts {
89
89
  LinkElements: Artifacts.LinkElement[];
90
90
  /** The values of the <meta> elements in the head. */
91
91
  MetaElements: Array<{name?: string, content?: string, property?: string, httpEquiv?: string, charset?: string, node: Artifacts.NodeDetails}>;
92
- /** Information on all scripts in the page. */
93
- Scripts: Artifacts.Script[];
92
+ /** Information on all script elements in the page. Also contains the content of all requested scripts and the networkRecord requestId that contained their content. Note, HTML documents will have one entry per script tag, all with the same requestId. */
93
+ ScriptElements: Array<Artifacts.ScriptElement>;
94
94
  /** The dimensions and devicePixelRatio of the loaded viewport. */
95
95
  ViewportDimensions: Artifacts.ViewportDimensions;
96
96
  }
@@ -119,6 +119,8 @@ export interface GathererArtifacts extends PublicGathererArtifacts {
119
119
  Doctype: Artifacts.Doctype | null;
120
120
  /** Information on the size of all DOM nodes in the page and the most extreme members. */
121
121
  DOMStats: Artifacts.DOMStats;
122
+ /** Relevant attributes and child properties of all <object>s, <embed>s and <applet>s in the page. */
123
+ EmbeddedContent: Artifacts.EmbeddedContentInfo[];
122
124
  /** Information on poorly sized font usage and the text affected by it. */
123
125
  FontSize: Artifacts.FontSize;
124
126
  /** All the input elements, including associated form and label elements. */
@@ -144,6 +146,8 @@ export interface GathererArtifacts extends PublicGathererArtifacts {
144
146
  RobotsTxt: {status: number|null, content: string|null, errorMessage?: string};
145
147
  /** The result of calling the shared trace engine root cause analysis. */
146
148
  RootCauses: Artifacts.TraceEngineRootCauses;
149
+ /** Information on all scripts in the page. */
150
+ Scripts: Artifacts.Script[];
147
151
  /** Version information for all ServiceWorkers active after the first page load. */
148
152
  ServiceWorker: {versions: Crdp.ServiceWorker.ServiceWorkerVersion[], registrations: Crdp.ServiceWorker.ServiceWorkerRegistration[]};
149
153
  /** Source maps of scripts executed in the page. */
@@ -247,6 +251,16 @@ declare module Artifacts {
247
251
  depth: NodeDetails & {max: number;};
248
252
  }
249
253
 
254
+ interface EmbeddedContentInfo {
255
+ tagName: string;
256
+ type: string | null;
257
+ src: string | null;
258
+ data: string | null;
259
+ code: string | null;
260
+ params: Array<{name: string; value: string}>;
261
+ node: Artifacts.NodeDetails;
262
+ }
263
+
250
264
  interface IFrameElement {
251
265
  /** The `id` attribute of the iframe. */
252
266
  id: string,
@@ -549,7 +563,7 @@ declare module Artifacts {
549
563
  }
550
564
 
551
565
  interface TraceElement {
552
- traceEventType: 'largest-contentful-paint'|'layout-shift'|'animation'|'responsiveness';
566
+ traceEventType: 'largest-contentful-paint'|'layout-shift'|'layout-shift-element'|'animation'|'responsiveness';
553
567
  node: NodeDetails;
554
568
  nodeId: number;
555
569
  animations?: {name?: string, failureReasonsMask?: number, unsupportedProperties?: string[]}[];
package/types/config.d.ts CHANGED
@@ -83,6 +83,7 @@ declare module Config {
83
83
  weight: number;
84
84
  group?: string;
85
85
  acronym?: string;
86
+ relevantAudits?: string[];
86
87
  }
87
88
 
88
89
  type Settings = ConfigSettings;
@@ -9,6 +9,10 @@ import Treemap from './treemap.js';
9
9
 
10
10
  /** Common properties for all details types. */
11
11
  interface BaseDetails {
12
+ /** If present and audit is part of the performance category, audit is treated as an Opportunity. */
13
+ overallSavingsMs?: number;
14
+ /** Optional additional Opportunity information. */
15
+ overallSavingsBytes?: number;
12
16
  /** Additional information, usually used for including debug or meta information in the LHR */
13
17
  debugData?: Details.DebugData;
14
18
  }
@@ -81,15 +85,6 @@ declare module Details {
81
85
  isEntityGrouped?: boolean;
82
86
  /** Column keys to skip summing. If omitted, all column types supported are summed. */
83
87
  skipSumming?: Array<string>;
84
- /**
85
- * @deprecated
86
- * Historically this represents the time saved on the entire page load. It's mostly used as an
87
- * alias for `metricSavings.LCP` now. We recommend using `metricSavings` directly for more
88
- * metric-specific savings estimates.
89
- */
90
- overallSavingsMs?: number;
91
- /** Total byte savings covered by this audit. */
92
- overallSavingsBytes?: number;
93
88
  }
94
89
 
95
90
  interface Screenshot extends BaseDetails {
@@ -116,6 +116,8 @@ declare module Result {
116
116
  group?: string;
117
117
  /** The conventional acronym for the audit/metric. */
118
118
  acronym?: string;
119
+ /** Any audit IDs closely relevant to this one. */
120
+ relevantAudits?: string[];
119
121
  }
120
122
 
121
123
  interface ReportGroup {
@@ -1,79 +0,0 @@
1
- export type Node = import('../base-node.js').Node;
2
- export type NetworkNode<T> = import('../network-node.js').NetworkNode<T>;
3
- export type CpuNode = import('../cpu-node.js').CPUNode;
4
- /** @typedef {import('../base-node.js').Node} Node */
5
- /** @template T @typedef {import('../network-node.js').NetworkNode<T>} NetworkNode */
6
- /** @typedef {import('../cpu-node.js').CPUNode} CpuNode */
7
- export class FirstContentfulPaint extends Metric {
8
- /**
9
- * @template T
10
- * @typedef FirstPaintBasedGraphOpts
11
- * @property {number} cutoffTimestamp The timestamp used to filter out tasks that occured after
12
- * our paint of interest. Typically this is First Contentful Paint or First Meaningful Paint.
13
- * @property {function(NetworkNode<T>):boolean} treatNodeAsRenderBlocking The function that determines
14
- * which resources should be considered *possibly* render-blocking.
15
- * @property {(function(CpuNode):boolean)=} additionalCpuNodesToTreatAsRenderBlocking The function that
16
- * determines which CPU nodes should also be included in our blocking node IDs set,
17
- * beyond what getRenderBlockingNodeData() already includes.
18
- */
19
- /**
20
- * This function computes the set of URLs that *appeared* to be render-blocking based on our filter,
21
- * *but definitely were not* render-blocking based on the timing of their EvaluateScript task.
22
- * It also computes the set of corresponding CPU node ids that were needed for the paint at the
23
- * given timestamp.
24
- *
25
- * @template [T=unknown]
26
- * @param {Node} graph
27
- * @param {FirstPaintBasedGraphOpts<T>} opts
28
- * @return {{definitelyNotRenderBlockingScriptUrls: Set<string>, renderBlockingCpuNodeIds: Set<string>}}
29
- */
30
- static getRenderBlockingNodeData<T = unknown>(graph: Node, { cutoffTimestamp, treatNodeAsRenderBlocking, additionalCpuNodesToTreatAsRenderBlocking }: {
31
- /**
32
- * The timestamp used to filter out tasks that occured after
33
- * our paint of interest. Typically this is First Contentful Paint or First Meaningful Paint.
34
- */
35
- cutoffTimestamp: number;
36
- /**
37
- * The function that determines
38
- * which resources should be considered *possibly* render-blocking.
39
- */
40
- treatNodeAsRenderBlocking: (arg0: import("../network-node.js").NetworkNode<T>) => boolean;
41
- /**
42
- * The function that
43
- * determines which CPU nodes should also be included in our blocking node IDs set,
44
- * beyond what getRenderBlockingNodeData() already includes.
45
- */
46
- additionalCpuNodesToTreatAsRenderBlocking?: ((arg0: CpuNode) => boolean) | undefined;
47
- }): {
48
- definitelyNotRenderBlockingScriptUrls: Set<string>;
49
- renderBlockingCpuNodeIds: Set<string>;
50
- };
51
- /**
52
- * This function computes the graph required for the first paint of interest.
53
- *
54
- * @template [T=unknown]
55
- * @param {Node} dependencyGraph
56
- * @param {FirstPaintBasedGraphOpts<T>} opts
57
- * @return {Node}
58
- */
59
- static getFirstPaintBasedGraph<T_1 = unknown>(dependencyGraph: Node, { cutoffTimestamp, treatNodeAsRenderBlocking, additionalCpuNodesToTreatAsRenderBlocking }: {
60
- /**
61
- * The timestamp used to filter out tasks that occured after
62
- * our paint of interest. Typically this is First Contentful Paint or First Meaningful Paint.
63
- */
64
- cutoffTimestamp: number;
65
- /**
66
- * The function that determines
67
- * which resources should be considered *possibly* render-blocking.
68
- */
69
- treatNodeAsRenderBlocking: (arg0: import("../network-node.js").NetworkNode<T_1>) => boolean;
70
- /**
71
- * The function that
72
- * determines which CPU nodes should also be included in our blocking node IDs set,
73
- * beyond what getRenderBlockingNodeData() already includes.
74
- */
75
- additionalCpuNodesToTreatAsRenderBlocking?: ((arg0: CpuNode) => boolean) | undefined;
76
- }): Node;
77
- }
78
- import { Metric } from '../metric.js';
79
- //# sourceMappingURL=first-contentful-paint.d.ts.map