@paulirish/trace_engine 0.0.67-beta.2 → 0.0.68

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 (766) hide show
  1. package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts +13 -0
  2. package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts.map +1 -0
  3. package/.tmp/tsbuildinfo/analyze-trace.d.mts +17 -0
  4. package/.tmp/tsbuildinfo/analyze-trace.d.mts.map +1 -0
  5. package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts +2 -0
  6. package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts.map +1 -0
  7. package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts +3 -0
  8. package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts.map +1 -0
  9. package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -0
  10. package/README.md +22 -62
  11. package/analyze-inspector-issues.mjs +60 -0
  12. package/analyze-trace.mjs +144 -6
  13. package/core/common/ParsedURL.d.ts +0 -2
  14. package/core/common/ParsedURL.js +512 -0
  15. package/core/common/ParsedURL.js.map +1 -0
  16. package/core/common/common.d.ts +8 -33
  17. package/core/common/common.js +2 -0
  18. package/core/host/host.d.ts +1 -13
  19. package/core/host/host.js +1 -0
  20. package/core/i18n/i18n.d.ts +20 -8
  21. package/core/i18n/i18n.js +15 -0
  22. package/core/platform/ArrayUtilities.js +224 -0
  23. package/core/platform/ArrayUtilities.js.map +1 -0
  24. package/core/platform/Brand.js +5 -0
  25. package/core/platform/Brand.js.map +1 -0
  26. package/core/platform/Constructor.js +5 -0
  27. package/core/platform/Constructor.js.map +1 -0
  28. package/core/platform/DateUtilities.js +14 -0
  29. package/core/platform/DateUtilities.js.map +1 -0
  30. package/core/platform/DevToolsPath.js +28 -0
  31. package/core/platform/DevToolsPath.js.map +1 -0
  32. package/core/platform/HostRuntime.js +8 -0
  33. package/core/platform/HostRuntime.js.map +1 -0
  34. package/core/platform/KeyboardUtilities.js +34 -0
  35. package/core/platform/KeyboardUtilities.js.map +1 -0
  36. package/core/platform/MapUtilities.js +80 -0
  37. package/core/platform/MapUtilities.js.map +1 -0
  38. package/core/platform/MimeType.js +157 -0
  39. package/core/platform/MimeType.js.map +1 -0
  40. package/core/platform/NumberUtilities.js +73 -0
  41. package/core/platform/NumberUtilities.js.map +1 -0
  42. package/core/platform/Size.js +36 -0
  43. package/core/platform/Size.js.map +1 -0
  44. package/core/platform/StringUtilities.d.ts +15 -4
  45. package/core/platform/StringUtilities.js +767 -0
  46. package/core/platform/StringUtilities.js.map +1 -0
  47. package/core/platform/Timing.js +10 -0
  48. package/core/platform/Timing.js.map +1 -0
  49. package/core/platform/TypedArrayUtilities.js +158 -0
  50. package/core/platform/TypedArrayUtilities.js.map +1 -0
  51. package/core/platform/TypescriptUtilities.js +17 -0
  52. package/core/platform/TypescriptUtilities.js.map +1 -0
  53. package/core/platform/UIString.d.ts +5 -2
  54. package/core/platform/UIString.js +5 -0
  55. package/core/platform/UIString.js.map +1 -0
  56. package/core/platform/UserVisibleError.d.ts +1 -12
  57. package/core/platform/UserVisibleError.js +23 -0
  58. package/core/platform/UserVisibleError.js.map +1 -0
  59. package/core/platform/api/HostRuntime.d.ts +1 -0
  60. package/core/platform/api/HostRuntime.js +5 -0
  61. package/core/platform/api/HostRuntime.js.map +1 -0
  62. package/core/platform/api/api-tsconfig.json +58 -0
  63. package/core/platform/api/api-tsconfig.ref.json +26 -0
  64. package/core/platform/api/api.js +6 -0
  65. package/core/platform/api/api.js.map +1 -0
  66. package/core/platform/bundle-tsconfig.json +59 -0
  67. package/core/platform/bundle-tsconfig.ref.json +27 -0
  68. package/core/platform/foundation_unittests-tsconfig.json +73 -0
  69. package/core/platform/foundation_unittests-tsconfig.ref.json +40 -0
  70. package/core/platform/foundation_unittests_node_typecheck-tsconfig.json +69 -0
  71. package/core/platform/platform-tsconfig.json +81 -0
  72. package/core/platform/platform-tsconfig.ref.json +49 -0
  73. package/core/platform/platform.js +28 -0
  74. package/core/platform/platform.js.map +1 -0
  75. package/core/platform/platform_node_typecheck-tsconfig.json +78 -0
  76. package/core/platform/platform_node_typecheck.stamp +0 -0
  77. package/core/root/root.d.ts +1 -4
  78. package/core/root/root.js +1 -0
  79. package/core/sdk/sdk.d.ts +27 -97
  80. package/core/sdk/sdk.js +1 -0
  81. package/generated/protocol.d.ts +34 -6
  82. package/generated/protocol.js +3312 -0
  83. package/locales/af.json +94 -97
  84. package/locales/am.json +353 -356
  85. package/locales/ar.json +354 -357
  86. package/locales/as.json +352 -355
  87. package/locales/az.json +343 -346
  88. package/locales/be.json +353 -356
  89. package/locales/bg.json +353 -356
  90. package/locales/bn.json +353 -356
  91. package/locales/bs.json +247 -250
  92. package/locales/ca.json +285 -288
  93. package/locales/cs.json +338 -341
  94. package/locales/cy.json +124 -127
  95. package/locales/da.json +202 -205
  96. package/locales/de.json +222 -225
  97. package/locales/el.json +338 -341
  98. package/locales/en-GB.json +78 -81
  99. package/locales/en-US.json +250 -256
  100. package/locales/en-XL.json +1052 -0
  101. package/locales/es-419.json +278 -281
  102. package/locales/es.json +279 -282
  103. package/locales/et.json +237 -240
  104. package/locales/eu.json +124 -127
  105. package/locales/fa.json +353 -356
  106. package/locales/fi.json +283 -286
  107. package/locales/fil.json +32 -35
  108. package/locales/fr-CA.json +310 -313
  109. package/locales/fr.json +307 -310
  110. package/locales/gl.json +263 -266
  111. package/locales/gu.json +354 -357
  112. package/locales/he.json +354 -357
  113. package/locales/hi.json +338 -341
  114. package/locales/hr.json +238 -241
  115. package/locales/hu.json +344 -347
  116. package/locales/hy.json +353 -356
  117. package/locales/id.json +67 -70
  118. package/locales/is.json +305 -308
  119. package/locales/it.json +175 -178
  120. package/locales/ja.json +353 -356
  121. package/locales/ka.json +354 -357
  122. package/locales/kk.json +354 -357
  123. package/locales/km.json +353 -356
  124. package/locales/kn.json +354 -357
  125. package/locales/ko.json +353 -356
  126. package/locales/ky.json +352 -355
  127. package/locales/lo.json +354 -357
  128. package/locales/lt.json +322 -325
  129. package/locales/lv.json +319 -322
  130. package/locales/mk.json +354 -357
  131. package/locales/ml.json +353 -356
  132. package/locales/mn.json +353 -356
  133. package/locales/mr.json +353 -356
  134. package/locales/ms.json +14 -17
  135. package/locales/my.json +352 -355
  136. package/locales/ne.json +338 -341
  137. package/locales/nl.json +91 -94
  138. package/locales/no.json +179 -182
  139. package/locales/or.json +353 -356
  140. package/locales/pa.json +353 -356
  141. package/locales/pl.json +309 -312
  142. package/locales/pt-PT.json +275 -278
  143. package/locales/pt.json +268 -271
  144. package/locales/ro.json +309 -312
  145. package/locales/ru.json +353 -356
  146. package/locales/si.json +354 -357
  147. package/locales/sk.json +335 -338
  148. package/locales/sl.json +220 -223
  149. package/locales/sq.json +318 -321
  150. package/locales/sr-Latn.json +255 -258
  151. package/locales/sr.json +354 -357
  152. package/locales/sv.json +281 -284
  153. package/locales/sw.json +68 -71
  154. package/locales/ta.json +354 -357
  155. package/locales/te.json +352 -355
  156. package/locales/th.json +354 -357
  157. package/locales/tr.json +328 -331
  158. package/locales/uk.json +353 -356
  159. package/locales/ur.json +354 -357
  160. package/locales/uz.json +168 -171
  161. package/locales/vi.json +354 -357
  162. package/locales/zh-HK.json +354 -357
  163. package/locales/zh-TW.json +353 -356
  164. package/locales/zh.json +353 -356
  165. package/locales/zu.json +52 -55
  166. package/models/cpu_profile/CPUProfileDataModel.d.ts +0 -33
  167. package/models/cpu_profile/CPUProfileDataModel.js +517 -0
  168. package/models/cpu_profile/CPUProfileDataModel.js.map +1 -0
  169. package/models/cpu_profile/ProfileTreeModel.d.ts +1 -2
  170. package/models/cpu_profile/ProfileTreeModel.js +90 -0
  171. package/models/cpu_profile/ProfileTreeModel.js.map +1 -0
  172. package/models/cpu_profile/bundle-tsconfig.json +59 -0
  173. package/models/cpu_profile/bundle-tsconfig.ref.json +27 -0
  174. package/models/cpu_profile/cpu_profile-tsconfig.json +63 -0
  175. package/models/cpu_profile/cpu_profile-tsconfig.ref.json +31 -0
  176. package/models/cpu_profile/cpu_profile.js +7 -0
  177. package/models/cpu_profile/cpu_profile.js.map +1 -0
  178. package/models/cpu_profile/cpu_profile_node_typecheck-tsconfig.json +60 -0
  179. package/models/cpu_profile/cpu_profile_node_typecheck.stamp +0 -0
  180. package/models/cpu_profile/foundation_unittests-tsconfig.json +63 -0
  181. package/models/cpu_profile/foundation_unittests-tsconfig.ref.json +30 -0
  182. package/models/cpu_profile/foundation_unittests_node_typecheck-tsconfig.json +59 -0
  183. package/models/crux-manager/crux-manager.d.ts +3 -1
  184. package/models/crux-manager/crux-manager.js +1 -0
  185. package/models/trace/EntityMapper.js +133 -0
  186. package/models/trace/EntityMapper.js.map +1 -0
  187. package/models/trace/EventsSerializer.d.ts +1 -0
  188. package/models/trace/EventsSerializer.js +113 -0
  189. package/models/trace/EventsSerializer.js.map +1 -0
  190. package/models/trace/LanternComputationData.js +394 -0
  191. package/models/trace/LanternComputationData.js.map +1 -0
  192. package/models/trace/ModelImpl.js +179 -0
  193. package/models/trace/ModelImpl.js.map +1 -0
  194. package/models/trace/Name.js +115 -0
  195. package/models/trace/Name.js.map +1 -0
  196. package/models/trace/Processor.js +616 -0
  197. package/models/trace/Processor.js.map +1 -0
  198. package/models/trace/Styles.d.ts +2 -2
  199. package/models/trace/Styles.js +836 -0
  200. package/models/trace/Styles.js.map +1 -0
  201. package/models/trace/bundle-tsconfig.json +77 -0
  202. package/models/trace/bundle-tsconfig.ref.json +45 -0
  203. package/models/trace/extras/FilmStrip.js +45 -0
  204. package/models/trace/extras/FilmStrip.js.map +1 -0
  205. package/models/trace/extras/Initiators.js +47 -0
  206. package/models/trace/extras/Initiators.js.map +1 -0
  207. package/models/trace/extras/MainThreadActivity.js +77 -0
  208. package/models/trace/extras/MainThreadActivity.js.map +1 -0
  209. package/models/trace/extras/ScriptDuplication.js +163 -0
  210. package/models/trace/extras/ScriptDuplication.js.map +1 -0
  211. package/models/trace/extras/StackTraceForEvent.js +192 -0
  212. package/models/trace/extras/StackTraceForEvent.js.map +1 -0
  213. package/models/trace/extras/ThirdParties.js +119 -0
  214. package/models/trace/extras/ThirdParties.js.map +1 -0
  215. package/models/trace/extras/TraceFilter.js +51 -0
  216. package/models/trace/extras/TraceFilter.js.map +1 -0
  217. package/models/trace/extras/TraceTree.js +678 -0
  218. package/models/trace/extras/TraceTree.js.map +1 -0
  219. package/models/trace/extras/bundle-tsconfig.json +59 -0
  220. package/models/trace/extras/bundle-tsconfig.ref.json +27 -0
  221. package/models/trace/extras/extras-tsconfig.json +81 -0
  222. package/models/trace/extras/extras-tsconfig.ref.json +49 -0
  223. package/models/trace/extras/extras.js +12 -0
  224. package/models/trace/extras/extras.js.map +1 -0
  225. package/models/trace/extras/extras_node_typecheck-tsconfig.json +78 -0
  226. package/models/trace/extras/extras_node_typecheck.stamp +0 -0
  227. package/models/trace/extras/foundation_unittests-tsconfig.json +91 -0
  228. package/models/trace/extras/foundation_unittests-tsconfig.ref.json +58 -0
  229. package/models/trace/extras/foundation_unittests_node_typecheck-tsconfig.json +87 -0
  230. package/models/trace/foundation_unittests-tsconfig.json +70 -0
  231. package/models/trace/foundation_unittests-tsconfig.ref.json +37 -0
  232. package/models/trace/foundation_unittests_node_typecheck-tsconfig.json +66 -0
  233. package/models/trace/handlers/AnimationFramesHandler.js +110 -0
  234. package/models/trace/handlers/AnimationFramesHandler.js.map +1 -0
  235. package/models/trace/handlers/AnimationHandler.js +27 -0
  236. package/models/trace/handlers/AnimationHandler.js.map +1 -0
  237. package/models/trace/handlers/AsyncJSCallsHandler.js +188 -0
  238. package/models/trace/handlers/AsyncJSCallsHandler.js.map +1 -0
  239. package/models/trace/handlers/DOMStatsHandler.js +22 -0
  240. package/models/trace/handlers/DOMStatsHandler.js.map +1 -0
  241. package/models/trace/handlers/ExtensionTraceDataHandler.js +264 -0
  242. package/models/trace/handlers/ExtensionTraceDataHandler.js.map +1 -0
  243. package/models/trace/handlers/FlowsHandler.js +155 -0
  244. package/models/trace/handlers/FlowsHandler.js.map +1 -0
  245. package/models/trace/handlers/FramesHandler.js +491 -0
  246. package/models/trace/handlers/FramesHandler.js.map +1 -0
  247. package/models/trace/handlers/GPUHandler.js +36 -0
  248. package/models/trace/handlers/GPUHandler.js.map +1 -0
  249. package/models/trace/handlers/ImagePaintingHandler.js +148 -0
  250. package/models/trace/handlers/ImagePaintingHandler.js.map +1 -0
  251. package/models/trace/handlers/InitiatorsHandler.js +169 -0
  252. package/models/trace/handlers/InitiatorsHandler.js.map +1 -0
  253. package/models/trace/handlers/InvalidationsHandler.js +125 -0
  254. package/models/trace/handlers/InvalidationsHandler.js.map +1 -0
  255. package/models/trace/handlers/LargestImagePaintHandler.js +86 -0
  256. package/models/trace/handlers/LargestImagePaintHandler.js.map +1 -0
  257. package/models/trace/handlers/LargestTextPaintHandler.js +28 -0
  258. package/models/trace/handlers/LargestTextPaintHandler.js.map +1 -0
  259. package/models/trace/handlers/LayerTreeHandler.js +104 -0
  260. package/models/trace/handlers/LayerTreeHandler.js.map +1 -0
  261. package/models/trace/handlers/LayoutShiftsHandler.js +449 -0
  262. package/models/trace/handlers/LayoutShiftsHandler.js.map +1 -0
  263. package/models/trace/handlers/MemoryHandler.js +22 -0
  264. package/models/trace/handlers/MemoryHandler.js.map +1 -0
  265. package/models/trace/handlers/MetaHandler.js +442 -0
  266. package/models/trace/handlers/MetaHandler.js.map +1 -0
  267. package/models/trace/handlers/ModelHandlers.js +33 -0
  268. package/models/trace/handlers/ModelHandlers.js.map +1 -0
  269. package/models/trace/handlers/NetworkRequestsHandler.js +584 -0
  270. package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -0
  271. package/models/trace/handlers/PageFramesHandler.js +43 -0
  272. package/models/trace/handlers/PageFramesHandler.js.map +1 -0
  273. package/models/trace/handlers/PageLoadMetricsHandler.js +463 -0
  274. package/models/trace/handlers/PageLoadMetricsHandler.js.map +1 -0
  275. package/models/trace/handlers/RendererHandler.js +346 -0
  276. package/models/trace/handlers/RendererHandler.js.map +1 -0
  277. package/models/trace/handlers/SamplesHandler.js +264 -0
  278. package/models/trace/handlers/SamplesHandler.js.map +1 -0
  279. package/models/trace/handlers/ScreenshotsHandler.js +56 -0
  280. package/models/trace/handlers/ScreenshotsHandler.js.map +1 -0
  281. package/models/trace/handlers/ScriptsHandler.js +277 -0
  282. package/models/trace/handlers/ScriptsHandler.js.map +1 -0
  283. package/models/trace/handlers/SelectorStatsHandler.js +72 -0
  284. package/models/trace/handlers/SelectorStatsHandler.js.map +1 -0
  285. package/models/trace/handlers/Threads.js +108 -0
  286. package/models/trace/handlers/Threads.js.map +1 -0
  287. package/models/trace/handlers/UserInteractionsHandler.js +319 -0
  288. package/models/trace/handlers/UserInteractionsHandler.js.map +1 -0
  289. package/models/trace/handlers/UserTimingsHandler.js +194 -0
  290. package/models/trace/handlers/UserTimingsHandler.js.map +1 -0
  291. package/models/trace/handlers/WarningsHandler.js +135 -0
  292. package/models/trace/handlers/WarningsHandler.js.map +1 -0
  293. package/models/trace/handlers/WorkersHandler.js +34 -0
  294. package/models/trace/handlers/WorkersHandler.js.map +1 -0
  295. package/models/trace/handlers/bundle-tsconfig.json +59 -0
  296. package/models/trace/handlers/bundle-tsconfig.ref.json +27 -0
  297. package/models/trace/handlers/foundation_unittests-tsconfig.json +102 -0
  298. package/models/trace/handlers/foundation_unittests-tsconfig.ref.json +69 -0
  299. package/models/trace/handlers/foundation_unittests_node_typecheck-tsconfig.json +98 -0
  300. package/models/trace/handlers/handlers-tsconfig.json +112 -0
  301. package/models/trace/handlers/handlers-tsconfig.ref.json +80 -0
  302. package/models/trace/handlers/handlers.js +8 -0
  303. package/models/trace/handlers/handlers.js.map +1 -0
  304. package/models/trace/handlers/handlers_node_typecheck-tsconfig.json +109 -0
  305. package/models/trace/handlers/handlers_node_typecheck.stamp +0 -0
  306. package/models/trace/handlers/helpers.js +167 -0
  307. package/models/trace/handlers/helpers.js.map +1 -0
  308. package/models/trace/handlers/types.js +2 -0
  309. package/models/trace/handlers/types.js.map +1 -0
  310. package/models/trace/helpers/Extensions.js +42 -0
  311. package/models/trace/helpers/Extensions.js.map +1 -0
  312. package/models/trace/helpers/Network.js +103 -0
  313. package/models/trace/helpers/Network.js.map +1 -0
  314. package/models/trace/helpers/SamplesIntegrator.js +527 -0
  315. package/models/trace/helpers/SamplesIntegrator.js.map +1 -0
  316. package/models/trace/helpers/SyntheticEvents.d.ts +0 -8
  317. package/models/trace/helpers/SyntheticEvents.js +73 -0
  318. package/models/trace/helpers/SyntheticEvents.js.map +1 -0
  319. package/models/trace/helpers/Timing.js +200 -0
  320. package/models/trace/helpers/Timing.js.map +1 -0
  321. package/models/trace/helpers/Trace.js +844 -0
  322. package/models/trace/helpers/Trace.js.map +1 -0
  323. package/models/trace/helpers/TreeHelpers.js +255 -0
  324. package/models/trace/helpers/TreeHelpers.js.map +1 -0
  325. package/models/trace/helpers/bundle-tsconfig.json +59 -0
  326. package/models/trace/helpers/bundle-tsconfig.ref.json +27 -0
  327. package/models/trace/helpers/foundation_unittests-tsconfig.json +73 -0
  328. package/models/trace/helpers/foundation_unittests-tsconfig.ref.json +40 -0
  329. package/models/trace/helpers/foundation_unittests_node_typecheck-tsconfig.json +69 -0
  330. package/models/trace/helpers/helpers-tsconfig.json +77 -0
  331. package/models/trace/helpers/helpers-tsconfig.ref.json +45 -0
  332. package/models/trace/helpers/helpers.js +11 -0
  333. package/models/trace/helpers/helpers.js.map +1 -0
  334. package/models/trace/helpers/helpers_node_typecheck-tsconfig.json +74 -0
  335. package/models/trace/helpers/helpers_node_typecheck.stamp +0 -0
  336. package/models/trace/insights/CLSCulprits.d.ts +14 -14
  337. package/models/trace/insights/CLSCulprits.js +519 -0
  338. package/models/trace/insights/CLSCulprits.js.map +1 -0
  339. package/models/trace/insights/Cache.d.ts +6 -6
  340. package/models/trace/insights/Cache.js +210 -0
  341. package/models/trace/insights/Cache.js.map +1 -0
  342. package/models/trace/insights/CharacterSet.d.ts +8 -8
  343. package/models/trace/insights/CharacterSet.js +132 -0
  344. package/models/trace/insights/CharacterSet.js.map +1 -0
  345. package/models/trace/insights/Common.js +367 -0
  346. package/models/trace/insights/Common.js.map +1 -0
  347. package/models/trace/insights/DOMSize.d.ts +13 -13
  348. package/models/trace/insights/DOMSize.js +182 -0
  349. package/models/trace/insights/DOMSize.js.map +1 -0
  350. package/models/trace/insights/DocumentLatency.d.ts +11 -11
  351. package/models/trace/insights/DocumentLatency.js +259 -0
  352. package/models/trace/insights/DocumentLatency.js.map +1 -0
  353. package/models/trace/insights/DuplicatedJavaScript.d.ts +5 -5
  354. package/models/trace/insights/DuplicatedJavaScript.js +110 -0
  355. package/models/trace/insights/DuplicatedJavaScript.js.map +1 -0
  356. package/models/trace/insights/FontDisplay.d.ts +5 -5
  357. package/models/trace/insights/FontDisplay.js +93 -0
  358. package/models/trace/insights/FontDisplay.js.map +1 -0
  359. package/models/trace/insights/ForcedReflow.d.ts +7 -7
  360. package/models/trace/insights/ForcedReflow.js +162 -0
  361. package/models/trace/insights/ForcedReflow.js.map +1 -0
  362. package/models/trace/insights/INPBreakdown.d.ts +8 -8
  363. package/models/trace/insights/INPBreakdown.js +130 -0
  364. package/models/trace/insights/INPBreakdown.js.map +1 -0
  365. package/models/trace/insights/ImageDelivery.d.ts +12 -12
  366. package/models/trace/insights/ImageDelivery.js +264 -0
  367. package/models/trace/insights/ImageDelivery.js.map +1 -0
  368. package/models/trace/insights/LCPBreakdown.d.ts +11 -11
  369. package/models/trace/insights/LCPBreakdown.js +200 -0
  370. package/models/trace/insights/LCPBreakdown.js.map +1 -0
  371. package/models/trace/insights/LCPDiscovery.d.ts +10 -10
  372. package/models/trace/insights/LCPDiscovery.js +190 -0
  373. package/models/trace/insights/LCPDiscovery.js.map +1 -0
  374. package/models/trace/insights/LegacyJavaScript.d.ts +5 -5
  375. package/models/trace/insights/LegacyJavaScript.js +99 -0
  376. package/models/trace/insights/LegacyJavaScript.js.map +1 -0
  377. package/models/trace/insights/Models.js +23 -0
  378. package/models/trace/insights/Models.js.map +1 -0
  379. package/models/trace/insights/ModernHTTP.d.ts +5 -5
  380. package/models/trace/insights/ModernHTTP.js +205 -0
  381. package/models/trace/insights/ModernHTTP.js.map +1 -0
  382. package/models/trace/insights/NetworkDependencyTree.d.ts +19 -19
  383. package/models/trace/insights/NetworkDependencyTree.js +551 -0
  384. package/models/trace/insights/NetworkDependencyTree.js.map +1 -0
  385. package/models/trace/insights/RenderBlocking.d.ts +5 -5
  386. package/models/trace/insights/RenderBlocking.js +213 -0
  387. package/models/trace/insights/RenderBlocking.js.map +1 -0
  388. package/models/trace/insights/SlowCSSSelector.d.ts +10 -10
  389. package/models/trace/insights/SlowCSSSelector.js +140 -0
  390. package/models/trace/insights/SlowCSSSelector.js.map +1 -0
  391. package/models/trace/insights/Statistics.js +93 -0
  392. package/models/trace/insights/Statistics.js.map +1 -0
  393. package/models/trace/insights/ThirdParties.d.ts +6 -6
  394. package/models/trace/insights/ThirdParties.js +110 -0
  395. package/models/trace/insights/ThirdParties.js.map +1 -0
  396. package/models/trace/insights/Viewport.d.ts +3 -3
  397. package/models/trace/insights/Viewport.js +105 -0
  398. package/models/trace/insights/Viewport.js.map +1 -0
  399. package/models/trace/insights/bundle-tsconfig.json +59 -0
  400. package/models/trace/insights/bundle-tsconfig.ref.json +27 -0
  401. package/models/trace/insights/foundation_unittests-tsconfig.json +98 -0
  402. package/models/trace/insights/foundation_unittests-tsconfig.ref.json +65 -0
  403. package/models/trace/insights/foundation_unittests_node_typecheck-tsconfig.json +94 -0
  404. package/models/trace/insights/insights-tsconfig.json +114 -0
  405. package/models/trace/insights/insights-tsconfig.ref.json +82 -0
  406. package/models/trace/insights/insights.js +10 -0
  407. package/models/trace/insights/insights.js.map +1 -0
  408. package/models/trace/insights/insights_node_typecheck-tsconfig.json +111 -0
  409. package/models/trace/insights/insights_node_typecheck.stamp +0 -0
  410. package/models/trace/insights/types.d.ts +3 -3
  411. package/models/trace/insights/types.js +41 -0
  412. package/models/trace/insights/types.js.map +1 -0
  413. package/models/trace/lantern/bundle-tsconfig.json +71 -0
  414. package/models/trace/lantern/bundle-tsconfig.ref.json +39 -0
  415. package/models/trace/lantern/core/LanternError.js +7 -0
  416. package/models/trace/lantern/core/LanternError.js.map +1 -0
  417. package/models/trace/lantern/core/NetworkAnalyzer.js +496 -0
  418. package/models/trace/lantern/core/NetworkAnalyzer.js.map +1 -0
  419. package/models/trace/lantern/core/bundle-tsconfig.json +59 -0
  420. package/models/trace/lantern/core/bundle-tsconfig.ref.json +27 -0
  421. package/models/trace/lantern/core/core-tsconfig.json +60 -0
  422. package/models/trace/lantern/core/core-tsconfig.ref.json +28 -0
  423. package/models/trace/lantern/core/core.js +6 -0
  424. package/models/trace/lantern/core/core.js.map +1 -0
  425. package/models/trace/lantern/core/core_node_typecheck-tsconfig.json +57 -0
  426. package/models/trace/lantern/core/core_node_typecheck.stamp +0 -0
  427. package/models/trace/lantern/core/foundation_unittests-tsconfig.json +69 -0
  428. package/models/trace/lantern/core/foundation_unittests-tsconfig.ref.json +36 -0
  429. package/models/trace/lantern/core/foundation_unittests_node_typecheck-tsconfig.json +65 -0
  430. package/models/trace/lantern/graph/BaseNode.d.ts +2 -2
  431. package/models/trace/lantern/graph/BaseNode.js +277 -0
  432. package/models/trace/lantern/graph/BaseNode.js.map +1 -0
  433. package/models/trace/lantern/graph/CPUNode.js +80 -0
  434. package/models/trace/lantern/graph/CPUNode.js.map +1 -0
  435. package/models/trace/lantern/graph/NetworkNode.js +95 -0
  436. package/models/trace/lantern/graph/NetworkNode.js.map +1 -0
  437. package/models/trace/lantern/graph/PageDependencyGraph.js +574 -0
  438. package/models/trace/lantern/graph/PageDependencyGraph.js.map +1 -0
  439. package/models/trace/lantern/graph/bundle-tsconfig.json +59 -0
  440. package/models/trace/lantern/graph/bundle-tsconfig.ref.json +27 -0
  441. package/models/trace/lantern/graph/foundation_unittests-tsconfig.json +61 -0
  442. package/models/trace/lantern/graph/foundation_unittests-tsconfig.ref.json +28 -0
  443. package/models/trace/lantern/graph/foundation_unittests_node_typecheck-tsconfig.json +57 -0
  444. package/models/trace/lantern/graph/graph-tsconfig.json +65 -0
  445. package/models/trace/lantern/graph/graph-tsconfig.ref.json +33 -0
  446. package/models/trace/lantern/graph/graph.js +8 -0
  447. package/models/trace/lantern/graph/graph.js.map +1 -0
  448. package/models/trace/lantern/graph/graph_node_typecheck-tsconfig.json +62 -0
  449. package/models/trace/lantern/graph/graph_node_typecheck.stamp +0 -0
  450. package/models/trace/lantern/lantern.js +10 -0
  451. package/models/trace/lantern/lantern.js.map +1 -0
  452. package/models/trace/lantern/metrics/FirstContentfulPaint.js +137 -0
  453. package/models/trace/lantern/metrics/FirstContentfulPaint.js.map +1 -0
  454. package/models/trace/lantern/metrics/Interactive.js +68 -0
  455. package/models/trace/lantern/metrics/Interactive.js.map +1 -0
  456. package/models/trace/lantern/metrics/LargestContentfulPaint.d.ts +5 -1
  457. package/models/trace/lantern/metrics/LargestContentfulPaint.js +187 -0
  458. package/models/trace/lantern/metrics/LargestContentfulPaint.js.map +1 -0
  459. package/models/trace/lantern/metrics/MaxPotentialFID.js +49 -0
  460. package/models/trace/lantern/metrics/MaxPotentialFID.js.map +1 -0
  461. package/models/trace/lantern/metrics/Metric.js +69 -0
  462. package/models/trace/lantern/metrics/Metric.js.map +1 -0
  463. package/models/trace/lantern/metrics/SpeedIndex.js +102 -0
  464. package/models/trace/lantern/metrics/SpeedIndex.js.map +1 -0
  465. package/models/trace/lantern/metrics/TBTUtils.js +65 -0
  466. package/models/trace/lantern/metrics/TBTUtils.js.map +1 -0
  467. package/models/trace/lantern/metrics/TotalBlockingTime.js +79 -0
  468. package/models/trace/lantern/metrics/TotalBlockingTime.js.map +1 -0
  469. package/models/trace/lantern/metrics/bundle-tsconfig.json +59 -0
  470. package/models/trace/lantern/metrics/bundle-tsconfig.ref.json +27 -0
  471. package/models/trace/lantern/metrics/foundation_unittests-tsconfig.json +76 -0
  472. package/models/trace/lantern/metrics/foundation_unittests-tsconfig.ref.json +43 -0
  473. package/models/trace/lantern/metrics/foundation_unittests_node_typecheck-tsconfig.json +72 -0
  474. package/models/trace/lantern/metrics/metrics-tsconfig.json +75 -0
  475. package/models/trace/lantern/metrics/metrics-tsconfig.ref.json +43 -0
  476. package/models/trace/lantern/metrics/metrics.js +12 -0
  477. package/models/trace/lantern/metrics/metrics.js.map +1 -0
  478. package/models/trace/lantern/metrics/metrics_node_typecheck-tsconfig.json +72 -0
  479. package/models/trace/lantern/metrics/metrics_node_typecheck.stamp +0 -0
  480. package/models/trace/lantern/simulation/ConnectionPool.js +116 -0
  481. package/models/trace/lantern/simulation/ConnectionPool.js.map +1 -0
  482. package/models/trace/lantern/simulation/Constants.js +45 -0
  483. package/models/trace/lantern/simulation/Constants.js.map +1 -0
  484. package/models/trace/lantern/simulation/DNSCache.js +48 -0
  485. package/models/trace/lantern/simulation/DNSCache.js.map +1 -0
  486. package/models/trace/lantern/simulation/SimulationTimingMap.js +135 -0
  487. package/models/trace/lantern/simulation/SimulationTimingMap.js.map +1 -0
  488. package/models/trace/lantern/simulation/Simulator.js +461 -0
  489. package/models/trace/lantern/simulation/Simulator.js.map +1 -0
  490. package/models/trace/lantern/simulation/TCPConnection.js +155 -0
  491. package/models/trace/lantern/simulation/TCPConnection.js.map +1 -0
  492. package/models/trace/lantern/simulation/bundle-tsconfig.json +59 -0
  493. package/models/trace/lantern/simulation/bundle-tsconfig.ref.json +27 -0
  494. package/models/trace/lantern/simulation/foundation_unittests-tsconfig.json +75 -0
  495. package/models/trace/lantern/simulation/foundation_unittests-tsconfig.ref.json +42 -0
  496. package/models/trace/lantern/simulation/foundation_unittests_node_typecheck-tsconfig.json +71 -0
  497. package/models/trace/lantern/simulation/simulation-tsconfig.json +70 -0
  498. package/models/trace/lantern/simulation/simulation-tsconfig.ref.json +38 -0
  499. package/models/trace/lantern/simulation/simulation.js +10 -0
  500. package/models/trace/lantern/simulation/simulation.js.map +1 -0
  501. package/models/trace/lantern/simulation/simulation_node_typecheck-tsconfig.json +67 -0
  502. package/models/trace/lantern/simulation/simulation_node_typecheck.stamp +0 -0
  503. package/models/trace/lantern/testing/bundle-tsconfig.json +60 -0
  504. package/models/trace/lantern/testing/bundle-tsconfig.ref.json +27 -0
  505. package/models/trace/lantern/testing/testing-tsconfig.json +63 -0
  506. package/models/trace/lantern/testing/testing-tsconfig.ref.json +30 -0
  507. package/models/trace/lantern/types/Lantern.d.ts +23 -19
  508. package/models/trace/lantern/types/Lantern.js +25 -0
  509. package/models/trace/lantern/types/Lantern.js.map +1 -0
  510. package/models/trace/lantern/types/bundle-tsconfig.json +59 -0
  511. package/models/trace/lantern/types/bundle-tsconfig.ref.json +27 -0
  512. package/models/trace/lantern/types/types-tsconfig.json +59 -0
  513. package/models/trace/lantern/types/types-tsconfig.ref.json +27 -0
  514. package/models/trace/lantern/types/types.js +5 -0
  515. package/models/trace/lantern/types/types.js.map +1 -0
  516. package/models/trace/lantern/types/types_node_typecheck-tsconfig.json +56 -0
  517. package/models/trace/lantern/types/types_node_typecheck.stamp +0 -0
  518. package/models/trace/trace-tsconfig.json +89 -0
  519. package/models/trace/trace-tsconfig.ref.json +57 -0
  520. package/models/trace/trace.js +16 -544
  521. package/models/trace/trace.js.map +1 -0
  522. package/models/trace/trace_node_typecheck-tsconfig.json +86 -0
  523. package/models/trace/trace_node_typecheck.stamp +0 -0
  524. package/models/trace/types/Configuration.d.ts +2 -2
  525. package/models/trace/types/Configuration.js +19 -0
  526. package/models/trace/types/Configuration.js.map +1 -0
  527. package/models/trace/types/Extensions.d.ts +1 -1
  528. package/models/trace/types/Extensions.js +38 -0
  529. package/models/trace/types/Extensions.js.map +1 -0
  530. package/models/trace/types/File.d.ts +9 -3
  531. package/models/trace/types/File.js +92 -0
  532. package/models/trace/types/File.js.map +1 -0
  533. package/models/trace/types/Overlays.js +5 -0
  534. package/models/trace/types/Overlays.js.map +1 -0
  535. package/models/trace/types/Timing.js +16 -0
  536. package/models/trace/types/Timing.js.map +1 -0
  537. package/models/trace/types/TraceEvents.d.ts +21 -16
  538. package/models/trace/types/TraceEvents.js +983 -0
  539. package/models/trace/types/TraceEvents.js.map +1 -0
  540. package/models/trace/types/bundle-tsconfig.json +59 -0
  541. package/models/trace/types/bundle-tsconfig.ref.json +27 -0
  542. package/models/trace/types/foundation_unittests-tsconfig.json +67 -0
  543. package/models/trace/types/foundation_unittests-tsconfig.ref.json +34 -0
  544. package/models/trace/types/foundation_unittests_node_typecheck-tsconfig.json +63 -0
  545. package/models/trace/types/types-tsconfig.json +76 -0
  546. package/models/trace/types/types-tsconfig.ref.json +44 -0
  547. package/models/trace/types/types.js +10 -0
  548. package/models/trace/types/types.js.map +1 -0
  549. package/models/trace/types/types_node_typecheck-tsconfig.json +73 -0
  550. package/models/trace/types/types_node_typecheck.stamp +0 -0
  551. package/package.json +8 -40
  552. package/test/invalid-animation-events.json.gz +0 -0
  553. package/test/test-trace-engine.mjs +191 -0
  554. package/third_party/legacy-javascript/bundle-tsconfig.json +59 -0
  555. package/third_party/legacy-javascript/bundle-tsconfig.ref.json +27 -0
  556. package/third_party/legacy-javascript/legacy-javascript-tsconfig.ref.json +15 -0
  557. package/third_party/legacy-javascript/legacy-javascript.js +3 -0
  558. package/third_party/legacy-javascript/legacy-javascript.js.map +1 -0
  559. package/third_party/legacy-javascript/lib/legacy-javascript.js +1119 -0
  560. package/third_party/marked/marked.d.ts +1 -2
  561. package/third_party/marked/marked.js +1 -0
  562. package/third_party/third-party-web/third-party-web.d.ts +1 -2
  563. package/third_party/third-party-web/third-party-web.js +1 -0
  564. package/tsconfig.json +29 -0
  565. package/core/common/Base64.d.ts +0 -12
  566. package/core/common/CharacterIdMap.d.ts +0 -5
  567. package/core/common/Color.d.ts +0 -357
  568. package/core/common/ColorConverter.d.ts +0 -26
  569. package/core/common/ColorUtils.d.ts +0 -45
  570. package/core/common/Console.d.ts +0 -54
  571. package/core/common/Debouncer.d.ts +0 -8
  572. package/core/common/EventTarget.d.ts +0 -22
  573. package/core/common/Gzip.d.ts +0 -23
  574. package/core/common/JavaScriptMetaData.d.ts +0 -20
  575. package/core/common/Lazy.d.ts +0 -4
  576. package/core/common/MapWithDefault.d.ts +0 -9
  577. package/core/common/Mutex.d.ts +0 -13
  578. package/core/common/Object.d.ts +0 -20
  579. package/core/common/Progress.d.ts +0 -47
  580. package/core/common/ResolverBase.d.ts +0 -29
  581. package/core/common/ResourceType.d.ts +0 -52
  582. package/core/common/ReturnToPanel.d.ts +0 -10
  583. package/core/common/Revealer.d.ts +0 -66
  584. package/core/common/Runnable.d.ts +0 -14
  585. package/core/common/SegmentedRange.d.ts +0 -14
  586. package/core/common/SettingRegistration.d.ts +0 -136
  587. package/core/common/Settings.d.ts +0 -228
  588. package/core/common/SimpleHistoryManager.d.ts +0 -20
  589. package/core/common/Srcset.d.ts +0 -16
  590. package/core/common/StringOutputStream.d.ts +0 -10
  591. package/core/common/TextDictionary.d.ts +0 -11
  592. package/core/common/Throttler.d.ts +0 -12
  593. package/core/common/Trie.d.ts +0 -24
  594. package/core/common/VersionController.d.ts +0 -85
  595. package/core/host/AidaClient.d.ts +0 -73
  596. package/core/host/AidaClientTypes.d.ts +0 -355
  597. package/core/host/AidaGcaTranslation.d.ts +0 -10
  598. package/core/host/DispatchHttpRequestClient.d.ts +0 -14
  599. package/core/host/GcaClient.d.ts +0 -14
  600. package/core/host/GcaTypes.d.ts +0 -411
  601. package/core/host/GdpClient.d.ts +0 -84
  602. package/core/host/InspectorFrontendHost.d.ts +0 -29
  603. package/core/host/InspectorFrontendHostAPI.d.ts +0 -425
  604. package/core/host/InspectorFrontendHostStub.d.ts +0 -151
  605. package/core/host/Platform.d.ts +0 -16
  606. package/core/host/ResourceLoader.d.ts +0 -15
  607. package/core/host/UserMetrics.d.ts +0 -116
  608. package/core/host/UserMetricsEnums.d.ts +0 -888
  609. package/core/i18n/ByteUtilities.d.ts +0 -11
  610. package/core/i18n/DevToolsLocale.d.ts +0 -41
  611. package/core/i18n/NumberFormatter.d.ts +0 -11
  612. package/core/i18n/i18nImpl.d.ts +0 -64
  613. package/core/i18n/i18nTypes.d.ts +0 -5
  614. package/core/i18n/locales.d.ts +0 -15
  615. package/core/i18n/time-utilities.d.ts +0 -16
  616. package/core/platform/browser/HostRuntime.d.ts +0 -2
  617. package/core/platform/browser/browser.d.ts +0 -2
  618. package/core/platform/node/HostRuntime.d.ts +0 -2
  619. package/core/platform/node/node.d.ts +0 -2
  620. package/core/protocol_client/CDPConnection.d.ts +0 -77
  621. package/core/protocol_client/ConnectionTransport.d.ts +0 -9
  622. package/core/protocol_client/DevToolsCDPConnection.d.ts +0 -16
  623. package/core/protocol_client/InspectorBackend.d.ts +0 -223
  624. package/core/protocol_client/protocol_client.d.ts +0 -5
  625. package/core/root/DevToolsContext.d.ts +0 -34
  626. package/core/root/ExperimentNames.d.ts +0 -9
  627. package/core/root/Runtime.d.ts +0 -353
  628. package/core/sdk/AccessibilityModel.d.ts +0 -76
  629. package/core/sdk/AnimationModel.d.ts +0 -161
  630. package/core/sdk/AutofillModel.d.ts +0 -23
  631. package/core/sdk/CPUProfilerModel.d.ts +0 -46
  632. package/core/sdk/CPUThrottlingManager.d.ts +0 -47
  633. package/core/sdk/CSSContainerQuery.d.ts +0 -42
  634. package/core/sdk/CSSFontFace.d.ts +0 -10
  635. package/core/sdk/CSSLayer.d.ts +0 -9
  636. package/core/sdk/CSSLocation.d.ts +0 -14
  637. package/core/sdk/CSSMatchedStyles.d.ts +0 -138
  638. package/core/sdk/CSSMedia.d.ts +0 -36
  639. package/core/sdk/CSSMetadata.d.ts +0 -87
  640. package/core/sdk/CSSModel.d.ts +0 -185
  641. package/core/sdk/CSSNavigation.d.ts +0 -10
  642. package/core/sdk/CSSProperty.d.ts +0 -53
  643. package/core/sdk/CSSPropertyParser.d.ts +0 -126
  644. package/core/sdk/CSSPropertyParserMatchers.d.ts +0 -442
  645. package/core/sdk/CSSQuery.d.ts +0 -22
  646. package/core/sdk/CSSRule.d.ts +0 -132
  647. package/core/sdk/CSSScope.d.ts +0 -9
  648. package/core/sdk/CSSStartingStyle.d.ts +0 -9
  649. package/core/sdk/CSSStyleDeclaration.d.ts +0 -38
  650. package/core/sdk/CSSStyleSheetHeader.d.ts +0 -53
  651. package/core/sdk/CSSSupports.d.ts +0 -10
  652. package/core/sdk/CategorizedBreakpoint.d.ts +0 -42
  653. package/core/sdk/ChildTargetManager.d.ts +0 -40
  654. package/core/sdk/CompilerSourceMappingContentProvider.d.ts +0 -12
  655. package/core/sdk/Connections.d.ts +0 -36
  656. package/core/sdk/ConsoleModel.d.ts +0 -127
  657. package/core/sdk/ConsoleModelTypes.d.ts +0 -6
  658. package/core/sdk/Cookie.d.ts +0 -68
  659. package/core/sdk/CookieModel.d.ts +0 -31
  660. package/core/sdk/CookieParser.d.ts +0 -14
  661. package/core/sdk/CrashReportContextModel.d.ts +0 -8
  662. package/core/sdk/DOMDebuggerModel.d.ts +0 -127
  663. package/core/sdk/DOMModel.d.ts +0 -440
  664. package/core/sdk/DOMStorageModel.d.ts +0 -79
  665. package/core/sdk/DebuggerModel.d.ts +0 -305
  666. package/core/sdk/EmulationModel.d.ts +0 -95
  667. package/core/sdk/EnhancedTracesParser.d.ts +0 -105
  668. package/core/sdk/EventBreakpointsModel.d.ts +0 -66
  669. package/core/sdk/FrameAssociated.d.ts +0 -6
  670. package/core/sdk/FrameManager.d.ts +0 -68
  671. package/core/sdk/HeapProfilerModel.d.ts +0 -75
  672. package/core/sdk/HttpReasonPhraseStrings.d.ts +0 -5
  673. package/core/sdk/IOModel.d.ts +0 -10
  674. package/core/sdk/IsolateManager.d.ts +0 -53
  675. package/core/sdk/IssuesModel.d.ts +0 -28
  676. package/core/sdk/LayerTreeBase.d.ts +0 -70
  677. package/core/sdk/LogModel.d.ts +0 -20
  678. package/core/sdk/NetworkManager.d.ts +0 -418
  679. package/core/sdk/NetworkRequest.d.ts +0 -497
  680. package/core/sdk/NetworkRequestAccess.d.ts +0 -91
  681. package/core/sdk/OverlayColorGenerator.d.ts +0 -14
  682. package/core/sdk/OverlayModel.d.ts +0 -186
  683. package/core/sdk/OverlayPersistentHighlighter.d.ts +0 -116
  684. package/core/sdk/PageFunctions.d.ts +0 -22
  685. package/core/sdk/PageLoad.d.ts +0 -14
  686. package/core/sdk/PageResourceLoader.d.ts +0 -111
  687. package/core/sdk/PaintProfiler.d.ts +0 -43
  688. package/core/sdk/PerformanceMetricsModel.d.ts +0 -12
  689. package/core/sdk/PreloadingModel.d.ts +0 -146
  690. package/core/sdk/RehydratingConnection.d.ts +0 -73
  691. package/core/sdk/RehydratingObject.d.ts +0 -59
  692. package/core/sdk/RemoteObject.d.ts +0 -210
  693. package/core/sdk/Resource.d.ts +0 -36
  694. package/core/sdk/ResourceTreeModel.d.ts +0 -280
  695. package/core/sdk/RuntimeModel.d.ts +0 -164
  696. package/core/sdk/SDKModel.d.ts +0 -30
  697. package/core/sdk/SDKSettings.d.ts +0 -54
  698. package/core/sdk/ScopeTreeCache.d.ts +0 -21
  699. package/core/sdk/ScreenCaptureModel.d.ts +0 -69
  700. package/core/sdk/Script.d.ts +0 -134
  701. package/core/sdk/SecurityOrigin.d.ts +0 -108
  702. package/core/sdk/SecurityOriginManager.d.ts +0 -23
  703. package/core/sdk/ServerSentEvents.d.ts +0 -18
  704. package/core/sdk/ServerSentEventsProtocol.d.ts +0 -18
  705. package/core/sdk/ServerTiming.d.ts +0 -24
  706. package/core/sdk/ServiceWorkerCacheModel.d.ts +0 -71
  707. package/core/sdk/ServiceWorkerManager.d.ts +0 -125
  708. package/core/sdk/SourceMap.d.ts +0 -211
  709. package/core/sdk/SourceMapCache.d.ts +0 -12
  710. package/core/sdk/SourceMapFunctionRanges.d.ts +0 -23
  711. package/core/sdk/SourceMapManager.d.ts +0 -46
  712. package/core/sdk/SourceMapRangeMappings.d.ts +0 -15
  713. package/core/sdk/SourceMapScopeChainEntry.d.ts +0 -23
  714. package/core/sdk/SourceMapScopesInfo.d.ts +0 -184
  715. package/core/sdk/StorageBucketsModel.d.ts +0 -48
  716. package/core/sdk/StorageKeyManager.d.ts +0 -38
  717. package/core/sdk/Target.d.ts +0 -79
  718. package/core/sdk/TargetManager.d.ts +0 -92
  719. package/core/sdk/TraceObject.d.ts +0 -43
  720. package/core/sdk/WebAuthnModel.d.ts +0 -29
  721. package/core/text_utils/CodeMirrorUtils.d.ts +0 -3
  722. package/core/text_utils/ContentData.d.ts +0 -94
  723. package/core/text_utils/ContentProvider.d.ts +0 -42
  724. package/core/text_utils/Markdown.d.ts +0 -13
  725. package/core/text_utils/StaticContentProvider.d.ts +0 -13
  726. package/core/text_utils/StreamingContentData.d.ts +0 -49
  727. package/core/text_utils/Text.d.ts +0 -19
  728. package/core/text_utils/TextCursor.d.ts +0 -9
  729. package/core/text_utils/TextRange.d.ts +0 -81
  730. package/core/text_utils/TextUtils.d.ts +0 -97
  731. package/core/text_utils/WasmDisassembly.d.ts +0 -29
  732. package/core/text_utils/text_utils.d.ts +0 -12
  733. package/entrypoints/formatter_actions/formatter_actions.d.ts +0 -65
  734. package/generated/InspectorBackendCommands.d.ts +0 -14
  735. package/generated/SupportedCSSProperties.d.ts +0 -18
  736. package/generated/protocol-mapping.d.ts +0 -5985
  737. package/generated/protocol-proxy-api.d.ts +0 -5447
  738. package/index.d.ts +0 -2
  739. package/index.js +0 -6
  740. package/models/crux-manager/CrUXManager.d.ts +0 -107
  741. package/models/emulation/DeviceModeModel.d.ts +0 -157
  742. package/models/emulation/EmulatedDevices.d.ts +0 -148
  743. package/models/emulation/emulation.d.ts +0 -3
  744. package/models/formatter/FormatterWorkerPool.d.ts +0 -58
  745. package/models/formatter/ScriptFormatter.d.ts +0 -11
  746. package/models/formatter/formatter.d.ts +0 -3
  747. package/third_party/codemirror.next/codemirror.next.d.ts +0 -9196
  748. package/third_party/i18n/i18n-impl.d.ts +0 -25
  749. package/third_party/i18n/i18n.d.ts +0 -3
  750. package/third_party/i18n/localized-string-set.d.ts +0 -49
  751. package/third_party/intl-messageformat/intl-messageformat.d.ts +0 -1
  752. package/third_party/marked/package/lib/marked.esm.d.ts +0 -760
  753. package/third_party/source-map-scopes-codec/package/src/builder/builder.d.ts +0 -70
  754. package/third_party/source-map-scopes-codec/package/src/builder/safe_builder.d.ts +0 -40
  755. package/third_party/source-map-scopes-codec/package/src/codec.d.ts +0 -49
  756. package/third_party/source-map-scopes-codec/package/src/decode/decode.d.ts +0 -33
  757. package/third_party/source-map-scopes-codec/package/src/encode/encode.d.ts +0 -8
  758. package/third_party/source-map-scopes-codec/package/src/encode/encoder.d.ts +0 -9
  759. package/third_party/source-map-scopes-codec/package/src/mod.d.ts +0 -5
  760. package/third_party/source-map-scopes-codec/package/src/scopes.d.ts +0 -169
  761. package/third_party/source-map-scopes-codec/package/src/util.d.ts +0 -5
  762. package/third_party/source-map-scopes-codec/package/src/vlq.d.ts +0 -14
  763. package/third_party/source-map-scopes-codec/source-map-scopes-codec.d.ts +0 -1
  764. package/third_party/third-party-web/lib/nostats-subset.d.ts +0 -2
  765. package/third_party/third-party-web/package/lib/index.d.ts +0 -34
  766. package/third_party/third-party-web/package/lib/subsets/nostats.d.ts +0 -1
