chrome-devtools-frontend 1.0.1526630 → 1.0.1529186

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 (339) hide show
  1. package/docs/ui_engineering.md +159 -0
  2. package/eslint.config.mjs +6 -1
  3. package/front_end/core/host/UserMetrics.ts +2 -1
  4. package/front_end/core/i18n/i18nImpl.ts +6 -1
  5. package/front_end/core/protocol_client/protocol_client.ts +1 -1
  6. package/front_end/core/root/Runtime.ts +38 -4
  7. package/front_end/core/sdk/CSSMatchedStyles.ts +50 -7
  8. package/front_end/core/sdk/CSSRule.ts +35 -6
  9. package/front_end/core/sdk/Connections.ts +2 -1
  10. package/front_end/core/sdk/DOMModel.ts +4 -0
  11. package/front_end/core/sdk/DebuggerModel.ts +5 -1
  12. package/front_end/core/sdk/NetworkManager.ts +267 -34
  13. package/front_end/core/sdk/PreloadingModel.ts +82 -17
  14. package/front_end/core/sdk/RehydratingConnection.snapshot.txt +1 -1
  15. package/front_end/core/sdk/RehydratingConnection.ts +29 -4
  16. package/front_end/core/sdk/ScopeTreeCache.ts +8 -3
  17. package/front_end/core/sdk/SourceMap.ts +41 -11
  18. package/front_end/core/sdk/SourceMapManager.ts +13 -2
  19. package/front_end/core/sdk/SourceMapScopesInfo.ts +49 -2
  20. package/front_end/core/sdk/TargetManager.ts +0 -22
  21. package/front_end/core/sdk/TraceObject.ts +8 -7
  22. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +81 -0
  23. package/front_end/entrypoints/inspector_main/InspectorMain.ts +3 -1
  24. package/front_end/entrypoints/main/GlobalAiButton.ts +1 -0
  25. package/front_end/entrypoints/main/MainImpl.ts +42 -28
  26. package/front_end/generated/InspectorBackendCommands.js +3 -2
  27. package/front_end/generated/SupportedCSSProperties.js +2 -0
  28. package/front_end/generated/protocol.ts +17 -3
  29. package/front_end/models/ai_assistance/BuiltInAi.ts +111 -0
  30. package/front_end/models/ai_assistance/ConversationHandler.ts +15 -14
  31. package/front_end/models/ai_assistance/ai_assistance.ts +53 -24
  32. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +105 -0
  33. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +6 -1
  34. package/front_end/models/extensions/ExtensionView.ts +3 -0
  35. package/front_end/models/javascript_metadata/NativeFunctions.js +31 -27
  36. package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +31 -29
  37. package/front_end/models/persistence/NetworkPersistenceManager.ts +3 -5
  38. package/front_end/models/persistence/PersistenceImpl.ts +0 -5
  39. package/front_end/models/persistence/persistence-meta.ts +0 -31
  40. package/front_end/models/persistence/persistence.ts +0 -6
  41. package/front_end/models/source_map_scopes/NamesResolver.ts +5 -11
  42. package/front_end/models/stack_trace/Trie.ts +9 -0
  43. package/front_end/models/trace/lantern/types/Lantern.ts +1 -1
  44. package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -0
  45. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +1 -0
  46. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +120 -113
  47. package/front_end/panels/ai_assistance/PatchWidget.ts +9 -8
  48. package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +2 -0
  49. package/front_end/panels/ai_assistance/components/ChatView.ts +29 -29
  50. package/front_end/panels/ai_assistance/components/UserActionRow.ts +1 -0
  51. package/front_end/panels/animation/AnimationTimeline.ts +1 -0
  52. package/front_end/panels/application/CookieItemsView.ts +1 -0
  53. package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -0
  54. package/front_end/panels/application/ServiceWorkerCacheViews.ts +2 -0
  55. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +11 -5
  56. package/front_end/panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts +2 -2
  57. package/front_end/panels/application/preloading/components/PreloadingString.ts +7 -5
  58. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +22 -10
  59. package/front_end/panels/changes/CombinedDiffView.ts +1 -0
  60. package/front_end/{models/persistence → panels/common}/PersistenceUtils.ts +15 -17
  61. package/front_end/panels/common/common.ts +1 -0
  62. package/front_end/panels/console/ConsoleInsightTeaser.ts +369 -0
  63. package/front_end/panels/console/ConsolePanel.ts +2 -0
  64. package/front_end/panels/console/ConsolePrompt.ts +12 -2
  65. package/front_end/panels/console/ConsoleSidebar.ts +1 -1
  66. package/front_end/panels/console/ConsoleView.ts +12 -0
  67. package/front_end/panels/console/ConsoleViewMessage.ts +44 -0
  68. package/front_end/panels/{explain → console}/PromptBuilder.ts +12 -7
  69. package/front_end/panels/console/console-meta.ts +14 -0
  70. package/front_end/panels/console/console.ts +6 -0
  71. package/front_end/panels/console/consoleInsightTeaser.css +83 -0
  72. package/front_end/panels/coverage/CoverageListView.ts +29 -11
  73. package/front_end/panels/coverage/CoverageView.ts +292 -284
  74. package/front_end/panels/coverage/coverageView.css +17 -0
  75. package/front_end/panels/elements/ComputedStyleWidget.ts +1 -0
  76. package/front_end/panels/elements/LayoutPane.ts +1 -0
  77. package/front_end/panels/elements/NodeStackTraceWidget.ts +1 -0
  78. package/front_end/panels/elements/StylePropertyTreeElement.ts +5 -1
  79. package/front_end/panels/elements/stylePropertiesTreeOutline.css +17 -0
  80. package/front_end/panels/emulation/DeviceModeView.ts +2 -0
  81. package/front_end/panels/explain/ActionDelegate.ts +4 -2
  82. package/front_end/panels/explain/components/ConsoleInsight.ts +14 -12
  83. package/front_end/panels/explain/explain-meta.ts +7 -0
  84. package/front_end/panels/explain/explain.ts +0 -1
  85. package/front_end/panels/js_timeline/js_timeline-meta.ts +1 -1
  86. package/front_end/panels/layer_viewer/Layers3DView.ts +2 -0
  87. package/front_end/panels/lighthouse/LighthouseReportSelector.ts +1 -0
  88. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +1 -0
  89. package/front_end/panels/media/MainView.ts +1 -0
  90. package/front_end/panels/media/TickingFlameChart.ts +2 -0
  91. package/front_end/panels/network/BlockedURLsPane.ts +237 -108
  92. package/front_end/panels/network/EventSourceMessagesView.ts +1 -0
  93. package/front_end/panels/network/NetworkItemView.ts +1 -0
  94. package/front_end/panels/network/NetworkLogView.ts +9 -7
  95. package/front_end/panels/network/NetworkOverview.ts +1 -0
  96. package/front_end/panels/network/RequestCookiesView.ts +1 -0
  97. package/front_end/panels/network/RequestHTMLView.ts +1 -0
  98. package/front_end/panels/network/RequestInitiatorView.ts +1 -0
  99. package/front_end/panels/network/RequestPayloadView.ts +1 -0
  100. package/front_end/panels/network/RequestPreviewView.ts +1 -0
  101. package/front_end/panels/network/RequestResponseView.ts +1 -0
  102. package/front_end/panels/network/RequestTimingView.ts +2 -0
  103. package/front_end/panels/network/ResourceDirectSocketChunkView.ts +1 -0
  104. package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -0
  105. package/front_end/panels/network/components/RequestHeadersView.ts +2 -0
  106. package/front_end/panels/network/components/RequestTrustTokensView.ts +2 -0
  107. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -0
  108. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +2 -0
  109. package/front_end/panels/profiler/HeapSnapshotView.ts +7 -0
  110. package/front_end/panels/profiler/IsolateSelector.ts +1 -0
  111. package/front_end/panels/profiler/LiveHeapProfileView.ts +1 -0
  112. package/front_end/panels/profiler/ProfileView.ts +1 -0
  113. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -0
  114. package/front_end/panels/recorder/RecorderPanel.ts +2 -0
  115. package/front_end/panels/screencast/ScreencastView.ts +1 -0
  116. package/front_end/panels/search/SearchView.ts +1 -0
  117. package/front_end/panels/settings/AISettingsTab.ts +3 -3
  118. package/front_end/{models/persistence → panels/settings}/EditFileSystemView.ts +3 -6
  119. package/front_end/panels/settings/WorkspaceSettingsTab.ts +4 -1
  120. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
  121. package/front_end/panels/settings/settings.ts +2 -0
  122. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +12 -0
  123. package/front_end/panels/sources/BreakpointsView.ts +1 -0
  124. package/front_end/panels/sources/DebuggerPlugin.ts +1 -0
  125. package/front_end/{models/persistence → panels/sources}/PersistenceActions.ts +8 -12
  126. package/front_end/panels/sources/TabbedEditorContainer.ts +2 -1
  127. package/front_end/panels/sources/UISourceCodeFrame.ts +17 -2
  128. package/front_end/panels/sources/sources-meta.ts +15 -0
  129. package/front_end/panels/sources/sources.ts +2 -0
  130. package/front_end/panels/timeline/README.md +2 -2
  131. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -1
  132. package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -3
  133. package/front_end/panels/timeline/TimelineLayersView.ts +1 -0
  134. package/front_end/panels/timeline/TimelinePaintProfilerView.ts +114 -37
  135. package/front_end/panels/timeline/TimelinePanel.ts +43 -62
  136. package/front_end/panels/timeline/TimelineTreeView.ts +1 -0
  137. package/front_end/panels/timeline/components/LiveMetricsView.ts +4 -8
  138. package/front_end/panels/timeline/components/Sidebar.ts +2 -0
  139. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
  140. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +7 -7
  141. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -1
  142. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -4
  143. package/front_end/panels/utils/utils.ts +2 -1
  144. package/front_end/panels/web_audio/WebAudioView.ts +1 -0
  145. package/front_end/third_party/chromium/README.chromium +1 -1
  146. package/front_end/third_party/diff/diff_match_patch.js +1 -1
  147. package/front_end/third_party/lighthouse/README.chromium +2 -2
  148. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1530 -2426
  149. package/front_end/third_party/lighthouse/locales/ar-XB.json +107 -455
  150. package/front_end/third_party/lighthouse/locales/ar.json +107 -455
  151. package/front_end/third_party/lighthouse/locales/bg.json +96 -444
  152. package/front_end/third_party/lighthouse/locales/ca.json +96 -444
  153. package/front_end/third_party/lighthouse/locales/cs.json +96 -444
  154. package/front_end/third_party/lighthouse/locales/da.json +96 -444
  155. package/front_end/third_party/lighthouse/locales/de.json +96 -444
  156. package/front_end/third_party/lighthouse/locales/el.json +96 -444
  157. package/front_end/third_party/lighthouse/locales/en-GB.json +96 -444
  158. package/front_end/third_party/lighthouse/locales/en-US.json +116 -467
  159. package/front_end/third_party/lighthouse/locales/en-XA.json +93 -441
  160. package/front_end/third_party/lighthouse/locales/en-XL.json +116 -467
  161. package/front_end/third_party/lighthouse/locales/es-419.json +96 -444
  162. package/front_end/third_party/lighthouse/locales/es.json +96 -444
  163. package/front_end/third_party/lighthouse/locales/fi.json +96 -444
  164. package/front_end/third_party/lighthouse/locales/fil.json +96 -444
  165. package/front_end/third_party/lighthouse/locales/fr.json +96 -444
  166. package/front_end/third_party/lighthouse/locales/he.json +118 -466
  167. package/front_end/third_party/lighthouse/locales/hi.json +96 -444
  168. package/front_end/third_party/lighthouse/locales/hr.json +100 -448
  169. package/front_end/third_party/lighthouse/locales/hu.json +96 -444
  170. package/front_end/third_party/lighthouse/locales/id.json +96 -444
  171. package/front_end/third_party/lighthouse/locales/it.json +96 -444
  172. package/front_end/third_party/lighthouse/locales/ja.json +96 -444
  173. package/front_end/third_party/lighthouse/locales/ko.json +97 -445
  174. package/front_end/third_party/lighthouse/locales/lt.json +96 -444
  175. package/front_end/third_party/lighthouse/locales/lv.json +97 -445
  176. package/front_end/third_party/lighthouse/locales/nl.json +96 -444
  177. package/front_end/third_party/lighthouse/locales/no.json +96 -444
  178. package/front_end/third_party/lighthouse/locales/pl.json +96 -444
  179. package/front_end/third_party/lighthouse/locales/pt-PT.json +96 -444
  180. package/front_end/third_party/lighthouse/locales/pt.json +97 -445
  181. package/front_end/third_party/lighthouse/locales/ro.json +97 -445
  182. package/front_end/third_party/lighthouse/locales/ru.json +96 -444
  183. package/front_end/third_party/lighthouse/locales/sk.json +96 -444
  184. package/front_end/third_party/lighthouse/locales/sl.json +96 -444
  185. package/front_end/third_party/lighthouse/locales/sr-Latn.json +96 -444
  186. package/front_end/third_party/lighthouse/locales/sr.json +96 -444
  187. package/front_end/third_party/lighthouse/locales/sv.json +96 -444
  188. package/front_end/third_party/lighthouse/locales/ta.json +96 -444
  189. package/front_end/third_party/lighthouse/locales/te.json +97 -445
  190. package/front_end/third_party/lighthouse/locales/th.json +96 -444
  191. package/front_end/third_party/lighthouse/locales/tr.json +96 -444
  192. package/front_end/third_party/lighthouse/locales/uk.json +96 -444
  193. package/front_end/third_party/lighthouse/locales/vi.json +96 -444
  194. package/front_end/third_party/lighthouse/locales/zh-HK.json +96 -444
  195. package/front_end/third_party/lighthouse/locales/zh-TW.json +97 -445
  196. package/front_end/third_party/lighthouse/locales/zh.json +96 -444
  197. package/front_end/third_party/lighthouse/report/bundle.d.ts +8 -14
  198. package/front_end/third_party/lighthouse/report/bundle.js +10 -49
  199. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
  200. package/front_end/third_party/web-vitals/README.chromium +5 -8
  201. package/front_end/third_party/web-vitals/package/README.md +191 -152
  202. package/front_end/third_party/web-vitals/package/dist/modules/attribution/index.d.ts +0 -1
  203. package/front_end/third_party/web-vitals/package/dist/modules/attribution/index.js +0 -1
  204. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.d.ts +2 -2
  205. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.js +45 -26
  206. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.d.ts +2 -2
  207. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js +3 -3
  208. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.d.ts +10 -10
  209. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +307 -206
  210. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +2 -2
  211. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +69 -49
  212. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.d.ts +2 -2
  213. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js +2 -2
  214. package/front_end/third_party/web-vitals/package/dist/modules/index.d.ts +0 -1
  215. package/front_end/third_party/web-vitals/package/dist/modules/index.js +0 -1
  216. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +33 -0
  217. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +111 -0
  218. package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.d.ts +4 -0
  219. package/front_end/third_party/web-vitals/package/dist/modules/{attribution/deprecated.js → lib/LCPEntryManager.js} +6 -7
  220. package/front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.d.ts +6 -0
  221. package/front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.js +44 -0
  222. package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.js +1 -1
  223. package/front_end/third_party/web-vitals/package/dist/modules/lib/generateUniqueID.js +1 -1
  224. package/front_end/third_party/web-vitals/package/dist/modules/lib/getActivationStart.js +1 -1
  225. package/front_end/third_party/web-vitals/package/dist/modules/lib/getNavigationEntry.js +5 -7
  226. package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.d.ts +1 -1
  227. package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.js +9 -12
  228. package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.d.ts +1 -0
  229. package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js +52 -33
  230. package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +0 -2
  231. package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.js +2 -2
  232. package/front_end/third_party/web-vitals/package/dist/modules/lib/initUnique.d.ts +6 -0
  233. package/front_end/third_party/web-vitals/package/dist/modules/{deprecated.js → lib/initUnique.js} +11 -4
  234. package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js +3 -6
  235. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js +6 -6
  236. package/front_end/third_party/web-vitals/package/dist/modules/lib/{whenIdle.d.ts → whenIdleOrHidden.d.ts} +1 -1
  237. package/front_end/third_party/web-vitals/package/dist/modules/lib/{whenIdle.js → whenIdleOrHidden.js} +10 -8
  238. package/front_end/third_party/web-vitals/package/dist/modules/onCLS.js +17 -35
  239. package/front_end/third_party/web-vitals/package/dist/modules/onFCP.js +3 -5
  240. package/front_end/third_party/web-vitals/package/dist/modules/onINP.d.ts +9 -7
  241. package/front_end/third_party/web-vitals/package/dist/modules/onINP.js +27 -19
  242. package/front_end/third_party/web-vitals/package/dist/modules/onLCP.js +33 -26
  243. package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.js +2 -4
  244. package/front_end/third_party/web-vitals/package/dist/modules/types/base.d.ts +6 -5
  245. package/front_end/third_party/web-vitals/package/dist/modules/types/cls.d.ts +5 -3
  246. package/front_end/third_party/web-vitals/package/dist/modules/types/inp.d.ts +80 -33
  247. package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +6 -2
  248. package/front_end/third_party/web-vitals/package/dist/modules/types.d.ts +28 -4
  249. package/front_end/third_party/web-vitals/package/dist/modules/types.js +0 -1
  250. package/front_end/third_party/web-vitals/package/package.json +4 -10
  251. package/front_end/third_party/web-vitals/package/src/attribution/index.ts +0 -1
  252. package/front_end/third_party/web-vitals/package/src/attribution/onCLS.ts +58 -33
  253. package/front_end/third_party/web-vitals/package/src/attribution/onFCP.ts +4 -4
  254. package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +382 -258
  255. package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +96 -69
  256. package/front_end/third_party/web-vitals/package/src/attribution/onTTFB.ts +3 -3
  257. package/front_end/third_party/web-vitals/package/src/index.ts +0 -1
  258. package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +146 -0
  259. package/front_end/third_party/web-vitals/package/src/{attribution/deprecated.ts → lib/LCPEntryManager.ts} +6 -9
  260. package/front_end/third_party/web-vitals/package/src/lib/LayoutShiftManager.ts +50 -0
  261. package/front_end/third_party/web-vitals/package/src/lib/bindReporter.ts +1 -1
  262. package/front_end/third_party/web-vitals/package/src/lib/generateUniqueID.ts +1 -1
  263. package/front_end/third_party/web-vitals/package/src/lib/getActivationStart.ts +1 -1
  264. package/front_end/third_party/web-vitals/package/src/lib/getNavigationEntry.ts +5 -8
  265. package/front_end/third_party/web-vitals/package/src/lib/getSelector.ts +12 -12
  266. package/front_end/third_party/web-vitals/package/src/lib/getVisibilityWatcher.ts +57 -35
  267. package/front_end/third_party/web-vitals/package/src/lib/initMetric.ts +2 -2
  268. package/front_end/third_party/web-vitals/package/src/{deprecated.ts → lib/initUnique.ts} +14 -8
  269. package/front_end/third_party/web-vitals/package/src/lib/observe.ts +3 -11
  270. package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts +12 -6
  271. package/front_end/third_party/web-vitals/package/src/lib/{whenIdle.ts → whenIdleOrHidden.ts} +10 -8
  272. package/front_end/third_party/web-vitals/package/src/onCLS.ts +17 -38
  273. package/front_end/third_party/web-vitals/package/src/onFCP.ts +3 -6
  274. package/front_end/third_party/web-vitals/package/src/onINP.ts +33 -28
  275. package/front_end/third_party/web-vitals/package/src/onLCP.ts +36 -29
  276. package/front_end/third_party/web-vitals/package/src/onTTFB.ts +2 -5
  277. package/front_end/third_party/web-vitals/package/src/types/base.ts +5 -5
  278. package/front_end/third_party/web-vitals/package/src/types/cls.ts +5 -3
  279. package/front_end/third_party/web-vitals/package/src/types/inp.ts +88 -33
  280. package/front_end/third_party/web-vitals/package/src/types/lcp.ts +6 -2
  281. package/front_end/third_party/web-vitals/package/src/types.ts +47 -4
  282. package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +75 -0
  283. package/front_end/third_party/web-vitals/rebuild.sh +32 -18
  284. package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +5 -10
  285. package/front_end/third_party/web-vitals/web-vitals.ts +0 -2
  286. package/front_end/ui/components/docs/console_insight/basic.ts +3 -2
  287. package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +2 -0
  288. package/front_end/ui/components/text_editor/TextEditor.ts +0 -2
  289. package/front_end/ui/legacy/InspectorView.ts +2 -0
  290. package/front_end/ui/legacy/ListWidget.ts +2 -2
  291. package/front_end/ui/legacy/SplitWidget.ts +2 -0
  292. package/front_end/ui/legacy/TabbedPane.ts +1 -0
  293. package/front_end/ui/legacy/TargetCrashedScreen.ts +1 -0
  294. package/front_end/ui/legacy/UIUtils.ts +8 -19
  295. package/front_end/ui/legacy/ViewManager.ts +1 -0
  296. package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +7 -20
  297. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +2 -0
  298. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -0
  299. package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -0
  300. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +1 -0
  301. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -0
  302. package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -0
  303. package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -0
  304. package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -0
  305. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +1 -0
  306. package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +2 -0
  307. package/front_end/ui/visual_logging/KnownContextValues.ts +25 -0
  308. package/mcp/README.md +7 -0
  309. package/mcp/mcp.ts +8 -0
  310. package/package.json +1 -1
  311. package/front_end/models/live-metrics/web-vitals-injected/OnEachInteraction.ts +0 -34
  312. package/front_end/third_party/web-vitals/package/attribution.d.ts +0 -16
  313. package/front_end/third_party/web-vitals/package/attribution.js +0 -18
  314. package/front_end/third_party/web-vitals/package/dist/modules/attribution/deprecated.d.ts +0 -7
  315. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFID.d.ts +0 -11
  316. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFID.js +0 -46
  317. package/front_end/third_party/web-vitals/package/dist/modules/deprecated.d.ts +0 -5
  318. package/front_end/third_party/web-vitals/package/dist/modules/lib/interactions.d.ts +0 -31
  319. package/front_end/third_party/web-vitals/package/dist/modules/lib/interactions.js +0 -107
  320. package/front_end/third_party/web-vitals/package/dist/modules/lib/onHidden.d.ts +0 -1
  321. package/front_end/third_party/web-vitals/package/dist/modules/lib/onHidden.js +0 -22
  322. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/firstInputPolyfill.d.ts +0 -7
  323. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/firstInputPolyfill.js +0 -147
  324. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/getFirstHiddenTimePolyfill.d.ts +0 -1
  325. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/getFirstHiddenTimePolyfill.js +0 -25
  326. package/front_end/third_party/web-vitals/package/dist/modules/onFID.d.ts +0 -13
  327. package/front_end/third_party/web-vitals/package/dist/modules/onFID.js +0 -70
  328. package/front_end/third_party/web-vitals/package/dist/modules/types/fid.d.ts +0 -46
  329. package/front_end/third_party/web-vitals/package/dist/modules/types/fid.js +0 -16
  330. package/front_end/third_party/web-vitals/package/src/attribution/onFID.ts +0 -62
  331. package/front_end/third_party/web-vitals/package/src/lib/interactions.ts +0 -139
  332. package/front_end/third_party/web-vitals/package/src/lib/onHidden.ts +0 -23
  333. package/front_end/third_party/web-vitals/package/src/lib/polyfills/firstInputPolyfill.ts +0 -174
  334. package/front_end/third_party/web-vitals/package/src/onFID.ts +0 -105
  335. package/front_end/third_party/web-vitals/package/src/types/fid.ts +0 -65
  336. package/front_end/ui/components/text_editor/textEditor.css +0 -18
  337. package/front_end/ui/legacy/inlineButton.css +0 -22
  338. /package/front_end/entrypoints/{rehydrated_devtools_app/rehydrated_devtools_app.ts → trace_app/trace_app.ts} +0 -0
  339. /package/front_end/{models/persistence → panels/settings}/editFileSystemView.css +0 -0
