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
@@ -784,7 +784,7 @@ inspectorBackend.registerEnum("Network.TrustTokenParamsRefreshPolicy", {UseCache
784
784
  inspectorBackend.registerEnum("Network.TrustTokenOperationType", {Issuance: "Issuance", Redemption: "Redemption", Signing: "Signing"});
785
785
  inspectorBackend.registerEnum("Network.AlternateProtocolUsage", {AlternativeJobWonWithoutRace: "alternativeJobWonWithoutRace", AlternativeJobWonRace: "alternativeJobWonRace", MainJobWonRace: "mainJobWonRace", MappingMissing: "mappingMissing", Broken: "broken", DnsAlpnH3JobWonWithoutRace: "dnsAlpnH3JobWonWithoutRace", DnsAlpnH3JobWonRace: "dnsAlpnH3JobWonRace", UnspecifiedReason: "unspecifiedReason"});
786
786
  inspectorBackend.registerEnum("Network.ServiceWorkerRouterSource", {Network: "network", Cache: "cache", FetchEvent: "fetch-event", RaceNetworkAndFetchHandler: "race-network-and-fetch-handler", RaceNetworkAndCache: "race-network-and-cache"});
787
- inspectorBackend.registerEnum("Network.InitiatorType", {Parser: "parser", Script: "script", Preload: "preload", SignedExchange: "SignedExchange", Preflight: "preflight", Other: "other"});
787
+ inspectorBackend.registerEnum("Network.InitiatorType", {Parser: "parser", Script: "script", Preload: "preload", SignedExchange: "SignedExchange", Preflight: "preflight", FedCM: "FedCM", Other: "other"});
788
788
  inspectorBackend.registerEnum("Network.SetCookieBlockedReason", {SecureOnly: "SecureOnly", SameSiteStrict: "SameSiteStrict", SameSiteLax: "SameSiteLax", SameSiteUnspecifiedTreatedAsLax: "SameSiteUnspecifiedTreatedAsLax", SameSiteNoneInsecure: "SameSiteNoneInsecure", UserPreferences: "UserPreferences", ThirdPartyPhaseout: "ThirdPartyPhaseout", ThirdPartyBlockedInFirstPartySet: "ThirdPartyBlockedInFirstPartySet", SyntaxError: "SyntaxError", SchemeNotSupported: "SchemeNotSupported", OverwriteSecure: "OverwriteSecure", InvalidDomain: "InvalidDomain", InvalidPrefix: "InvalidPrefix", UnknownError: "UnknownError", SchemefulSameSiteStrict: "SchemefulSameSiteStrict", SchemefulSameSiteLax: "SchemefulSameSiteLax", SchemefulSameSiteUnspecifiedTreatedAsLax: "SchemefulSameSiteUnspecifiedTreatedAsLax", SamePartyFromCrossPartyContext: "SamePartyFromCrossPartyContext", SamePartyConflictsWithOtherAttributes: "SamePartyConflictsWithOtherAttributes", NameValuePairExceedsMaxSize: "NameValuePairExceedsMaxSize", DisallowedCharacter: "DisallowedCharacter", NoCookieContent: "NoCookieContent"});
789
789
  inspectorBackend.registerEnum("Network.CookieBlockedReason", {SecureOnly: "SecureOnly", NotOnPath: "NotOnPath", DomainMismatch: "DomainMismatch", SameSiteStrict: "SameSiteStrict", SameSiteLax: "SameSiteLax", SameSiteUnspecifiedTreatedAsLax: "SameSiteUnspecifiedTreatedAsLax", SameSiteNoneInsecure: "SameSiteNoneInsecure", UserPreferences: "UserPreferences", ThirdPartyPhaseout: "ThirdPartyPhaseout", ThirdPartyBlockedInFirstPartySet: "ThirdPartyBlockedInFirstPartySet", UnknownError: "UnknownError", SchemefulSameSiteStrict: "SchemefulSameSiteStrict", SchemefulSameSiteLax: "SchemefulSameSiteLax", SchemefulSameSiteUnspecifiedTreatedAsLax: "SchemefulSameSiteUnspecifiedTreatedAsLax", SamePartyFromCrossPartyContext: "SamePartyFromCrossPartyContext", NameValuePairExceedsMaxSize: "NameValuePairExceedsMaxSize", PortMismatch: "PortMismatch", SchemeMismatch: "SchemeMismatch", AnonymousContext: "AnonymousContext"});
790
790
  inspectorBackend.registerEnum("Network.CookieExemptionReason", {None: "None", UserSetting: "UserSetting", TPCDMetadata: "TPCDMetadata", TPCDDeprecationTrial: "TPCDDeprecationTrial", TopLevelTPCDDeprecationTrial: "TopLevelTPCDDeprecationTrial", TPCDHeuristics: "TPCDHeuristics", EnterprisePolicy: "EnterprisePolicy", StorageAccess: "StorageAccess", TopLevelStorageAccess: "TopLevelStorageAccess", Scheme: "Scheme", SameSiteNoneCookiesInSandbox: "SameSiteNoneCookiesInSandbox"});
@@ -870,7 +870,7 @@ inspectorBackend.registerCommand("Network.getResponseBodyForInterception", [{"na
870
870
  inspectorBackend.registerCommand("Network.takeResponseBodyForInterceptionAsStream", [{"name": "interceptionId", "type": "string", "optional": false, "description": "", "typeRef": "Network.InterceptionId"}], ["stream"], "Returns a handle to the stream representing the response body. Note that after this command, the intercepted request can't be continued as is -- you either need to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified.");
871
871
  inspectorBackend.registerCommand("Network.replayXHR", [{"name": "requestId", "type": "string", "optional": false, "description": "Identifier of XHR to replay.", "typeRef": "Network.RequestId"}], [], "This method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password.");
872
872
  inspectorBackend.registerCommand("Network.searchInResponseBody", [{"name": "requestId", "type": "string", "optional": false, "description": "Identifier of the network response to search.", "typeRef": "Network.RequestId"}, {"name": "query", "type": "string", "optional": false, "description": "String to search for.", "typeRef": null}, {"name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive.", "typeRef": null}, {"name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex.", "typeRef": null}], ["result"], "Searches for given string in response content.");
873
- inspectorBackend.registerCommand("Network.setBlockedURLs", [{"name": "urlPatterns", "type": "array", "optional": true, "description": "URL patterns to block. Patterns use the URLPattern constructor string syntax (https://urlpattern.spec.whatwg.org/) and must be absolute. Example: `*://*:*/*.css`.", "typeRef": "string"}, {"name": "urls", "type": "array", "optional": true, "description": "URL patterns to block. Wildcards ('*') are allowed.", "typeRef": "string"}], [], "Blocks URLs from loading.");
873
+ inspectorBackend.registerCommand("Network.setBlockedURLs", [{"name": "urlPatterns", "type": "array", "optional": true, "description": "Patterns to match in the order in which they are given. These patterns also take precedence over any wildcard patterns defined in `urls`.", "typeRef": "Network.BlockPattern"}, {"name": "urls", "type": "array", "optional": true, "description": "URL patterns to block. Wildcards ('*') are allowed.", "typeRef": "string"}], [], "Blocks URLs from loading.");
874
874
  inspectorBackend.registerCommand("Network.setBypassServiceWorker", [{"name": "bypass", "type": "boolean", "optional": false, "description": "Bypass service worker and load from network.", "typeRef": null}], [], "Toggles ignoring of service worker for each request.");
875
875
  inspectorBackend.registerCommand("Network.setCacheDisabled", [{"name": "cacheDisabled", "type": "boolean", "optional": false, "description": "Cache disabled state.", "typeRef": null}], [], "Toggles ignoring cache for each request. If `true`, cache will not be used.");
876
876
  inspectorBackend.registerCommand("Network.setCookie", [{"name": "name", "type": "string", "optional": false, "description": "Cookie name.", "typeRef": null}, {"name": "value", "type": "string", "optional": false, "description": "Cookie value.", "typeRef": null}, {"name": "url", "type": "string", "optional": true, "description": "The request-URI to associate with the setting of the cookie. This value can affect the default domain, path, source port, and source scheme values of the created cookie.", "typeRef": null}, {"name": "domain", "type": "string", "optional": true, "description": "Cookie domain.", "typeRef": null}, {"name": "path", "type": "string", "optional": true, "description": "Cookie path.", "typeRef": null}, {"name": "secure", "type": "boolean", "optional": true, "description": "True if cookie is secure.", "typeRef": null}, {"name": "httpOnly", "type": "boolean", "optional": true, "description": "True if cookie is http-only.", "typeRef": null}, {"name": "sameSite", "type": "string", "optional": true, "description": "Cookie SameSite type.", "typeRef": "Network.CookieSameSite"}, {"name": "expires", "type": "number", "optional": true, "description": "Cookie expiration date, session cookie if not set", "typeRef": "Network.TimeSinceEpoch"}, {"name": "priority", "type": "string", "optional": true, "description": "Cookie Priority type.", "typeRef": "Network.CookiePriority"}, {"name": "sameParty", "type": "boolean", "optional": true, "description": "True if cookie is SameParty.", "typeRef": null}, {"name": "sourceScheme", "type": "string", "optional": true, "description": "Cookie source scheme type.", "typeRef": "Network.CookieSourceScheme"}, {"name": "sourcePort", "type": "number", "optional": true, "description": "Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.", "typeRef": null}, {"name": "partitionKey", "type": "object", "optional": true, "description": "Cookie partition key. If not set, the cookie will be set as not partitioned.", "typeRef": "Network.CookiePartitionKey"}], ["success"], "Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.");
@@ -912,6 +912,7 @@ inspectorBackend.registerType("Network.SignedExchangeHeader", [{"name": "request
912
912
  inspectorBackend.registerType("Network.SignedExchangeError", [{"name": "message", "type": "string", "optional": false, "description": "Error message.", "typeRef": null}, {"name": "signatureIndex", "type": "number", "optional": true, "description": "The index of the signature which caused the error.", "typeRef": null}, {"name": "errorField", "type": "string", "optional": true, "description": "The field which caused the error.", "typeRef": "Network.SignedExchangeErrorField"}]);
913
913
  inspectorBackend.registerType("Network.SignedExchangeInfo", [{"name": "outerResponse", "type": "object", "optional": false, "description": "The outer response of signed HTTP exchange which was received from network.", "typeRef": "Network.Response"}, {"name": "hasExtraInfo", "type": "boolean", "optional": false, "description": "Whether network response for the signed exchange was accompanied by extra headers.", "typeRef": null}, {"name": "header", "type": "object", "optional": true, "description": "Information about the signed exchange header.", "typeRef": "Network.SignedExchangeHeader"}, {"name": "securityDetails", "type": "object", "optional": true, "description": "Security details for the signed exchange header.", "typeRef": "Network.SecurityDetails"}, {"name": "errors", "type": "array", "optional": true, "description": "Errors occurred while handling the signed exchange.", "typeRef": "Network.SignedExchangeError"}]);
914
914
  inspectorBackend.registerType("Network.NetworkConditions", [{"name": "urlPattern", "type": "string", "optional": false, "description": "Only matching requests will be affected by these conditions. Patterns use the URLPattern constructor string syntax (https://urlpattern.spec.whatwg.org/) and must be absolute. If the pattern is empty, all requests are matched (including p2p connections).", "typeRef": null}, {"name": "latency", "type": "number", "optional": false, "description": "Minimum latency from request sent to response headers received (ms).", "typeRef": null}, {"name": "downloadThroughput", "type": "number", "optional": false, "description": "Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.", "typeRef": null}, {"name": "uploadThroughput", "type": "number", "optional": false, "description": "Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.", "typeRef": null}, {"name": "connectionType", "type": "string", "optional": true, "description": "Connection type if known.", "typeRef": "Network.ConnectionType"}, {"name": "packetLoss", "type": "number", "optional": true, "description": "WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.", "typeRef": null}, {"name": "packetQueueLength", "type": "number", "optional": true, "description": "WebRTC packet queue length (packet). 0 removes any queue length limitations.", "typeRef": null}, {"name": "packetReordering", "type": "boolean", "optional": true, "description": "WebRTC packetReordering feature.", "typeRef": null}]);
915
+ inspectorBackend.registerType("Network.BlockPattern", [{"name": "urlPattern", "type": "string", "optional": false, "description": "URL pattern to match. Patterns use the URLPattern constructor string syntax (https://urlpattern.spec.whatwg.org/) and must be absolute. Example: `*://*:*/*.css`.", "typeRef": null}, {"name": "block", "type": "boolean", "optional": false, "description": "Whether or not to block the pattern. If false, a matching request will not be blocked even if it matches a later `BlockPattern`.", "typeRef": null}]);
915
916
  inspectorBackend.registerType("Network.DirectTCPSocketOptions", [{"name": "noDelay", "type": "boolean", "optional": false, "description": "TCP_NODELAY option", "typeRef": null}, {"name": "keepAliveDelay", "type": "number", "optional": true, "description": "Expected to be unsigned integer.", "typeRef": null}, {"name": "sendBufferSize", "type": "number", "optional": true, "description": "Expected to be unsigned integer.", "typeRef": null}, {"name": "receiveBufferSize", "type": "number", "optional": true, "description": "Expected to be unsigned integer.", "typeRef": null}, {"name": "dnsQueryType", "type": "string", "optional": true, "description": "", "typeRef": "Network.DirectSocketDnsQueryType"}]);
916
917
  inspectorBackend.registerType("Network.DirectUDPSocketOptions", [{"name": "remoteAddr", "type": "string", "optional": true, "description": "", "typeRef": null}, {"name": "remotePort", "type": "number", "optional": true, "description": "Unsigned int 16.", "typeRef": null}, {"name": "localAddr", "type": "string", "optional": true, "description": "", "typeRef": null}, {"name": "localPort", "type": "number", "optional": true, "description": "Unsigned int 16.", "typeRef": null}, {"name": "dnsQueryType", "type": "string", "optional": true, "description": "", "typeRef": "Network.DirectSocketDnsQueryType"}, {"name": "sendBufferSize", "type": "number", "optional": true, "description": "Expected to be unsigned integer.", "typeRef": null}, {"name": "receiveBufferSize", "type": "number", "optional": true, "description": "Expected to be unsigned integer.", "typeRef": null}]);
917
918
  inspectorBackend.registerType("Network.DirectUDPMessage", [{"name": "data", "type": "string", "optional": false, "description": "", "typeRef": null}, {"name": "remoteAddr", "type": "string", "optional": true, "description": "Null for connected mode.", "typeRef": null}, {"name": "remotePort", "type": "number", "optional": true, "description": "Null for connected mode. Expected to be unsigned integer.", "typeRef": null}]);
@@ -4375,6 +4375,7 @@ export const generatedProperties = [
4375
4375
  "capitalize",
4376
4376
  "uppercase",
4377
4377
  "lowercase",
4378
+ "full-width",
4378
4379
  "none",
4379
4380
  "math-auto"
4380
4381
  ],
@@ -6803,6 +6804,7 @@ export const generatedPropertyValues = {
6803
6804
  "capitalize",
6804
6805
  "uppercase",
6805
6806
  "lowercase",
6807
+ "full-width",
6806
6808
  "none",
6807
6809
  "math-auto"
6808
6810
  ]
@@ -10466,6 +10466,7 @@ export namespace Network {
10466
10466
  Preload = 'preload',
10467
10467
  SignedExchange = 'SignedExchange',
10468
10468
  Preflight = 'preflight',
10469
+ FedCM = 'FedCM',
10469
10470
  Other = 'other',
10470
10471
  }
10471
10472
 
@@ -11046,6 +11047,19 @@ export namespace Network {
11046
11047
  packetReordering?: boolean;
11047
11048
  }
11048
11049
 
11050
+ export interface BlockPattern {
11051
+ /**
11052
+ * URL pattern to match. Patterns use the URLPattern constructor string syntax
11053
+ * (https://urlpattern.spec.whatwg.org/) and must be absolute. Example: `*://*:*\/*.css`.
11054
+ */
11055
+ urlPattern: string;
11056
+ /**
11057
+ * Whether or not to block the pattern. If false, a matching request will not be blocked even if it matches a later
11058
+ * `BlockPattern`.
11059
+ */
11060
+ block: boolean;
11061
+ }
11062
+
11049
11063
  export const enum DirectSocketDnsQueryType {
11050
11064
  Ipv4 = 'ipv4',
11051
11065
  Ipv6 = 'ipv6',
@@ -11607,10 +11621,10 @@ export namespace Network {
11607
11621
 
11608
11622
  export interface SetBlockedURLsRequest {
11609
11623
  /**
11610
- * URL patterns to block. Patterns use the URLPattern constructor string syntax
11611
- * (https://urlpattern.spec.whatwg.org/) and must be absolute. Example: `*://*:*\/*.css`.
11624
+ * Patterns to match in the order in which they are given. These patterns
11625
+ * also take precedence over any wildcard patterns defined in `urls`.
11612
11626
  */
11613
- urlPatterns?: string[];
11627
+ urlPatterns?: BlockPattern[];
11614
11628
  /**
11615
11629
  * URL patterns to block. Wildcards ('*') are allowed.
11616
11630
  * @deprecated
@@ -0,0 +1,111 @@
1
+ // Copyright 2025 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import * as Root from '../../core/root/root.js';
6
+
7
+ let builtInAiInstance: BuiltInAi|undefined;
8
+ let availability = '';
9
+
10
+ const RESPONSE_SCHEMA = {
11
+ type: 'object',
12
+ properties: {
13
+ header: {type: 'string', maxLength: 60, description: 'Label for the console message which is being analyzed'},
14
+ // No hard `maxLength` for `explanation`. This would often result in responses which are cut off in the middle of a
15
+ // sentence. Instead provide a soft `maxLength` via the prompt.
16
+ explanation: {
17
+ type: 'string',
18
+ description: 'Actual explanation of the console message being analyzed',
19
+ },
20
+ },
21
+ required: ['header', 'explanation'],
22
+ additionalProperties: false,
23
+ };
24
+
25
+ export interface LanguageModel {
26
+ promptStreaming: (arg0: string, opts?: {
27
+ responseConstraint: Object,
28
+ signal?: AbortSignal,
29
+ }) => AsyncGenerator<string>;
30
+ clone: () => LanguageModel;
31
+ destroy: () => void;
32
+ }
33
+
34
+ export class BuiltInAi {
35
+ #consoleInsightsSession: LanguageModel;
36
+
37
+ static async isAvailable(): Promise<boolean> {
38
+ if (!Root.Runtime.hostConfig.devToolsAiPromptApi?.enabled) {
39
+ return false;
40
+ }
41
+ // @ts-expect-error
42
+ availability = await window.LanguageModel.availability({expectedOutputs: [{type: 'text', languages: ['en']}]});
43
+ return availability === 'available';
44
+ }
45
+
46
+ static cachedIsAvailable(): boolean {
47
+ return availability === 'available';
48
+ }
49
+
50
+ private constructor(consoleInsightsSession: LanguageModel) {
51
+ this.#consoleInsightsSession = consoleInsightsSession;
52
+ }
53
+
54
+ static async instance(): Promise<BuiltInAi|undefined> {
55
+ if (builtInAiInstance === undefined) {
56
+ if (!(await BuiltInAi.isAvailable())) {
57
+ return undefined;
58
+ }
59
+ // @ts-expect-error
60
+ const consoleInsightsSession = await window.LanguageModel.create({
61
+ initialPrompts: [{
62
+ role: 'system',
63
+ content: `
64
+ You are an expert web developer. Your goal is to help a human web developer who
65
+ is using Chrome DevTools to debug a web site or web app. The Chrome DevTools
66
+ console is showing a message which is either an error or a warning. Please help
67
+ the user understand the problematic console message.
68
+
69
+ Your instructions are as follows:
70
+ - Explain the reason why the error or warning is showing up.
71
+ - The explanation has a maximum length of 200 characters. Anything beyond this
72
+ length will be cut off. Make sure that your explanation is at most 200 characters long.
73
+ - Your explanation should not end in the middle of a sentence.
74
+ - Your explanation should consist of a single paragraph only. Do not include any
75
+ headings or code blocks. Only write a single paragraph of text.
76
+ - Your response should be concise and to the point. Avoid lengthy explanations
77
+ or unnecessary details.
78
+ `
79
+ }],
80
+ expectedInputs: [{
81
+ type: 'text',
82
+ languages: ['en'],
83
+ }],
84
+ expectedOutputs: [{
85
+ type: 'text',
86
+ languages: ['en'],
87
+ }],
88
+ }) as LanguageModel;
89
+ builtInAiInstance = new BuiltInAi(consoleInsightsSession);
90
+ }
91
+ return builtInAiInstance;
92
+ }
93
+
94
+ static removeInstance(): void {
95
+ builtInAiInstance = undefined;
96
+ }
97
+
98
+ async * getConsoleInsight(prompt: string, abortController: AbortController): AsyncGenerator<string> {
99
+ // Clone the session to start a fresh conversation for each answer. Otherwise
100
+ // previous dialog would pollute the context resulting in worse answers.
101
+ const session = await this.#consoleInsightsSession.clone();
102
+ const stream = session.promptStreaming(prompt, {
103
+ signal: abortController.signal,
104
+ responseConstraint: RESPONSE_SCHEMA,
105
+ });
106
+ for await (const chunk of stream) {
107
+ yield chunk;
108
+ }
109
+ session.destroy();
110
+ }
111
+ }
@@ -8,8 +8,6 @@ import * as i18n from '../../core/i18n/i18n.js';
8
8
  import * as Platform from '../../core/platform/platform.js';
9
9
  import * as Root from '../../core/root/root.js';
10
10
  import * as SDK from '../../core/sdk/sdk.js';
11
- import * as Snackbars from '../../ui/components/snackbars/snackbars.js';
12
- import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
13
11
  import * as NetworkTimeCalculator from '../network_time_calculator/network_time_calculator.js';
14
12
 
15
13
  import {
@@ -55,13 +53,6 @@ export interface ExternalPerformanceRequestParameters {
55
53
  data: ExternalPerformanceAIConversationData;
56
54
  }
57
55
 
58
- const UIStrings = {
59
- /**
60
- * @description Notification shown to the user whenever DevTools receives an external request.
61
- */
62
- externalRequestReceived: '`DevTools` received an external request',
63
- } as const;
64
-
65
56
  /*
66
57
  * Strings that don't need to be translated at this time.
67
58
  */
@@ -72,8 +63,6 @@ const UIStringsNotTranslate = {
72
63
  enableInSettings: 'For AI features to be available, you need to enable AI assistance in DevTools settings.',
73
64
  } as const;
74
65
 
75
- const str_ = i18n.i18n.registerUIStrings('models/ai_assistance/ConversationHandler.ts', UIStrings);
76
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
77
66
  const lockedString = i18n.i18n.lockedString;
78
67
 
79
68
  function isAiAssistanceServerSideLoggingEnabled(): boolean {
@@ -124,13 +113,14 @@ async function inspectNetworkRequestByUrl(selector: string): Promise<SDK.Network
124
113
 
125
114
  let conversationHandlerInstance: ConversationHandler|undefined;
126
115
 
127
- export class ConversationHandler {
116
+ export class ConversationHandler extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
128
117
  #aiAssistanceEnabledSetting: Common.Settings.Setting<boolean>|undefined;
129
118
  #aidaClient: Host.AidaClient.AidaClient;
130
119
  #aidaAvailability?: Host.AidaClient.AidaAccessPreconditions;
131
120
 
132
121
  private constructor(
133
122
  aidaClient: Host.AidaClient.AidaClient, aidaAvailability?: Host.AidaClient.AidaAccessPreconditions) {
123
+ super();
134
124
  this.#aidaClient = aidaClient;
135
125
  if (aidaAvailability) {
136
126
  this.#aidaAvailability = aidaAvailability;
@@ -186,7 +176,7 @@ export class ConversationHandler {
186
176
  ExternalPerformanceRequestParameters,
187
177
  ): Promise<AsyncGenerator<ExternalRequestResponse, ExternalRequestResponse>> {
188
178
  try {
189
- Snackbars.Snackbar.Snackbar.show({message: i18nString(UIStrings.externalRequestReceived)});
179
+ this.dispatchEventToListeners(ConversationHandlerEvents.EXTERNAL_REQUEST_RECEIVED);
190
180
  const disabledReasons = await this.#getDisabledReasons();
191
181
  const aiAssistanceSetting = this.#aiAssistanceEnabledSetting?.getIfNotDisabled();
192
182
  if (!aiAssistanceSetting) {
@@ -196,7 +186,8 @@ export class ConversationHandler {
196
186
  return this.#generateErrorResponse(disabledReasons.join(' '));
197
187
  }
198
188
 
199
- void VisualLogging.logFunctionCall(`start-conversation-${parameters.conversationType}`, 'external');
189
+ this.dispatchEventToListeners(
190
+ ConversationHandlerEvents.EXTERNAL_CONVERSATION_STARTED, parameters.conversationType);
200
191
  switch (parameters.conversationType) {
201
192
  case ConversationType.STYLING: {
202
193
  return await this.#handleExternalStylingConversation(parameters.prompt, parameters.selector);
@@ -356,3 +347,13 @@ export class ConversationHandler {
356
347
  return agent;
357
348
  }
358
349
  }
350
+
351
+ export const enum ConversationHandlerEvents {
352
+ EXTERNAL_REQUEST_RECEIVED = 'ExternalRequestReceived',
353
+ EXTERNAL_CONVERSATION_STARTED = 'ExternalConversationStarted',
354
+ }
355
+
356
+ export interface EventTypes {
357
+ [ConversationHandlerEvents.EXTERNAL_REQUEST_RECEIVED]: void;
358
+ [ConversationHandlerEvents.EXTERNAL_CONVERSATION_STARTED]: ConversationType;
359
+ }
@@ -2,27 +2,56 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- export * from './debug.js';
6
- export * from './AgentProject.js';
7
- export * from './agents/AiAgent.js';
8
- export * from './agents/FileAgent.js';
9
- export * from './agents/NetworkAgent.js';
10
- export * from './agents/PerformanceAgent.js';
11
- export * from './agents/PerformanceAnnotationsAgent.js';
12
- export * from './agents/StylingAgent.js';
13
- export * from './agents/PatchAgent.js';
14
- export * from './AiHistoryStorage.js';
15
- export * from './AiUtils.js';
16
- export * from './ChangeManager.js';
17
- export * from './EvaluateAction.js';
18
- export * from './ExtensionScope.js';
19
- export * from './data_formatters/FileFormatter.js';
20
- export * from './data_formatters/NetworkRequestFormatter.js';
21
- export * from './data_formatters/PerformanceInsightFormatter.js';
22
- export * from './data_formatters/PerformanceTraceFormatter.js';
23
- export * from './data_formatters/UnitFormatters.js';
24
- export * from './ConversationHandler.js';
25
- export * from './injected.js';
26
- export * from './performance/AICallTree.js';
27
- export * from './performance/AIContext.js';
28
- export * from './performance/AIQueries.js';
5
+ import * as AgentProject from './AgentProject.js';
6
+ import * as AiAgent from './agents/AiAgent.js';
7
+ import * as FileAgent from './agents/FileAgent.js';
8
+ import * as NetworkAgent from './agents/NetworkAgent.js';
9
+ import * as PatchAgent from './agents/PatchAgent.js';
10
+ import * as PerformanceAgent from './agents/PerformanceAgent.js';
11
+ import * as PerformanceAnnotationsAgent from './agents/PerformanceAnnotationsAgent.js';
12
+ import * as StylingAgent from './agents/StylingAgent.js';
13
+ import * as AiHistoryStorage from './AiHistoryStorage.js';
14
+ import * as AiUtils from './AiUtils.js';
15
+ import * as BuiltInAi from './BuiltInAi.js';
16
+ import * as ChangeManager from './ChangeManager.js';
17
+ import * as ConversationHandler from './ConversationHandler.js';
18
+ import * as FileFormatter from './data_formatters/FileFormatter.js';
19
+ import * as NetworkRequestFormatter from './data_formatters/NetworkRequestFormatter.js';
20
+ import * as PerformanceInsightFormatter from './data_formatters/PerformanceInsightFormatter.js';
21
+ import * as PerformanceTraceFormatter from './data_formatters/PerformanceTraceFormatter.js';
22
+ import * as UnitFormatters from './data_formatters/UnitFormatters.js';
23
+ import * as Debug from './debug.js';
24
+ import * as EvaluateAction from './EvaluateAction.js';
25
+ import * as ExtensionScope from './ExtensionScope.js';
26
+ import * as Injected from './injected.js';
27
+ import * as AICallTree from './performance/AICallTree.js';
28
+ import * as AIContext from './performance/AIContext.js';
29
+ import * as AIQueries from './performance/AIQueries.js';
30
+
31
+ export {
32
+ AgentProject,
33
+ AiAgent,
34
+ AICallTree,
35
+ AIContext,
36
+ AiHistoryStorage,
37
+ AIQueries,
38
+ AiUtils,
39
+ BuiltInAi,
40
+ ChangeManager,
41
+ ConversationHandler,
42
+ Debug,
43
+ EvaluateAction,
44
+ ExtensionScope,
45
+ FileAgent,
46
+ FileFormatter,
47
+ Injected,
48
+ NetworkAgent,
49
+ NetworkRequestFormatter,
50
+ PatchAgent,
51
+ PerformanceAgent,
52
+ PerformanceAnnotationsAgent,
53
+ PerformanceInsightFormatter,
54
+ PerformanceTraceFormatter,
55
+ StylingAgent,
56
+ UnitFormatters,
57
+ };
@@ -346,6 +346,51 @@ Layout shifts in this cluster:
346
346
  - https://web.dev/articles/optimize-cls
347
347
  === end content
348
348
 
349
+ Title: PerformanceInsightFormatter CLS includes iframe root causes
350
+ Content:
351
+ ## Insight Title: Layout shift culprits
352
+
353
+ ## Insight Summary:
354
+ Cumulative Layout Shifts (CLS) is a measure of the largest burst of layout shifts for every unexpected layout shift that occurs during the lifecycle of a page. This is a Core Web Vital and the thresholds for categorizing a score are:
355
+ - Good: 0.1 or less
356
+ - Needs improvement: more than 0.1 and less than or equal to 0.25
357
+ - Bad: over 0.25
358
+
359
+ ## Detailed analysis:
360
+ The worst layout shift cluster was the cluster that started at 2,712 ms and ended at 3,913 ms, with a duration of 1,200 ms.
361
+ The score for this cluster is 0.0832.
362
+
363
+ Layout shifts in this cluster:
364
+ ### Layout shift 1:
365
+ - Impacted elements:
366
+ - DIV class='max-w-6xl mx-auto bg-white shadow-lg min-h-screen relative z-[99999]'
367
+ - BUTTON class='text-gray-700 hover:text-red-600 w-6 h-6 flex items-center justify-center'
368
+ - #text
369
+
370
+ - Start time: 2,712 ms
371
+ - Score: 0.0832
372
+ - Potential root causes:
373
+ - An iframe (id: D12A05FC36C4D90C7826DDD3E9D7035B, url: https://astro-news-1026410574114.us-central1.run.app/ads/fireplace-ad-top.html was injected into the page)
374
+ - An iframe (id: 8CDF5BC2F8AD1DCF04A38398E95671FC, url: https://astro-news-1026410574114.us-central1.run.app/ads/fireplace-ad-right.html was injected into the page)
375
+ - An iframe (id: 022F4D6C4B361B315A1A7C18B98AA9C4, url: https://astro-news-1026410574114.us-central1.run.app/ads/fireplace-ad-left.html was injected into the page)
376
+ ### Layout shift 2:
377
+ - Impacted elements:
378
+ - #text
379
+ - A class='button'
380
+
381
+ - Start time: 2,913 ms
382
+ - Score: 0.0000
383
+ - Potential root causes:
384
+ - A font that was loaded over the network: https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2 (eventKey: s-11464, ts: 153867214727).
385
+
386
+ ## Estimated savings: none
387
+
388
+ ## External resources:
389
+ - https://developer.chrome.com/docs/performance/insights/cls-culprit
390
+ - https://web.dev/articles/cls
391
+ - https://web.dev/articles/optimize-cls
392
+ === end content
393
+
349
394
  Title: PerformanceInsightFormatter CLS serializes correctly when there are no layout shifts
350
395
  Content:
351
396
  ## Insight Title: Layout shift culprits
@@ -383,50 +428,110 @@ The score for this cluster is 0.0140.
383
428
 
384
429
  Layout shifts in this cluster:
385
430
  ### Layout shift 1:
431
+ - Impacted elements:
432
+ - P
433
+ - P
434
+ - P
435
+
386
436
  - Start time: 60 ms
387
437
  - Score: 0.0012
388
438
  - No potential root causes identified
389
439
  ### Layout shift 2:
440
+ - Impacted elements:
441
+ - P
442
+ - P
443
+ - P
444
+
390
445
  - Start time: 76 ms
391
446
  - Score: 0.0012
392
447
  - No potential root causes identified
393
448
  ### Layout shift 3:
449
+ - Impacted elements:
450
+ - P
451
+ - P
452
+ - P
453
+
394
454
  - Start time: 93 ms
395
455
  - Score: 0.0012
396
456
  - No potential root causes identified
397
457
  ### Layout shift 4:
458
+ - Impacted elements:
459
+ - P
460
+ - P
461
+ - P
462
+
398
463
  - Start time: 110 ms
399
464
  - Score: 0.0012
400
465
  - No potential root causes identified
401
466
  ### Layout shift 5:
467
+ - Impacted elements:
468
+ - P
469
+ - P
470
+ - P
471
+
402
472
  - Start time: 126 ms
403
473
  - Score: 0.0012
404
474
  - No potential root causes identified
405
475
  ### Layout shift 6:
476
+ - Impacted elements:
477
+ - P
478
+ - P
479
+ - P
480
+
406
481
  - Start time: 143 ms
407
482
  - Score: 0.0012
408
483
  - No potential root causes identified
409
484
  ### Layout shift 7:
485
+ - Impacted elements:
486
+ - P
487
+ - P
488
+ - P
489
+
410
490
  - Start time: 160 ms
411
491
  - Score: 0.0012
412
492
  - No potential root causes identified
413
493
  ### Layout shift 8:
494
+ - Impacted elements:
495
+ - P
496
+ - P
497
+ - P
498
+
414
499
  - Start time: 176 ms
415
500
  - Score: 0.0012
416
501
  - No potential root causes identified
417
502
  ### Layout shift 9:
503
+ - Impacted elements:
504
+ - P
505
+ - P
506
+ - P
507
+
418
508
  - Start time: 193 ms
419
509
  - Score: 0.0012
420
510
  - No potential root causes identified
421
511
  ### Layout shift 10:
512
+ - Impacted elements:
513
+ - P
514
+ - P
515
+ - P
516
+
422
517
  - Start time: 210 ms
423
518
  - Score: 0.0012
424
519
  - No potential root causes identified
425
520
  ### Layout shift 11:
521
+ - Impacted elements:
522
+ - P
523
+ - P
524
+ - P
525
+
426
526
  - Start time: 226 ms
427
527
  - Score: 0.0012
428
528
  - No potential root causes identified
429
529
  ### Layout shift 12:
530
+ - Impacted elements:
531
+ - P
532
+ - P
533
+ - P
534
+
430
535
  - Start time: 243 ms
431
536
  - Score: 0.0012
432
537
  - Potential root causes:
@@ -280,7 +280,12 @@ export class PerformanceInsightFormatter {
280
280
  '- No potential root causes identified';
281
281
 
282
282
  const startTime = Trace.Helpers.Timing.microToMilli(Trace.Types.Timing.Micro(shift.ts - baseTime));
283
- return `### Layout shift ${index + 1}:
283
+
284
+ const impactedNodeNames =
285
+ shift.rawSourceEvent.args.data?.impacted_nodes?.map(n => n.debug_name).filter(name => name !== undefined) ?? [];
286
+ const impactedNodeText =
287
+ impactedNodeNames.length ? `\n- Impacted elements:\n - ${impactedNodeNames.join('\n - ')}\n` : '';
288
+ return `### Layout shift ${index + 1}:${impactedNodeText}
284
289
  - Start time: ${millis(startTime)}
285
290
  - Score: ${shift.args.data?.weighted_score_delta.toFixed(4)}
286
291
  ${rootCauseText}`;
@@ -76,6 +76,7 @@ export class ExtensionView extends UI.Widget.Widget {
76
76
  }
77
77
 
78
78
  override willHide(): void {
79
+ super.willHide();
79
80
  if (typeof this.#frameIndex === 'number') {
80
81
  this.#server.notifyViewHidden(this.#id);
81
82
  }
@@ -104,10 +105,12 @@ export class ExtensionNotifierView extends UI.Widget.VBox {
104
105
  }
105
106
 
106
107
  override wasShown(): void {
108
+ super.wasShown();
107
109
  this.server.notifyViewShown(this.id);
108
110
  }
109
111
 
110
112
  override willHide(): void {
113
+ super.willHide();
111
114
  this.server.notifyViewHidden(this.id);
112
115
  }
113
116
  }