@@ -0,0 +1,99 @@
1
+ // Copyright 2025 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+ import * as i18n from '../../../core/i18n/i18n.js';
5
+ import * as LegacyJavaScriptLib from '../../../third_party/legacy-javascript/legacy-javascript.js';
6
+ import * as Helpers from '../helpers/helpers.js';
7
+ import { estimateCompressionRatioForScript, metricSavingsForWastedBytes } from './Common.js';
8
+ import { InsightCategory, InsightKeys, } from './types.js';
9
+ const { detectLegacyJavaScript } = LegacyJavaScriptLib.LegacyJavaScript;
10
+ export const UIStrings = {
11
+ /**
12
+ * @description Title of an insight that identifies polyfills for modern JavaScript features, and recommends their removal.
13
+ */
14
+ title: 'Legacy JavaScript',
15
+ /**
16
+ * @description Description of an insight that identifies polyfills for modern JavaScript features, and recommends their removal.
17
+ */
18
+ description: 'Polyfills and transforms enable older browsers to use new JavaScript features. However, many aren’t necessary for modern browsers. Consider modifying your JavaScript build process to not transpile [Baseline](https://web.dev/articles/baseline-and-polyfills) features, unless you know you must support older browsers. [Learn why most sites can deploy ES6+ code without transpiling](https://developer.chrome.com/docs/performance/insights/legacy-javascript).',
19
+ /**
20
+ * @description Label for a column in a data table; entries will be the individual JavaScript scripts.
21
+ */
22
+ columnScript: 'Script',
23
+ /**
24
+ * @description Label for a column in a data table; entries will be the number of wasted bytes (aka the estimated savings in terms of bytes).
25
+ */
26
+ columnWastedBytes: 'Wasted bytes',
27
+ /**
28
+ * @description Message shown when no legacy JavaScript is found.
29
+ */
30
+ noLegacyJavaScript: 'No legacy JavaScript found',
31
+ };
32
+ const str_ = i18n.i18n.registerUIStrings('models/trace/insights/LegacyJavaScript.ts', UIStrings);
33
+ export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
34
+ const BYTE_THRESHOLD = 5000;
35
+ function finalize(partialModel) {
36
+ const requests = [...partialModel.legacyJavaScriptResults.keys()].map(script => script.request).filter(e => !!e);
37
+ return {
38
+ insightKey: InsightKeys.LEGACY_JAVASCRIPT,
39
+ strings: UIStrings,
40
+ title: i18nString(UIStrings.title),
41
+ description: i18nString(UIStrings.description),
42
+ docs: 'https://developer.chrome.com/docs/performance/insights/legacy-javascript',
43
+ category: InsightCategory.ALL,
44
+ state: requests.length ? 'fail' : 'pass',
45
+ relatedEvents: [...new Set(requests)],
46
+ ...partialModel,
47
+ };
48
+ }
49
+ export function isLegacyJavaScript(model) {
50
+ return model.insightKey === InsightKeys.LEGACY_JAVASCRIPT;
51
+ }
52
+ export function generateInsight(data, context) {
53
+ const scripts = data.Scripts.scripts.filter(script => {
54
+ if (script.frame !== context.frameId) {
55
+ return false;
56
+ }
57
+ if (script.url?.startsWith('chrome-extension://')) {
58
+ return false;
59
+ }
60
+ return Helpers.Timing.timestampIsInBounds(context.bounds, script.ts) ||
61
+ (script.request && Helpers.Timing.eventIsInBounds(script.request, context.bounds));
62
+ });
63
+ const legacyJavaScriptResults = new Map();
64
+ const wastedBytesByRequestId = new Map();
65
+ for (const script of scripts) {
66
+ if (!script.content || script.content.length < BYTE_THRESHOLD) {
67
+ continue;
68
+ }
69
+ const result = detectLegacyJavaScript(script.content, script.sourceMap);
70
+ if (result.estimatedByteSavings < BYTE_THRESHOLD) {
71
+ continue;
72
+ }
73
+ // Translate from resource size to transfer size.
74
+ const compressionRatio = estimateCompressionRatioForScript(script);
75
+ const transferSize = Math.round(result.estimatedByteSavings * compressionRatio);
76
+ result.estimatedByteSavings = transferSize;
77
+ legacyJavaScriptResults.set(script, result);
78
+ if (script.request) {
79
+ const requestId = script.request.args.data.requestId;
80
+ wastedBytesByRequestId.set(requestId, transferSize);
81
+ }
82
+ }
83
+ const sorted = new Map([...legacyJavaScriptResults].sort((a, b) => b[1].estimatedByteSavings - a[1].estimatedByteSavings));
84
+ return finalize({
85
+ legacyJavaScriptResults: sorted,
86
+ metricSavings: metricSavingsForWastedBytes(wastedBytesByRequestId, context),
87
+ wastedBytes: wastedBytesByRequestId.values().reduce((acc, cur) => acc + cur, 0),
88
+ });
89
+ }
90
+ export function createOverlays(model) {
91
+ return [...model.legacyJavaScriptResults.keys()].map(script => script.request).filter(e => !!e).map(request => {
92
+ return {
93
+ type: 'ENTRY_OUTLINE',
94
+ entry: request,
95
+ outlineReason: 'ERROR',
96
+ };
97
+ });
98
+ }
99
+ //# sourceMappingURL=LegacyJavaScript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegacyJavaScript.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/LegacyJavaScript.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,mBAAmB,MAAM,6DAA6D,CAAC;AAEnG,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AAGjD,OAAO,EAAC,iCAAiC,EAAE,2B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AM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAC5G,OAAO;YACL,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,OAAO;YACd,aAAa,EAAE,OAAO;SACvB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright 2025 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as LegacyJavaScriptLib from '../../../third_party/legacy-javascript/legacy-javascript.js';\nimport type * as Handlers from '../handlers/handlers.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport type * as Types from '../types/types.js';\n\nimport {estimateCompressionRatioForScript, metricSavingsForWastedBytes} from './Common.js';\nimport {\n InsightCategory,\n InsightKeys,\n type InsightModel,\n type InsightSetContext,\n type PartialInsightModel,\n} from './types.js';\n\nconst {detectLegacyJavaScript} = LegacyJavaScriptLib.LegacyJavaScript;\n\nexport const UIStrings = {\n /**\n * @description Title of an insight that identifies polyfills for modern JavaScript features, and recommends their removal.\n */\n title: 'Legacy JavaScript',\n /**\n * @description Description of an insight that identifies polyfills for modern JavaScript features, and recommends their removal.\n */\n description:\n 'Polyfills and transforms enable older browsers to use new JavaScript features. However, many aren’t necessary for modern browsers. Consider modifying your JavaScript build process to not transpile [Baseline](https://web.dev/articles/baseline-and-polyfills) features, unless you know you must support older browsers. [Learn why most sites can deploy ES6+ code without transpiling](https://developer.chrome.com/docs/performance/insights/legacy-javascript).',\n /**\n * @description Label for a column in a data table; entries will be the individual JavaScript scripts.\n */\n columnScript: 'Script',\n /**\n * @description Label for a column in a data table; entries will be the number of wasted bytes (aka the estimated savings in terms of bytes).\n */\n columnWastedBytes: 'Wasted bytes',\n /**\n * @description Message shown when no legacy JavaScript is found.\n */\n noLegacyJavaScript: 'No legacy JavaScript found',\n} as const;\n\nconst str_ = i18n.i18n.registerUIStrings('models/trace/insights/LegacyJavaScript.ts', UIStrings);\nexport const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport interface PatternMatchResult {\n name: string;\n line: number;\n column: number;\n}\n\ninterface LegacyJavaScriptResult {\n matches: PatternMatchResult[];\n estimatedByteSavings: number;\n}\n\ntype LegacyJavaScriptResults = Map<Handlers.ModelHandlers.Scripts.Script, LegacyJavaScriptResult>;\n\nexport type LegacyJavaScriptInsightModel = InsightModel<typeof UIStrings, {\n legacyJavaScriptResults: LegacyJavaScriptResults,\n}>;\n\nconst BYTE_THRESHOLD = 5000;\n\nfunction finalize(partialModel: PartialInsightModel<LegacyJavaScriptInsightModel>): LegacyJavaScriptInsightModel {\n const requests = [...partialModel.legacyJavaScriptResults.keys()].map(script => script.request).filter(e => !!e);\n\n return {\n insightKey: InsightKeys.LEGACY_JAVASCRIPT,\n strings: UIStrings,\n title: i18nString(UIStrings.title),\n description: i18nString(UIStrings.description),\n docs: 'https://developer.chrome.com/docs/performance/insights/legacy-javascript',\n category: InsightCategory.ALL,\n state: requests.length ? 'fail' : 'pass',\n relatedEvents: [...new Set(requests)],\n ...partialModel,\n };\n}\n\nexport function isLegacyJavaScript(model: InsightModel): model is LegacyJavaScriptInsightModel {\n return model.insightKey === InsightKeys.LEGACY_JAVASCRIPT;\n}\n\nexport function generateInsight(\n data: Handlers.Types.HandlerData, context: InsightSetContext): LegacyJavaScriptInsightModel {\n const scripts = data.Scripts.scripts.filter(script => {\n if (script.frame !== context.frameId) {\n return false;\n }\n\n if (script.url?.startsWith('chrome-extension://')) {\n return false;\n }\n\n return Helpers.Timing.timestampIsInBounds(context.bounds, script.ts) ||\n (script.request && Helpers.Timing.eventIsInBounds(script.request, context.bounds));\n });\n\n const legacyJavaScriptResults: LegacyJavaScriptResults = new Map();\n const wastedBytesByRequestId = new Map<string, number>();\n\n for (const script of scripts) {\n if (!script.content || script.content.length < BYTE_THRESHOLD) {\n continue;\n }\n\n const result = detectLegacyJavaScript(script.content, script.sourceMap);\n if (result.estimatedByteSavings < BYTE_THRESHOLD) {\n continue;\n }\n\n // Translate from resource size to transfer size.\n const compressionRatio = estimateCompressionRatioForScript(script);\n const transferSize = Math.round(result.estimatedByteSavings * compressionRatio);\n result.estimatedByteSavings = transferSize;\n\n legacyJavaScriptResults.set(script, result);\n\n if (script.request) {\n const requestId = script.request.args.data.requestId;\n wastedBytesByRequestId.set(requestId, transferSize);\n }\n }\n\n const sorted =\n new Map([...legacyJavaScriptResults].sort((a, b) => b[1].estimatedByteSavings - a[1].estimatedByteSavings));\n\n return finalize({\n legacyJavaScriptResults: sorted,\n metricSavings: metricSavingsForWastedBytes(wastedBytesByRequestId, context),\n wastedBytes: wastedBytesByRequestId.values().reduce((acc, cur) => acc + cur, 0),\n });\n}\nexport function createOverlays(model: LegacyJavaScriptInsightModel): Types.Overlays.Overlay[] {\n return [...model.legacyJavaScriptResults.keys()].map(script => script.request).filter(e => !!e).map(request => {\n return {\n type: 'ENTRY_OUTLINE',\n entry: request,\n outlineReason: 'ERROR',\n };\n });\n}\n"]}
@@ -0,0 +1,23 @@
1
+ // Copyright 2024 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+ export * as Cache from './Cache.js';
5
+ export * as CharacterSet from './CharacterSet.js';
6
+ export * as CLSCulprits from './CLSCulprits.js';
7
+ export * as DocumentLatency from './DocumentLatency.js';
8
+ export * as DOMSize from './DOMSize.js';
9
+ export * as DuplicatedJavaScript from './DuplicatedJavaScript.js';
10
+ export * as FontDisplay from './FontDisplay.js';
11
+ export * as ForcedReflow from './ForcedReflow.js';
12
+ export * as ImageDelivery from './ImageDelivery.js';
13
+ export * as INPBreakdown from './INPBreakdown.js';
14
+ export * as LCPBreakdown from './LCPBreakdown.js';
15
+ export * as LCPDiscovery from './LCPDiscovery.js';
16
+ export * as LegacyJavaScript from './LegacyJavaScript.js';
17
+ export * as ModernHTTP from './ModernHTTP.js';
18
+ export * as NetworkDependencyTree from './NetworkDependencyTree.js';
19
+ export * as RenderBlocking from './RenderBlocking.js';
20
+ export * as SlowCSSSelector from './SlowCSSSelector.js';
21
+ export * as ThirdParties from './ThirdParties.js';
22
+ export * as Viewport from './Viewport.js';
23
+ //# sourceMappingURL=Models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Models.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/Models.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,oBAAoB,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport * as Cache from './Cache.js';\nexport * as CharacterSet from './CharacterSet.js';\nexport * as CLSCulprits from './CLSCulprits.js';\nexport * as DocumentLatency from './DocumentLatency.js';\nexport * as DOMSize from './DOMSize.js';\nexport * as DuplicatedJavaScript from './DuplicatedJavaScript.js';\nexport * as FontDisplay from './FontDisplay.js';\nexport * as ForcedReflow from './ForcedReflow.js';\nexport * as ImageDelivery from './ImageDelivery.js';\nexport * as INPBreakdown from './INPBreakdown.js';\nexport * as LCPBreakdown from './LCPBreakdown.js';\nexport * as LCPDiscovery from './LCPDiscovery.js';\nexport * as LegacyJavaScript from './LegacyJavaScript.js';\nexport * as ModernHTTP from './ModernHTTP.js';\nexport * as NetworkDependencyTree from './NetworkDependencyTree.js';\nexport * as RenderBlocking from './RenderBlocking.js';\nexport * as SlowCSSSelector from './SlowCSSSelector.js';\nexport * as ThirdParties from './ThirdParties.js';\nexport * as Viewport from './Viewport.js';\n"]}
@@ -6,23 +6,23 @@ export declare const UIStrings: {
6
6
  /**
7
7
  * @description Title of an insight that recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. "HTTP" should not be translated.
8
8
  */
9
- readonly title: "Modern HTTP";
9
+ readonly title: 'Modern HTTP';
10
10
  /**
11
11
  * @description Description of an insight that recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. "HTTP" should not be translated.
12
12
  */
13
- readonly description: "HTTP/2 and HTTP/3 offer many benefits over HTTP/1.1, such as multiplexing. [Learn more about using modern HTTP](https://developer.chrome.com/docs/performance/insights/modern-http).";
13
+ readonly description: 'HTTP/2 and HTTP/3 offer many benefits over HTTP/1.1, such as multiplexing. [Learn more about using modern HTTP](https://developer.chrome.com/docs/performance/insights/modern-http).';
14
14
  /**
15
15
  * @description Column header for a table where each cell represents a network request.
16
16
  */
17
- readonly request: "Request";
17
+ readonly request: 'Request';
18
18
  /**
19
19
  * @description Column header for a table where each cell represents the protocol of a network request.
20
20
  */
21
- readonly protocol: "Protocol";
21
+ readonly protocol: 'Protocol';
22
22
  /**
23
23
  * @description Text explaining that there were no requests that were slowed down by using HTTP/1.1. "HTTP/1.1" should not be translated.
24
24
  */
25
- readonly noOldProtocolRequests: "No requests used HTTP/1.1, or its current use of HTTP/1.1 doesn’t present a significant optimization opportunity. HTTP/1.1 requests are only flagged if six or more static assets originate from the same origin, and they aren’t served from a local development environment or a third-party source.";
25
+ readonly noOldProtocolRequests: 'No requests used HTTP/1.1, or its current use of HTTP/1.1 doesn’t present a significant optimization opportunity. HTTP/1.1 requests are only flagged if six or more static assets originate from the same origin, and they aren’t served from a local development environment or a third-party source.';
26
26
  };