@@ -4,15 +4,13 @@
4
4
 
5
5
  import * as Common from '../../../../core/common/common.js';
6
6
  import * as i18n from '../../../../core/i18n/i18n.js';
7
- import * as IconButton from '../../../components/icon_button/icon_button.js';
8
7
  import * as UI from '../../legacy.js';
9
8
 
10
9
  const UIStrings = {
11
10
  /**
12
- * @description Tooltip text describing that a color was clipped after conversion to match the target gamut
13
- * @example {rgb(255 255 255)} PH1
11
+ * @description Menu warning that some color will be clipped after conversion to match the target gamut
14
12
  */
15
- colorClippedTooltipText: 'This color was clipped to match the format\'s gamut. The actual result was {PH1}',
13
+ colorShiftWarning: '⚠️ Conversion to a narrow gamut will cause color shifts',
16
14
  } as const;
17
15
  const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/color_picker/FormatPickerContextMenu.ts', UIStrings);
18
16
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -56,10 +54,13 @@ export class FormatPickerContextMenu {
56
54
  Common.Color.Format.XYZ_D65,
57
55
  ];
58
56
  const menu = new UI.ContextMenu.ContextMenu(e, {onSoftMenuClosed: () => resolve()});
57
+ const disclamerSection = menu.section('disclaimer');
59
58
  const legacySection = menu.section('legacy');