27
27
  export declare const i18nString: i18n.LocalizeString;
28
28
  export type ModernHTTPInsightModel = InsightModel<typeof UIStrings, {
@@ -0,0 +1,205 @@
1
+ // Copyright 2025 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+ import * as i18n from '../../../core/i18n/i18n.js';
5
+ import * as Platform from '../../../core/platform/platform.js';
6
+ import * as Handlers from '../handlers/handlers.js';
7
+ import * as Helpers from '../helpers/helpers.js';
8
+ import * as Types from '../types/types.js';
9
+ import { InsightCategory, InsightKeys, } from './types.js';
10
+ export const UIStrings = {
11
+ /**
12
+ * @description Title of an insight that recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. "HTTP" should not be translated.
13
+ */
14
+ title: 'Modern HTTP',
15
+ /**
16
+ * @description Description of an insight that recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. "HTTP" should not be translated.
17
+ */
18
+ description: 'HTTP/2 and HTTP/3 offer many benefits over HTTP/1.1, such as multiplexing. [Learn more about using modern HTTP](https://developer.chrome.com/docs/performance/insights/modern-http).',
19
+ /**
20
+ * @description Column header for a table where each cell represents a network request.
21
+ */
22
+ request: 'Request',
23
+ /**
24
+ * @description Column header for a table where each cell represents the protocol of a network request.
25
+ */
26
+ protocol: 'Protocol',
27
+ /**
28
+ * @description Text explaining that there were no requests that were slowed down by using HTTP/1.1. "HTTP/1.1" should not be translated.
29
+ */
30
+ noOldProtocolRequests: 'No requests used HTTP/1.1, or its current use of HTTP/1.1 doesn’t present a significant optimization opportunity. HTTP/1.1 requests are only flagged if six or more static assets originate from the same origin, and they aren’t served from a local development environment or a third-party source.',
31
+ };
32
+ const str_ = i18n.i18n.registerUIStrings('models/trace/insights/ModernHTTP.ts', UIStrings);
33
+ export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
34
+ export function isModernHTTPInsight(model) {
35
+ return model.insightKey === InsightKeys.MODERN_HTTP;
36
+ }
37
+ /**
38
+ * Determines whether a network request is a "static resource" that would benefit from H2 multiplexing.
39
+ * XHRs, tracking pixels, etc generally don't benefit as much because they aren't requested en-masse
40
+ * for the same origin at the exact same time.
41
+ */
42
+ function isMultiplexableStaticAsset(request, entityMappings, firstPartyEntity) {
43
+ if (!Helpers.Network.STATIC_RESOURCE_TYPES.has(request.args.data.resourceType)) {
44
+ return false;
45
+ }
46
+ // Resources from third-parties that are less than 100 bytes are usually tracking pixels, not actual resources.
47
+ // They can masquerade as static types though (gifs, documents, etc)
48
+ if (request.args.data.decodedBodyLength < 100) {
49
+ const entity = entityMappings.entityByEvent.get(request);
50
+ if (entity) {
51
+ // Third-party assets are multiplexable in their first-party context.
52
+ if (firstPartyEntity?.name === entity.name) {
53
+ return true;
54
+ }
55
+ // Skip recognizable third-parties' requests.
56
+ if (!entity.isUnrecognized) {
57
+ return false;
58
+ }
59
+ }
60
+ }
61
+ return true;
62
+ }
63
+ /**
64
+ * Determine the set of resources that aren't HTTP/2 but should be.
65
+ * We're a little conservative about what we surface for a few reasons:
66
+ *
67
+ * - The simulator approximation of HTTP/2 is a little more generous than reality.
68
+ * - There's a bit of debate surrounding HTTP/2 due to its worse performance in environments with high packet loss. [1][2][3]
69
+ * - It's something that you'd have absolutely zero control over with a third-party (can't defer to fix it for example).
70
+ *
71
+ * Therefore, we only surface requests that were...
72
+ *
73
+ * - Served over HTTP/1.1 or earlier
74
+ * - Served over an origin that serves at least 6 static asset requests
75
+ * (if there aren't more requests than browser's max/host, multiplexing isn't as big a deal)
76
+ * - Not served on localhost (h2 is a pain to deal with locally & and CI)
77
+ *
78
+ * [1] https://news.ycombinator.com/item?id=19086639
79
+ * [2] https://www.twilio.com/blog/2017/10/http2-issues.html
80
+ * [3] https://www.cachefly.com/http-2-is-not-a-magic-bullet/
81
+ */
82
+ export function determineHttp1Requests(requests, entityMappings, firstPartyEntity) {
83
+ const http1Requests = [];
84
+ const groupedByOrigin = new Map();
85
+ for (const record of requests) {
86
+ const url = new URL(record.args.data.url);
87
+ if (!isMultiplexableStaticAsset(record, entityMappings, firstPartyEntity)) {
88
+ continue;
89
+ }
90
+ if (Helpers.Network.isSyntheticNetworkRequestLocalhost(record)) {
91
+ continue;
92
+ }
93
+ const originRequests = Platform.MapUtilities.getWithDefault(groupedByOrigin, url.origin, () => []);
94
+ originRequests.push(record);
95
+ }
96
+ const seenURLs = new Set();
97
+ for (const request of requests) {
98
+ // Skip duplicates.
99
+ if (seenURLs.has(request.args.data.url)) {
100
+ continue;
101
+ }
102
+ // Check if record is not served through the service worker, servicer worker uses http/1.1 as a protocol.
103
+ // These can generate false positives (bug: https://github.com/GoogleChrome/lighthouse/issues/7158).
104
+ if (request.args.data.fromServiceWorker) {
105
+ continue;
106
+ }
107
+ // Test the protocol to see if it was http/1.1.
108
+ const isOldHttp = /HTTP\/[01][.\d]?/i.test(request.args.data.protocol);
109
+ if (!isOldHttp) {
110
+ continue;
111
+ }
112
+ const url = new URL(request.args.data.url);
113
+ // Check if the origin has enough requests to bother flagging.
114
+ const group = groupedByOrigin.get(url.origin) || [];
115
+ if (group.length < 6) {
116
+ continue;
117
+ }
118
+ seenURLs.add(request.args.data.url);
119
+ http1Requests.push(request);
120
+ }
121
+ return http1Requests;
122
+ }
123
+ /**
124
+ * Computes the estimated effect of all results being converted to http/2 on the provided graph.
125
+ */
126
+ function computeWasteWithGraph(urlsToChange, graph, simulator) {
127
+ const simulationBefore = simulator.simulate(graph);
128
+ // Update all the protocols to reflect implementing our recommendations
129
+ const originalProtocols = new Map();
130
+ graph.traverse(node => {
131
+ if (node.type !== 'network') {
132
+ return;
133
+ }
134
+ if (!urlsToChange.has(node.request.url)) {
135
+ return;
136
+ }
137
+ originalProtocols.set(node.request.requestId, node.request.protocol);
138
+ node.request.protocol = 'h2';
139
+ });
140
+ const simulationAfter = simulator.simulate(graph);
141
+ // Restore the original protocol after we've done our simulation
142
+ graph.traverse(node => {
143
+ if (node.type !== 'network') {
144
+ return;
145
+ }
146
+ const originalProtocol = originalProtocols.get(node.request.requestId);
147
+ if (originalProtocol === undefined) {
148
+ return;
149
+ }
150
+ node.request.protocol = originalProtocol;
151
+ });
152
+ const savings = simulationBefore.timeInMs - simulationAfter.timeInMs;
153
+ return Platform.NumberUtilities.floor(savings, 1 / 10);
154
+ }
155
+ function computeMetricSavings(http1Requests, context) {
156
+ if (!context.navigation || !('lantern' in context) || !context.lantern) {
157
+ return;
158
+ }
159
+ const urlsToChange = new Set(http1Requests.map(r => r.args.data.url));
160
+ const fcpGraph = context.lantern.metrics.firstContentfulPaint.optimisticGraph;
161
+ const lcpGraph = context.lantern.metrics.largestContentfulPaint.optimisticGraph;
162
+ return {
163
+ FCP: computeWasteWithGraph(urlsToChange, fcpGraph, context.lantern.simulator),
164
+ LCP: computeWasteWithGraph(urlsToChange, lcpGraph, context.lantern.simulator),
165
+ };
166
+ }
167
+ function finalize(partialModel) {
168
+ return {
169
+ insightKey: InsightKeys.MODERN_HTTP,
170
+ strings: UIStrings,
171
+ title: i18nString(UIStrings.title),
172
+ description: i18nString(UIStrings.description),
173
+ docs: 'https://developer.chrome.com/docs/performance/insights/modern-http',
174
+ category: InsightCategory.LCP,
175
+ state: partialModel.http1Requests.length > 0 ? 'fail' : 'pass',
176
+ ...partialModel,
177
+ relatedEvents: partialModel.http1Requests,
178
+ };
179
+ }
180
+ export function generateInsight(data, context) {
181
+ const isWithinContext = (event) => Helpers.Timing.eventIsInBounds(event, context.bounds);
182
+ const contextRequests = data.NetworkRequests.byTime.filter(isWithinContext);
183
+ const entityMappings = data.NetworkRequests.entityMappings;
184
+ let firstPartyUrl = data.Meta.mainFrameURL;
185
+ if (context.navigation && !Types.Events.isSoftNavigationStart(context.navigation)) {
186
+ firstPartyUrl = context.navigation.args.data?.documentLoaderURL ?? firstPartyUrl;
187
+ }
188
+ const firstPartyEntity = Handlers.Helpers.getEntityForUrl(firstPartyUrl, entityMappings);
189
+ const http1Requests = determineHttp1Requests(contextRequests, entityMappings, firstPartyEntity ?? null);
190
+ return finalize({
191
+ http1Requests,
192
+ metricSavings: computeMetricSavings(http1Requests, context),
193
+ });
194
+ }
195
+ export function createOverlayForRequest(request) {
196
+ return {
197
+ type: 'ENTRY_OUTLINE',
198
+ entry: request,
199
+ outlineReason: 'ERROR',
200
+ };
201
+ }
202
+ export function createOverlays(model) {
203
+ return model.http1Requests.map(req => createOverlayForRequest(req)) ?? [];
204
+ }
205
+ //# sourceMappingURL=ModernHTTP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModernHTTP.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/ModernHTTP.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EACL,eAAe,EACf,WAAW,GAKZ,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,aAAa;IACpB;;OAEG;IACH,WAAW,EACP,sLAAsL;IAC1L;;OAEG;IACH,OAAO,EAAE,SAAS;IAClB;;O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IAExG,OAAO,QAAQ,CAAC;QACd,aAAa;QACb,aAAa,EAAE,oBAAoB,CAAC,aAAa,EAAE,OAAO,CAAC;KAC5D,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAA6C;IACnF,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,OAAO;QACd,aAAa,EAAE,OAAO;KACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAA6B;IAC1D,OAAO,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5E,CAAC","sourcesContent":["// Copyright 2025 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as Handlers from '../handlers/handlers.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport type * as Lantern from '../lantern/lantern.js';\nimport * as Types from '../types/types.js';\n\nimport {\n InsightCategory,\n InsightKeys,\n type InsightModel,\n type InsightSetContext,\n type MetricSavings,\n type PartialInsightModel,\n} from './types.js';\n\nexport const UIStrings = {\n /**\n * @description Title of an insight that recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. \"HTTP\" should not be translated.\n */\n title: 'Modern HTTP',\n /**\n * @description Description of an insight that recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. \"HTTP\" should not be translated.\n */\n description:\n 'HTTP/2 and HTTP/3 offer many benefits over HTTP/1.1, such as multiplexing. [Learn more about using modern HTTP](https://developer.chrome.com/docs/performance/insights/modern-http).',\n /**\n * @description Column header for a table where each cell represents a network request.\n */\n request: 'Request',\n /**\n * @description Column header for a table where each cell represents the protocol of a network request.\n */\n protocol: 'Protocol',\n /**\n * @description Text explaining that there were no requests that were slowed down by using HTTP/1.1. \"HTTP/1.1\" should not be translated.\n */\n noOldProtocolRequests:\n 'No requests used HTTP/1.1, or its current use of HTTP/1.1 doesn’t present a significant optimization opportunity. HTTP/1.1 requests are only flagged if six or more static assets originate from the same origin, and they aren’t served from a local development environment or a third-party source.',\n} as const;\n\nconst str_ = i18n.i18n.registerUIStrings('models/trace/insights/ModernHTTP.ts', UIStrings);\nexport const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport type ModernHTTPInsightModel = InsightModel<typeof UIStrings, {\n http1Requests: Types.Events.SyntheticNetworkRequest[],\n}>;\n\nexport function isModernHTTPInsight(model: InsightModel): model is ModernHTTPInsightModel {\n return model.insightKey === InsightKeys.MODERN_HTTP;\n}\n\n/**\n * Determines whether a network request is a \"static resource\" that would benefit from H2 multiplexing.\n * XHRs, tracking pixels, etc generally don't benefit as much because they aren't requested en-masse\n * for the same origin at the exact same time.\n */\nfunction isMultiplexableStaticAsset(\n request: Types.Events.SyntheticNetworkRequest, entityMappings: Handlers.Helpers.EntityMappings,\n firstPartyEntity: Handlers.Helpers.Entity|null): boolean {\n if (!Helpers.Network.STATIC_RESOURCE_TYPES.has(request.args.data.resourceType)) {\n return false;\n }\n\n // Resources from third-parties that are less than 100 bytes are usually tracking pixels, not actual resources.\n // They can masquerade as static types though (gifs, documents, etc)\n if (request.args.data.decodedBodyLength < 100) {\n const entity = entityMappings.entityByEvent.get(request);\n if (entity) {\n // Third-party assets are multiplexable in their first-party context.\n if (firstPartyEntity?.name === entity.name) {\n return true;\n }\n // Skip recognizable third-parties' requests.\n if (!entity.isUnrecognized) {\n return false;\n }\n }\n }\n\n return true;\n}\n\n/**\n * Determine the set of resources that aren't HTTP/2 but should be.\n * We're a little conservative about what we surface for a few reasons:\n *\n * - The simulator approximation of HTTP/2 is a little more generous than reality.\n * - There's a bit of debate surrounding HTTP/2 due to its worse performance in environments with high packet loss. [1][2][3]\n * - It's something that you'd have absolutely zero control over with a third-party (can't defer to fix it for example).\n *\n * Therefore, we only surface requests that were...\n *\n * - Served over HTTP/1.1 or earlier\n * - Served over an origin that serves at least 6 static asset requests\n * (if there aren't more requests than browser's max/host, multiplexing isn't as big a deal)\n * - Not served on localhost (h2 is a pain to deal with locally & and CI)\n *\n * [1] https://news.ycombinator.com/item?id=19086639\n * [2] https://www.twilio.com/blog/2017/10/http2-issues.html\n * [3] https://www.cachefly.com/http-2-is-not-a-magic-bullet/\n */\nexport function determineHttp1Requests(\n requests: Types.Events.SyntheticNetworkRequest[], entityMappings: Handlers.Helpers.EntityMappings,\n firstPartyEntity: Handlers.Helpers.Entity|null): Types.Events.SyntheticNetworkRequest[] {\n const http1Requests: Types.Events.SyntheticNetworkRequest[] = [];\n\n const groupedByOrigin = new Map<string, Types.Events.SyntheticNetworkRequest[]>();\n for (const record of requests) {\n const url = new URL(record.args.data.url);\n if (!isMultiplexableStaticAsset(record, entityMappings, firstPartyEntity)) {\n continue;\n }\n if (Helpers.Network.isSyntheticNetworkRequestLocalhost(record)) {\n continue;\n }\n const originRequests = Platform.MapUtilities.getWithDefault(groupedByOrigin, url.origin, () => []);\n originRequests.push(record);\n }\n\n const seenURLs = new Set<string>();\n\n for (const request of requests) {\n // Skip duplicates.\n if (seenURLs.has(request.args.data.url)) {\n continue;\n }\n\n // Check if record is not served through the service worker, servicer worker uses http/1.1 as a protocol.\n // These can generate false positives (bug: https://github.com/GoogleChrome/lighthouse/issues/7158).\n if (request.args.data.fromServiceWorker) {\n continue;\n }\n\n // Test the protocol to see if it was http/1.1.\n const isOldHttp = /HTTP\\/[01][.\\d]?/i.test(request.args.data.protocol);\n if (!isOldHttp) {\n continue;\n }\n\n const url = new URL(request.args.data.url);\n\n // Check if the origin has enough requests to bother flagging.\n const group = groupedByOrigin.get(url.origin) || [];\n if (group.length < 6) {\n continue;\n }\n\n seenURLs.add(request.args.data.url);\n http1Requests.push(request);\n }\n\n return http1Requests;\n}\n\n/**\n * Computes the estimated effect of all results being converted to http/2 on the provided graph.\n */\nfunction computeWasteWithGraph(\n urlsToChange: Set<string>, graph: Lantern.Graph.Node, simulator: Lantern.Simulation.Simulator): Types.Timing.Milli {\n const simulationBefore = simulator.simulate(graph);\n\n // Update all the protocols to reflect implementing our recommendations\n const originalProtocols = new Map();\n graph.traverse(node => {\n if (node.type !== 'network') {\n return;\n }\n if (!urlsToChange.has(node.request.url)) {\n return;\n }\n\n originalProtocols.set(node.request.requestId, node.request.protocol);\n node.request.protocol = 'h2';\n });\n\n const simulationAfter = simulator.simulate(graph);\n\n // Restore the original protocol after we've done our simulation\n graph.traverse(node => {\n if (node.type !== 'network') {\n return;\n }\n const originalProtocol = originalProtocols.get(node.request.requestId);\n if (originalProtocol === undefined) {\n return;\n }\n node.request.protocol = originalProtocol;\n });\n\n const savings = simulationBefore.timeInMs - simulationAfter.timeInMs;\n\n return Platform.NumberUtilities.floor(savings, 1 / 10) as Types.Timing.Milli;\n}\n\nfunction computeMetricSavings(\n http1Requests: Types.Events.SyntheticNetworkRequest[], context: InsightSetContext): MetricSavings|undefined {\n if (!context.navigation || !('lantern' in context) || !context.lantern) {\n return;\n }\n\n const urlsToChange = new Set(http1Requests.map(r => r.args.data.url));\n\n const fcpGraph = context.lantern.metrics.firstContentfulPaint.optimisticGraph;\n const lcpGraph = context.lantern.metrics.largestContentfulPaint.optimisticGraph;\n\n return {\n FCP: computeWasteWithGraph(urlsToChange, fcpGraph, context.lantern.simulator),\n LCP: computeWasteWithGraph(urlsToChange, lcpGraph, context.lantern.simulator),\n };\n}\n\nfunction finalize(partialModel: PartialInsightModel<ModernHTTPInsightModel>): ModernHTTPInsightModel {\n return {\n insightKey: InsightKeys.MODERN_HTTP,\n strings: UIStrings,\n title: i18nString(UIStrings.title),\n description: i18nString(UIStrings.description),\n docs: 'https://developer.chrome.com/docs/performance/insights/modern-http',\n category: InsightCategory.LCP,\n state: partialModel.http1Requests.length > 0 ? 'fail' : 'pass',\n ...partialModel,\n relatedEvents: partialModel.http1Requests,\n };\n}\n\nexport function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): ModernHTTPInsightModel {\n const isWithinContext = (event: Types.Events.Event): boolean => Helpers.Timing.eventIsInBounds(event, context.bounds);\n\n const contextRequests = data.NetworkRequests.byTime.filter(isWithinContext);\n\n const entityMappings = data.NetworkRequests.entityMappings;\n let firstPartyUrl = data.Meta.mainFrameURL;\n if (context.navigation && !Types.Events.isSoftNavigationStart(context.navigation)) {\n firstPartyUrl = context.navigation.args.data?.documentLoaderURL ?? firstPartyUrl;\n }\n\n const firstPartyEntity = Handlers.Helpers.getEntityForUrl(firstPartyUrl, entityMappings);\n const http1Requests = determineHttp1Requests(contextRequests, entityMappings, firstPartyEntity ?? null);\n\n return finalize({\n http1Requests,\n metricSavings: computeMetricSavings(http1Requests, context),\n });\n}\n\nexport function createOverlayForRequest(request: Types.Events.SyntheticNetworkRequest): Types.Overlays.EntryOutline {\n return {\n type: 'ENTRY_OUTLINE',\n entry: request,\n outlineReason: 'ERROR',\n };\n}\n\nexport function createOverlays(model: ModernHTTPInsightModel): Types.Overlays.Overlay[] {\n return model.http1Requests.map(req => createOverlayForRequest(req)) ?? [];\n}\n"]}
@@ -8,80 +8,80 @@ export declare const UIStrings: {
8
8
  /**
9
9
  * @description Title of an insight that recommends avoiding chaining critical requests.
10
10
  */
11
- readonly title: "Network dependency tree";
11
+ readonly title: 'Network dependency tree';
12
12
  /**
13
13
  * @description Description of an insight that recommends avoiding chaining critical requests.
14
14
  */
15
- readonly description: "[Avoid chaining critical requests](https://developer.chrome.com/docs/performance/insights/network-dependency-tree) by reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load";
15
+ readonly description: '[Avoid chaining critical requests](https://developer.chrome.com/docs/performance/insights/network-dependency-tree) by reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load';
16
16
  /**
17
17
  * @description Description of the warning that recommends avoiding chaining critical requests.
18
18
  */
19
- readonly warningDescription: "Avoid chaining critical requests by reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load";
19
+ readonly warningDescription: 'Avoid chaining critical requests by reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load';
20
20
  /**
21
21
  * @description Text status indicating that there aren’t long chaining critical network requests.
22
22
  */
23
- readonly noNetworkDependencyTree: "No rendering tasks impacted by network dependencies";
23
+ readonly noNetworkDependencyTree: 'No rendering tasks impacted by network dependencies';
24
24
  /**
25
25
  * @description Text for the maximum critical path latency. This refers to the longest chain of network requests that
26
26
  * the browser must download before it can render the page.
27
27
  */
28
- readonly maxCriticalPathLatency: "Max critical path latency:";
28
+ readonly maxCriticalPathLatency: 'Max critical path latency:';
29
29
  /**
30
30
  * @description Label for a column in a data table; entries will be the network request.
31
31
  */
32
- readonly columnRequest: "Request";
32
+ readonly columnRequest: 'Request';
33
33
  /**
34
34
  * @description Label for a column in a data table; entries will be the time from main document till current network request.
35
35
  */
36
- readonly columnTime: "Time";
36
+ readonly columnTime: 'Time';
37
37
  /**
38
38
  * @description Title of the table of the detected preconnect origins.
39
39
  */
40
- readonly preconnectOriginsTableTitle: "Preconnected origins";
40
+ readonly preconnectOriginsTableTitle: 'Preconnected origins';
41
41
  /**
42
42
  * @description Description of the table of the detected preconnect origins.
43
43
  */
44
- readonly preconnectOriginsTableDescription: "[preconnect](https://developer.chrome.com/docs/lighthouse/performance/uses-rel-preconnect/) hints help the browser establish a connection earlier in the page load, saving time when the first request for that origin is made. The following are the origins that the page preconnected to.";
44
+ readonly preconnectOriginsTableDescription: '[preconnect](https://developer.chrome.com/docs/lighthouse/performance/uses-rel-preconnect/) hints help the browser establish a connection earlier in the page load, saving time when the first request for that origin is made. The following are the origins that the page preconnected to.';
45
45
  /**
46
46
  * @description Text status indicating that no origins were preconnected.
47
47
  */
48
- readonly noPreconnectOrigins: "No origins were preconnected";
48
+ readonly noPreconnectOrigins: 'No origins were preconnected';
49
49
  /**
50
50
  * @description A warning message that is shown when found more than 4 preconnected links. "preconnect" should not be translated.
51
51
  */
52
- readonly tooManyPreconnectLinksWarning: "More than 4 `preconnect` connections were found. These should be used sparingly and only to the most important origins.";
52
+ readonly tooManyPreconnectLinksWarning: 'More than 4 `preconnect` connections were found. These should be used sparingly and only to the most important origins.';
53
53
  /**
54
54
  * @description A warning message that is shown when the user added preconnect for some unnecessary origins. "preconnect" should not be translated.
55
55
  */
56
- readonly unusedWarning: "Unused preconnect. Only use `preconnect` for origins that the page is likely to request.";
56
+ readonly unusedWarning: 'Unused preconnect. Only use `preconnect` for origins that the page is likely to request.';
57
57
  /**
58
58
  * @description A warning message that is shown when the user forgets to set the `crossorigin` HTML attribute, or setting it to an incorrect value, on the link is a common mistake when adding preconnect links. "preconnect" should not be translated.
59
59
  */
60
- readonly crossoriginWarning: "Unused preconnect. Check that the `crossorigin` attribute is used properly.";
60
+ readonly crossoriginWarning: 'Unused preconnect. Check that the `crossorigin` attribute is used properly.';
61
61
  /**
62
62
  * @description Label for a column in a data table; entries will be the source of the origin.
63
63
  */
64
- readonly columnSource: "Source";
64
+ readonly columnSource: 'Source';
65
65
  /**
66
66
  * @description Text status indicating that there aren’t preconnect candidates.
67
67
  */
68
- readonly noPreconnectCandidates: "No additional origins are good candidates for preconnecting";
68
+ readonly noPreconnectCandidates: 'No additional origins are good candidates for preconnecting';
69
69
  /**
70
70
  * @description Title of the table that shows the origins that the page should have preconnected to.
71
71
  */
72
- readonly estSavingTableTitle: "Preconnect candidates";
72
+ readonly estSavingTableTitle: 'Preconnect candidates';
73
73
  /**
74
74
  * @description Description of the table that recommends preconnecting to the origins to save time. "preconnect" should not be translated.
75
75
  */
76
- readonly estSavingTableDescription: "Add [preconnect](https://developer.chrome.com/docs/lighthouse/performance/uses-rel-preconnect/) hints to your most important origins, but try to use no more than 4";
76
+ readonly estSavingTableDescription: 'Add [preconnect](https://developer.chrome.com/docs/lighthouse/performance/uses-rel-preconnect/) hints to your most important origins, but try to use no more than 4';
77
77
  /**
78
78
  * @description Label for a column in a data table; entries will be the origin of a web resource.
79
79
  */
80
- readonly columnOrigin: "Origin";
80
+ readonly columnOrigin: 'Origin';
81
81
  /**
82
82
  * @description Label for a column in a data table; entries will be the number of milliseconds the user could reduce page load by if they implemented the suggestions.
83
83
  */
84
- readonly columnWastedMs: "Est LCP savings";
84
+ readonly columnWastedMs: 'Est LCP savings';
85
85
  };
86
86
  export declare const i18nString: i18n.LocalizeString;
87
87
  export declare const TOO_MANY_PRECONNECTS_THRESHOLD = 4;