60
59
  const wideSection = menu.section('wide');
61
60
  const colorFunctionSection = menu.section('color-function').appendSubMenuItem('color()', false, 'color').section();
62
61
 
62
+ disclamerSection.appendItem(i18nString(UIStrings.colorShiftWarning), () => {}, {disabled: true});
63
+
63
64
  if (!(this.#color instanceof Common.Color.Nickname)) {
64
65
  const nickname = this.#color.asLegacyColor().nickname();
65
66
  if (nickname) {
@@ -102,27 +103,13 @@ export class FormatPickerContextMenu {
102
103
  return;
103
104
  }
104
105
  }
105
- const label = newColor.asString();
106
+ const label = newColor.isGamutClipped() ? newColor.asString() + ' ⚠️' : newColor.asString();
106
107
  if (!label) {
107
108
  return;
108
109
  }
109
- let icon = undefined;
110
- if (newColor.isGamutClipped()) {
111
- icon = new IconButton.Icon.Icon();
112
- icon.name = 'warning';
113
- icon.classList.add('medium');
114
- icon.style.marginLeft = '1px';
115
- icon.style.marginTop = '-1px';
116
- icon.style.minWidth = '16px';
117
- icon.style.minHeight = '16px';
118
- }
119
- const tooltip =
120
- icon ? i18nString(UIStrings.colorClippedTooltipText, {PH1: newColor.getAsRawString() ?? 'none'}) : undefined;
121
110
 
122
111
  const handler = (): void => onSelect(newColor);
123
112
 
124
- section.appendItem(
125
- label, handler,
126
- {additionalElement: icon, tooltip, jslogContext: newColor.isGamutClipped() ? 'color' : 'clipped-color'});
113
+ section.appendItem(label, handler, {jslogContext: newColor.isGamutClipped() ? 'color' : 'clipped-color'});
127
114
  }
128
115
  }
@@ -1366,6 +1366,7 @@ export class Spectrum extends Common.ObjectWrapper.eventMixin<EventTypes, typeof
1366
1366
  }
1367
1367
 
1368
1368
  override wasShown(): void {
1369
+ super.wasShown();
1369
1370
  this.hueAlphaWidth = this.hueElement.offsetWidth;
1370
1371
  this.slideHelperWidth = this.hueSlider.offsetWidth / 2;
1371
1372
  this.dragWidth = this.colorElement.offsetWidth;
@@ -1388,6 +1389,7 @@ export class Spectrum extends Common.ObjectWrapper.eventMixin<EventTypes, typeof
1388
1389
  }
1389
1390
 
1390
1391
  override willHide(): void {
1392
+ super.willHide();
1391
1393
  void this.toggleColorPicker(false);
1392
1394
  if (this.contrastDetails && this.contrastDetailsBackgroundColorPickerToggledBound) {
1393
1395
  this.contrastDetails.removeEventListener(
@@ -325,6 +325,7 @@ export class CookiesTable extends UI.Widget.VBox {
325
325
  }
326
326
 
327
327
  override willHide(): void {
328
+ super.willHide();
328
329
  this.lastEditedColumnId = null;
329
330
  }
330
331
 
@@ -99,6 +99,7 @@ export class BezierEditor extends Common.ObjectWrapper.eventMixin<EventTypes, ty
99
99
  }
100
100
 
101
101
  override wasShown(): void {
102
+ super.wasShown();
102
103
  this.unselectPresets();
103
104
  // Check if bezier matches a preset
104
105
  for (const category of this.presetCategories) {
@@ -498,6 +498,7 @@ export class ChartViewport extends UI.Widget.VBox {
498
498
  }
499
499
 
500
500
  override willHide(): void {
501
+ super.willHide();
501
502
  // Stop animations when the view is hidden (or destroyed).
502
503
  // In this case, we also jump the time immediately to the target time, so
503
504
  // that if the view is restored, the time shown is correct.
@@ -229,6 +229,7 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
229
229
  }
230
230
 
231
231
  override willHide(): void {
232
+ super.willHide();
232
233
  if (this.provider) {
233
234
  this.provider.detach();
234
235
  }
@@ -128,6 +128,7 @@ export class FontView extends UI.View.SimpleView {
128
128
  }
129
129
 
130
130
  override wasShown(): void {
131
+ super.wasShown();
131
132
  this.createContentIfNeeded();
132
133
 
133
134
  this.updateFontPreviewSize();
@@ -141,6 +141,7 @@ export class ImageView extends UI.View.SimpleView {
141
141
  }
142
142
 
143
143
  override wasShown(): void {
144
+ super.wasShown();
144
145
  void this.updateContentIfNeeded();
145
146
  }
146
147
 
@@ -134,6 +134,7 @@ export class JSONView extends UI.Widget.VBox implements UI.SearchableView.Search
134
134
  }
135
135
 
136
136
  override wasShown(): void {
137
+ super.wasShown();
137
138
  this.initialize();
138
139
  }
139
140
 
@@ -480,6 +480,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
480
480
  }
481
481
 
482
482
  override wasShown(): void {
483
+ super.wasShown();
483
484
  void this.ensureContentLoaded();
484
485
  this.wasShownOrLoaded();
485
486
  }
@@ -34,6 +34,7 @@ class LinearMemoryInspectorView extends UI.Widget.VBox {
34
34
  }
35
35
 
36
36
  override wasShown(): void {
37
+ super.wasShown();
37
38
  this.refreshData();
38
39
  }
39
40
 
@@ -99,6 +100,7 @@ export class StreamingContentHexView extends LinearMemoryInspectorView {
99
100
  }
100
101
 
101
102
  override wasShown(): void {
103
+ super.wasShown();
102
104
  this.#updateMemoryFromContentData();
103
105
  this.#streamingContentData.addEventListener(
104
106
  TextUtils.StreamingContentData.Events.CHUNK_ADDED, this.#updateMemoryFromContentData, this);
@@ -845,6 +845,7 @@ export const knownContextValues = new Set([
845
845
  'console-group-similar-false',
846
846
  'console-history-autocomplete',
847
847
  'console-history-autocomplete-false',
848
+ 'console-insight-teasers-enabled',
848
849
  'console-insights',
849
850
  'console-insights-enabled',
850
851
  'console-insights-setting',
@@ -1508,6 +1509,10 @@ export const knownContextValues = new Set([
1508
1509
  'explain.console-message.context.other',
1509
1510
  'explain.console-message.context.warning',
1510
1511
  'explain.console-message.hover',
1512
+ 'explain.console-message.teaser',
1513
+ 'explain.teaser.code-snippets-explainer',
1514
+ 'explain.teaser.dont-show',
1515
+ 'explain.teaser.learn-more',
1511
1516
  'explanation',
1512
1517
  'export-ai-conversation',
1513
1518
  'export-har',
@@ -1896,6 +1901,7 @@ export const knownContextValues = new Set([
1896
1901
  'insights-deprecation-learn-more',
1897
1902
  'insights-deprecation-open-performance-panel',
1898
1903
  'insights-deprecation-send-feedback',
1904
+ 'insights-teaser-tell-me-more',
1899
1905
  'inspect',
1900
1906
  'inspect-prerendered-page',
1901
1907
  'inspector-main.focus-debuggee',
@@ -2181,9 +2187,11 @@ export const knownContextValues = new Set([
2181
2187
  'lighthouse.audit.bootup-time',
2182
2188
  'lighthouse.audit.button-name',
2183
2189
  'lighthouse.audit.bypass',
2190
+ 'lighthouse.audit.cache-insight',
2184
2191
  'lighthouse.audit.canonical',
2185
2192
  'lighthouse.audit.charset',
2186
2193
  'lighthouse.audit.clickjacking-mitigation',
2194
+ 'lighthouse.audit.cls-culprits-insight',
2187
2195
  'lighthouse.audit.color-contrast',
2188
2196
  'lighthouse.audit.crawlable-anchors',
2189
2197
  'lighthouse.audit.critical-request-chains',
@@ -2196,10 +2204,13 @@ export const knownContextValues = new Set([
2196
2204
  'lighthouse.audit.diagnostics',
2197
2205
  'lighthouse.audit.dlitem',
2198
2206
  'lighthouse.audit.doctype',
2207
+ 'lighthouse.audit.document-latency-insight',
2199
2208
  'lighthouse.audit.document-title',
2200
2209
  'lighthouse.audit.dom-size',
2210
+ 'lighthouse.audit.dom-size-insight',
2201
2211
  'lighthouse.audit.duplicate-id-aria',
2202
2212
  'lighthouse.audit.duplicated-javascript',
2213
+ 'lighthouse.audit.duplicated-javascript-insight',
2203
2214
  'lighthouse.audit.efficient-animated-content',
2204
2215
  'lighthouse.audit.empty-heading',
2205
2216
  'lighthouse.audit.errors-in-console',
@@ -2209,7 +2220,9 @@ export const knownContextValues = new Set([
2209
2220
  'lighthouse.audit.focus-traps',
2210
2221
  'lighthouse.audit.focusable-controls',
2211
2222
  'lighthouse.audit.font-display',
2223
+ 'lighthouse.audit.font-display-insight',
2212
2224
  'lighthouse.audit.font-size',
2225
+ 'lighthouse.audit.forced-reflow-insight',
2213
2226
  'lighthouse.audit.form-field-multiple-labels',
2214
2227
  'lighthouse.audit.frame-title',
2215
2228
  'lighthouse.audit.geolocation-on-start',
@@ -2223,8 +2236,10 @@ export const knownContextValues = new Set([
2223
2236
  'lighthouse.audit.identical-links-same-purpose',
2224
2237
  'lighthouse.audit.image-alt',
2225
2238
  'lighthouse.audit.image-aspect-ratio',
2239
+ 'lighthouse.audit.image-delivery-insight',
2226
2240
  'lighthouse.audit.image-redundant-alt',
2227
2241
  'lighthouse.audit.image-size-responsive',
2242
+ 'lighthouse.audit.inp-breakdown-insight',
2228
2243
  'lighthouse.audit.input-button-name',
2229
2244
  'lighthouse.audit.input-image-alt',
2230
2245
  'lighthouse.audit.inspector-issues',
@@ -2240,8 +2255,11 @@ export const knownContextValues = new Set([
2240
2255
  'lighthouse.audit.largest-contentful-paint',
2241
2256
  'lighthouse.audit.largest-contentful-paint-element',
2242
2257
  'lighthouse.audit.layout-shifts',
2258
+ 'lighthouse.audit.lcp-breakdown-insight',
2259
+ 'lighthouse.audit.lcp-discovery-insight',
2243
2260
  'lighthouse.audit.lcp-lazy-loaded',
2244
2261
  'lighthouse.audit.legacy-javascript',
2262
+ 'lighthouse.audit.legacy-javascript-insight',
2245
2263
  'lighthouse.audit.link-in-text-block',
2246
2264
  'lighthouse.audit.link-name',
2247
2265
  'lighthouse.audit.link-text',
@@ -2257,7 +2275,9 @@ export const knownContextValues = new Set([
2257
2275
  'lighthouse.audit.meta-refresh',
2258
2276
  'lighthouse.audit.meta-viewport',
2259
2277
  'lighthouse.audit.metrics',
2278
+ 'lighthouse.audit.modern-http-insight',
2260
2279
  'lighthouse.audit.modern-image-formats',
2280
+ 'lighthouse.audit.network-dependency-tree-insight',
2261
2281
  'lighthouse.audit.network-requests',
2262
2282
  'lighthouse.audit.network-rtt',
2263
2283
  'lighthouse.audit.network-server-latency',
@@ -2272,6 +2292,7 @@ export const knownContextValues = new Set([
2272
2292
  'lighthouse.audit.prioritize-lcp-image',
2273
2293
  'lighthouse.audit.redirects',
2274
2294
  'lighthouse.audit.redirects-http',
2295
+ 'lighthouse.audit.render-blocking-insight',
2275
2296
  'lighthouse.audit.render-blocking-resources',
2276
2297
  'lighthouse.audit.resource-summary',
2277
2298
  'lighthouse.audit.robots-txt',
@@ -2289,6 +2310,7 @@ export const knownContextValues = new Set([
2289
2310
  'lighthouse.audit.td-has-header',
2290
2311
  'lighthouse.audit.td-headers-attr',
2291
2312
  'lighthouse.audit.th-has-data-cells',
2313
+ 'lighthouse.audit.third-parties-insight',
2292
2314
  'lighthouse.audit.third-party-cookies',
2293
2315
  'lighthouse.audit.third-party-facades',
2294
2316
  'lighthouse.audit.third-party-summary',
@@ -2314,6 +2336,7 @@ export const knownContextValues = new Set([
2314
2336
  'lighthouse.audit.valid-source-maps',
2315
2337
  'lighthouse.audit.video-caption',
2316
2338
  'lighthouse.audit.viewport',
2339
+ 'lighthouse.audit.viewport-insight',
2317
2340
  'lighthouse.audit.visual-order-follows-dom',
2318
2341
  'lighthouse.audit.work-during-interaction',
2319
2342
  'lighthouse.cancel',
@@ -3393,6 +3416,7 @@ export const knownContextValues = new Set([
3393
3416
  'show-adorner-settings',
3394
3417
  'show-all-properties',
3395
3418
  'show-as-javascript-object',
3419
+ 'show-console-insight-teasers',
3396
3420
  'show-content-scripts',
3397
3421
  'show-css-property-documentation-on-hover',
3398
3422
  'show-debug-borders',
@@ -4025,6 +4049,7 @@ export const knownContextValues = new Set([
4025
4049
  'upload-image',
4026
4050
  'ur',
4027
4051
  'url',
4052
+ 'url-pattern',
4028
4053
  'usage',
4029
4054
  'usb',
4030
4055
  'use-code-with-caution',
package/mcp/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # MCP
2
+
3
+ This is the entrypoint for
4
+ [chrome-devtools-mcp](https://github.com/ChromeDevTools/chrome-devtools-mcp).
5
+ Unlike other entrypoints in front_end, the build output of this one is not
6
+ consumed (yet). Instead, `chrome-devtools-mcp` integrates files exported here
7
+ and their transitive dependencies into its own build.
package/mcp/mcp.ts ADDED
@@ -0,0 +1,8 @@
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
+
5
+ export {PerformanceInsightFormatter} from '../front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.js';
6
+ export {PerformanceTraceFormatter} from '../front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.js';
7
+ export {AgentFocus} from '../front_end/models/ai_assistance/performance/AIContext.js';
8
+ export * as TraceEngine from '../front_end/models/trace/trace.js';
package/package.json CHANGED
@@ -102,5 +102,5 @@
102
102
  "flat-cache": "6.1.12"
103
103
  }
104
104
  },
105
- "version": "1.0.1526630"
105
+ "version": "1.0.1529186"
106
106
  }
@@ -1,34 +0,0 @@
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
-
5
- /**
6
- * @file web-vitals.js doesn't provide a log of all interactions.
7
- * This solution is hacky but it was recommended by web-vitals devs:
8
- * b/371052022
9
- */
10
-
11
- import * as WebVitals from '../../../third_party/web-vitals/web-vitals.js';
12
-
13
- export function onEachInteraction(onReport: (metric: WebVitals.INPMetricWithAttribution) => void): void {
14
- WebVitals.entryPreProcessingCallbacks.push((entry: PerformanceEventTiming) => {
15
- // Wait a microtask so this "pre" processing callback actually
16
- // becomes a "post" processing callback.
17
- void Promise.resolve().then(() => {
18
- if (entry.interactionId) {
19
- const interaction = WebVitals.attributeINP({
20
- entries: [entry],
21
- // The only value we really need for `attributeINP` is `entries`
22
- // Everything else is included to fill out the type.
23
- name: 'INP',
24
- rating: 'good',
25
- value: entry.duration,
26
- delta: entry.duration,
27
- navigationType: 'navigate',
28
- id: 'N/A',
29
- });
30
- onReport(interaction);
31
- }
32
- });
33
- });
34
- }
@@ -1,16 +0,0 @@
1
- /*
2
- Copyright 2022 Google LLC
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- https://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
14
- */
15
-
16
- export * from './dist/modules/attribution/index.js';
@@ -1,18 +0,0 @@
1
- /*
2
- Copyright 2022 Google LLC
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- https://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
14
- */
15
-
16
- // Creates the `web-vitals/attribution` import in node-based bundlers.
17
- // This will not be needed when export maps are widely supported.
18
- export * from './dist/web-vitals.attribution.js';
@@ -1,7 +0,0 @@
1
- export {
2
- /**
3
- * @deprecated Use `onINP()` instead.
4
- */
5
- onFID, } from './onFID.js';
6
- export { FIDThresholds } from '../onFID.js';
7
- export * from '../types.js';
@@ -1,11 +0,0 @@
1
- import { FIDMetricWithAttribution, ReportOpts } from '../types.js';
2
- /**
3
- * Calculates the [FID](https://web.dev/articles/fid) value for the current page and
4
- * calls the `callback` function once the value is ready, along with the
5
- * relevant `first-input` performance entry used to determine the value. The
6
- * reported value is a `DOMHighResTimeStamp`.
7
- *
8
- * _**Important:** since FID is only reported after the user interacts with the
9
- * page, it's possible that it will not be reported for some page loads._
10
- */
11
- export declare const onFID: (onReport: (metric: FIDMetricWithAttribution) => void, opts?: ReportOpts) => void;
@@ -1,46 +0,0 @@
1
- /*
2
- * Copyright 2022 Google LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { getLoadState } from '../lib/getLoadState.js';
17
- import { getSelector } from '../lib/getSelector.js';
18
- import { onFID as unattributedOnFID } from '../onFID.js';
19
- const attributeFID = (metric) => {
20
- const fidEntry = metric.entries[0];
21
- const attribution = {
22
- eventTarget: getSelector(fidEntry.target),
23
- eventType: fidEntry.name,
24
- eventTime: fidEntry.startTime,
25
- eventEntry: fidEntry,
26
- loadState: getLoadState(fidEntry.startTime),
27
- };
28
- // Use Object.assign to set property to keep tsc happy.
29
- const metricWithAttribution = Object.assign(metric, { attribution });
30
- return metricWithAttribution;
31
- };
32
- /**
33
- * Calculates the [FID](https://web.dev/articles/fid) value for the current page and
34
- * calls the `callback` function once the value is ready, along with the
35
- * relevant `first-input` performance entry used to determine the value. The
36
- * reported value is a `DOMHighResTimeStamp`.
37
- *
38
- * _**Important:** since FID is only reported after the user interacts with the
39
- * page, it's possible that it will not be reported for some page loads._
40
- */
41
- export const onFID = (onReport, opts) => {
42
- unattributedOnFID((metric) => {
43
- const metricWithAttribution = attributeFID(metric);
44
- onReport(metricWithAttribution);
45
- }, opts);
46
- };
@@ -1,5 +0,0 @@
1
- export {
2
- /**
3
- * @deprecated Use `onINP()` instead.
4
- */
5
- onFID, FIDThresholds, } from './onFID.js';
@@ -1,31 +0,0 @@
1
- interface Interaction {
2
- id: number;
3
- latency: number;
4
- entries: PerformanceEventTiming[];
5
- }
6
- interface EntryPreProcessingHook {
7
- (entry: PerformanceEventTiming): void;
8
- }
9
- export declare const longestInteractionList: Interaction[];
10
- export declare const longestInteractionMap: Map<number, Interaction>;
11
- export declare const DEFAULT_DURATION_THRESHOLD = 40;
12
- export declare const resetInteractions: () => void;
13
- /**
14
- * Returns the estimated p98 longest interaction based on the stored
15
- * interaction candidates and the interaction count for the current page.
16
- */
17
- export declare const estimateP98LongestInteraction: () => Interaction;
18
- /**
19
- * A list of callback functions to run before each entry is processed.
20
- * Exposing this list allows the attribution build to hook into the
21
- * entry processing pipeline.
22
- */
23
- export declare const entryPreProcessingCallbacks: EntryPreProcessingHook[];
24
- /**
25
- * Takes a performance entry and adds it to the list of worst interactions
26
- * if its duration is long enough to make it among the worst. If the
27
- * entry is part of an existing interaction, it is merged and the latency
28
- * and entries list is updated as needed.
29
- */
30
- export declare const processInteractionEntry: (entry: PerformanceEventTiming) => void;
31
- export {};
@@ -1,107 +0,0 @@
1
- /*
2
- * Copyright 2024 Google LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { getInteractionCount } from './polyfills/interactionCountPolyfill.js';
17
- // A list of longest interactions on the page (by latency) sorted so the
18
- // longest one is first. The list is at most MAX_INTERACTIONS_TO_CONSIDER long.
19
- export const longestInteractionList = [];
20
- // A mapping of longest interactions by their interaction ID.
21
- // This is used for faster lookup.
22
- export const longestInteractionMap = new Map();
23
- // The default `durationThreshold` used across this library for observing
24
- // `event` entries via PerformanceObserver.
25
- export const DEFAULT_DURATION_THRESHOLD = 40;
26
- // Used to store the interaction count after a bfcache restore, since p98
27
- // interaction latencies should only consider the current navigation.
28
- let prevInteractionCount = 0;
29
- /**
30
- * Returns the interaction count since the last bfcache restore (or for the
31
- * full page lifecycle if there were no bfcache restores).
32
- */
33
- const getInteractionCountForNavigation = () => {
34
- return getInteractionCount() - prevInteractionCount;
35
- };
36
- export const resetInteractions = () => {
37
- prevInteractionCount = getInteractionCount();
38
- longestInteractionList.length = 0;
39
- longestInteractionMap.clear();
40
- };
41
- /**
42
- * Returns the estimated p98 longest interaction based on the stored
43
- * interaction candidates and the interaction count for the current page.
44
- */
45
- export const estimateP98LongestInteraction = () => {
46
- const candidateInteractionIndex = Math.min(longestInteractionList.length - 1, Math.floor(getInteractionCountForNavigation() / 50));
47
- return longestInteractionList[candidateInteractionIndex];
48
- };
49
- // To prevent unnecessary memory usage on pages with lots of interactions,
50
- // store at most 10 of the longest interactions to consider as INP candidates.
51
- const MAX_INTERACTIONS_TO_CONSIDER = 10;
52
- /**
53
- * A list of callback functions to run before each entry is processed.
54
- * Exposing this list allows the attribution build to hook into the
55
- * entry processing pipeline.
56
- */
57
- export const entryPreProcessingCallbacks = [];
58
- /**
59
- * Takes a performance entry and adds it to the list of worst interactions
60
- * if its duration is long enough to make it among the worst. If the
61
- * entry is part of an existing interaction, it is merged and the latency
62
- * and entries list is updated as needed.
63
- */
64
- export const processInteractionEntry = (entry) => {
65
- entryPreProcessingCallbacks.forEach((cb) => cb(entry));
66
- // Skip further processing for entries that cannot be INP candidates.
67
- if (!(entry.interactionId || entry.entryType === 'first-input'))
68
- return;
69
- // The least-long of the 10 longest interactions.
70
- const minLongestInteraction = longestInteractionList[longestInteractionList.length - 1];
71
- const existingInteraction = longestInteractionMap.get(entry.interactionId);
72
- // Only process the entry if it's possibly one of the ten longest,
73
- // or if it's part of an existing interaction.
74
- if (existingInteraction ||
75
- longestInteractionList.length < MAX_INTERACTIONS_TO_CONSIDER ||
76
- entry.duration > minLongestInteraction.latency) {
77
- // If the interaction already exists, update it. Otherwise create one.
78
- if (existingInteraction) {
79
- // If the new entry has a longer duration, replace the old entries,
80
- // otherwise add to the array.
81
- if (entry.duration > existingInteraction.latency) {
82
- existingInteraction.entries = [entry];
83
- existingInteraction.latency = entry.duration;
84
- }
85
- else if (entry.duration === existingInteraction.latency &&
86
- entry.startTime === existingInteraction.entries[0].startTime) {
87
- existingInteraction.entries.push(entry);
88
- }
89
- }
90
- else {
91
- const interaction = {
92
- id: entry.interactionId,
93
- latency: entry.duration,
94
- entries: [entry],
95
- };
96
- longestInteractionMap.set(interaction.id, interaction);
97
- longestInteractionList.push(interaction);
98
- }
99
- // Sort the entries by latency (descending) and keep only the top ten.
100
- longestInteractionList.sort((a, b) => b.latency - a.latency);
101
- if (longestInteractionList.length > MAX_INTERACTIONS_TO_CONSIDER) {
102
- longestInteractionList
103
- .splice(MAX_INTERACTIONS_TO_CONSIDER)
104
- .forEach((i) => longestInteractionMap.delete(i.id));
105
- }
106
- }
107
- };
@@ -1 +0,0 @@
1
- export declare const onHidden: (cb: () => void) => void;
@@ -1,22 +0,0 @@
1
- /*
2
- * Copyright 2020 Google LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export const onHidden = (cb) => {
17
- document.addEventListener('visibilitychange', () => {
18
- if (document.visibilityState === 'hidden') {
19
- cb();
20
- }
21
- });
22
- };
@@ -1,7 +0,0 @@
1
- import { FirstInputPolyfillCallback } from '../../types.js';
2
- /**
3
- * Accepts a callback to be invoked once the first input delay and event
4
- * are known.
5
- */
6
- export declare const firstInputPolyfill: (onFirstInput: FirstInputPolyfillCallback) => void;
7
- export declare const resetFirstInputPolyfill: () => void;