chrome-devtools-frontend 1.0.1526203 → 1.0.1528866

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 (328) hide show
  1. package/docs/ui_engineering.md +159 -0
  2. package/eslint.config.mjs +6 -1
  3. package/front_end/core/i18n/i18nImpl.ts +5 -0
  4. package/front_end/core/protocol_client/protocol_client.ts +1 -1
  5. package/front_end/core/root/Runtime.ts +28 -4
  6. package/front_end/core/sdk/CSSMatchedStyles.ts +50 -7
  7. package/front_end/core/sdk/CSSRule.ts +35 -6
  8. package/front_end/core/sdk/ChildTargetManager.ts +2 -0
  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 +214 -31
  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 +37 -11
  18. package/front_end/core/sdk/SourceMapManager.ts +13 -2
  19. package/front_end/core/sdk/SourceMapScopesInfo.ts +17 -0
  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 +20 -25
  26. package/front_end/generated/InspectorBackendCommands.js +4 -3
  27. package/front_end/generated/protocol-mapping.d.ts +3 -1
  28. package/front_end/generated/protocol-proxy-api.d.ts +3 -1
  29. package/front_end/generated/protocol.ts +17 -3
  30. package/front_end/models/ai_assistance/BuiltInAi.ts +111 -0
  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 +23 -27
  36. package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +31 -29
  37. package/front_end/models/persistence/EditFileSystemView.ts +1 -0
  38. package/front_end/models/source_map_scopes/NamesResolver.ts +5 -11
  39. package/front_end/models/stack_trace/Trie.ts +9 -0
  40. package/front_end/models/trace/lantern/types/Lantern.ts +1 -1
  41. package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -0
  42. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +1 -0
  43. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +120 -113
  44. package/front_end/panels/ai_assistance/PatchWidget.ts +9 -8
  45. package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +2 -0
  46. package/front_end/panels/ai_assistance/components/ChatView.ts +29 -29
  47. package/front_end/panels/ai_assistance/components/UserActionRow.ts +1 -0
  48. package/front_end/panels/animation/AnimationTimeline.ts +1 -0
  49. package/front_end/panels/application/CookieItemsView.ts +1 -0
  50. package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -0
  51. package/front_end/panels/application/ServiceWorkerCacheViews.ts +2 -0
  52. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +11 -5
  53. package/front_end/panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts +2 -2
  54. package/front_end/panels/application/preloading/components/PreloadingString.ts +7 -5
  55. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +22 -10
  56. package/front_end/panels/changes/CombinedDiffView.ts +1 -0
  57. package/front_end/panels/console/ConsoleInsightTeaser.ts +106 -0
  58. package/front_end/panels/console/ConsolePanel.ts +2 -0
  59. package/front_end/panels/console/ConsolePrompt.ts +12 -2
  60. package/front_end/panels/console/ConsoleSidebar.ts +1 -1
  61. package/front_end/panels/console/ConsoleView.ts +12 -0
  62. package/front_end/panels/console/ConsoleViewMessage.ts +27 -0
  63. package/front_end/panels/{explain → console}/PromptBuilder.ts +12 -7
  64. package/front_end/panels/console/console.ts +6 -0
  65. package/front_end/panels/console/consoleInsightTeaser.css +55 -0
  66. package/front_end/panels/coverage/CoverageListView.ts +141 -277
  67. package/front_end/panels/coverage/CoverageView.ts +330 -324
  68. package/front_end/panels/coverage/coverageView.css +17 -0
  69. package/front_end/panels/elements/ComputedStyleWidget.ts +1 -0
  70. package/front_end/panels/elements/LayoutPane.ts +1 -0
  71. package/front_end/panels/elements/NodeStackTraceWidget.ts +1 -0
  72. package/front_end/panels/elements/StylePropertyTreeElement.ts +5 -1
  73. package/front_end/panels/elements/stylePropertiesTreeOutline.css +17 -0
  74. package/front_end/panels/emulation/DeviceModeView.ts +2 -0
  75. package/front_end/panels/explain/ActionDelegate.ts +1 -2
  76. package/front_end/panels/explain/components/ConsoleInsight.ts +14 -12
  77. package/front_end/panels/explain/explain.ts +0 -1
  78. package/front_end/panels/js_timeline/js_timeline-meta.ts +1 -1
  79. package/front_end/panels/layer_viewer/Layers3DView.ts +2 -0
  80. package/front_end/panels/lighthouse/LighthouseReportSelector.ts +1 -0
  81. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +12 -19
  82. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +27 -43
  83. package/front_end/panels/media/MainView.ts +1 -0
  84. package/front_end/panels/media/TickingFlameChart.ts +2 -0
  85. package/front_end/panels/network/BlockedURLsPane.ts +111 -85
  86. package/front_end/panels/network/EventSourceMessagesView.ts +1 -0
  87. package/front_end/panels/network/NetworkItemView.ts +1 -0
  88. package/front_end/panels/network/NetworkLogView.ts +9 -7
  89. package/front_end/panels/network/NetworkOverview.ts +1 -0
  90. package/front_end/panels/network/RequestCookiesView.ts +1 -0
  91. package/front_end/panels/network/RequestHTMLView.ts +1 -0
  92. package/front_end/panels/network/RequestInitiatorView.ts +1 -0
  93. package/front_end/panels/network/RequestPayloadView.ts +1 -0
  94. package/front_end/panels/network/RequestPreviewView.ts +1 -0
  95. package/front_end/panels/network/RequestResponseView.ts +2 -1
  96. package/front_end/panels/network/RequestTimingView.ts +2 -0
  97. package/front_end/panels/network/ResourceDirectSocketChunkView.ts +1 -0
  98. package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -0
  99. package/front_end/panels/network/components/RequestHeadersView.ts +2 -0
  100. package/front_end/panels/network/components/RequestTrustTokensView.ts +2 -0
  101. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -0
  102. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +2 -0
  103. package/front_end/panels/profiler/HeapSnapshotView.ts +7 -0
  104. package/front_end/panels/profiler/IsolateSelector.ts +1 -0
  105. package/front_end/panels/profiler/LiveHeapProfileView.ts +1 -0
  106. package/front_end/panels/profiler/ProfileView.ts +1 -0
  107. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -0
  108. package/front_end/panels/recorder/RecorderPanel.ts +2 -0
  109. package/front_end/panels/screencast/ScreencastView.ts +1 -0
  110. package/front_end/panels/search/SearchView.ts +1 -0
  111. package/front_end/panels/settings/AISettingsTab.ts +3 -3
  112. package/front_end/panels/settings/WorkspaceSettingsTab.ts +2 -0
  113. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
  114. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +12 -0
  115. package/front_end/panels/sources/BreakpointsView.ts +1 -0
  116. package/front_end/panels/sources/DebuggerPlugin.ts +1 -0
  117. package/front_end/panels/sources/UISourceCodeFrame.ts +17 -2
  118. package/front_end/panels/timeline/README.md +2 -2
  119. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -1
  120. package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -3
  121. package/front_end/panels/timeline/TimelineLayersView.ts +1 -0
  122. package/front_end/panels/timeline/TimelinePaintProfilerView.ts +114 -37
  123. package/front_end/panels/timeline/TimelinePanel.ts +43 -62
  124. package/front_end/panels/timeline/TimelineTreeView.ts +1 -0
  125. package/front_end/panels/timeline/components/LiveMetricsView.ts +4 -8
  126. package/front_end/panels/timeline/components/Sidebar.ts +2 -0
  127. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
  128. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +7 -7
  129. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -1
  130. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -4
  131. package/front_end/panels/web_audio/WebAudioView.ts +1 -0
  132. package/front_end/third_party/chromium/README.chromium +1 -1
  133. package/front_end/third_party/lighthouse/README.chromium +2 -2
  134. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1530 -2426
  135. package/front_end/third_party/lighthouse/locales/ar-XB.json +107 -455
  136. package/front_end/third_party/lighthouse/locales/ar.json +107 -455
  137. package/front_end/third_party/lighthouse/locales/bg.json +96 -444
  138. package/front_end/third_party/lighthouse/locales/ca.json +96 -444
  139. package/front_end/third_party/lighthouse/locales/cs.json +96 -444
  140. package/front_end/third_party/lighthouse/locales/da.json +96 -444
  141. package/front_end/third_party/lighthouse/locales/de.json +96 -444
  142. package/front_end/third_party/lighthouse/locales/el.json +96 -444
  143. package/front_end/third_party/lighthouse/locales/en-GB.json +96 -444
  144. package/front_end/third_party/lighthouse/locales/en-US.json +116 -467
  145. package/front_end/third_party/lighthouse/locales/en-XA.json +93 -441
  146. package/front_end/third_party/lighthouse/locales/en-XL.json +116 -467
  147. package/front_end/third_party/lighthouse/locales/es-419.json +96 -444
  148. package/front_end/third_party/lighthouse/locales/es.json +96 -444
  149. package/front_end/third_party/lighthouse/locales/fi.json +96 -444
  150. package/front_end/third_party/lighthouse/locales/fil.json +96 -444
  151. package/front_end/third_party/lighthouse/locales/fr.json +96 -444
  152. package/front_end/third_party/lighthouse/locales/he.json +118 -466
  153. package/front_end/third_party/lighthouse/locales/hi.json +96 -444
  154. package/front_end/third_party/lighthouse/locales/hr.json +100 -448
  155. package/front_end/third_party/lighthouse/locales/hu.json +96 -444
  156. package/front_end/third_party/lighthouse/locales/id.json +96 -444
  157. package/front_end/third_party/lighthouse/locales/it.json +96 -444
  158. package/front_end/third_party/lighthouse/locales/ja.json +96 -444
  159. package/front_end/third_party/lighthouse/locales/ko.json +97 -445
  160. package/front_end/third_party/lighthouse/locales/lt.json +96 -444
  161. package/front_end/third_party/lighthouse/locales/lv.json +97 -445
  162. package/front_end/third_party/lighthouse/locales/nl.json +96 -444
  163. package/front_end/third_party/lighthouse/locales/no.json +96 -444
  164. package/front_end/third_party/lighthouse/locales/pl.json +96 -444
  165. package/front_end/third_party/lighthouse/locales/pt-PT.json +96 -444
  166. package/front_end/third_party/lighthouse/locales/pt.json +97 -445
  167. package/front_end/third_party/lighthouse/locales/ro.json +97 -445
  168. package/front_end/third_party/lighthouse/locales/ru.json +96 -444
  169. package/front_end/third_party/lighthouse/locales/sk.json +96 -444
  170. package/front_end/third_party/lighthouse/locales/sl.json +96 -444
  171. package/front_end/third_party/lighthouse/locales/sr-Latn.json +96 -444
  172. package/front_end/third_party/lighthouse/locales/sr.json +96 -444
  173. package/front_end/third_party/lighthouse/locales/sv.json +96 -444
  174. package/front_end/third_party/lighthouse/locales/ta.json +96 -444
  175. package/front_end/third_party/lighthouse/locales/te.json +97 -445
  176. package/front_end/third_party/lighthouse/locales/th.json +96 -444
  177. package/front_end/third_party/lighthouse/locales/tr.json +96 -444
  178. package/front_end/third_party/lighthouse/locales/uk.json +96 -444
  179. package/front_end/third_party/lighthouse/locales/vi.json +96 -444
  180. package/front_end/third_party/lighthouse/locales/zh-HK.json +96 -444
  181. package/front_end/third_party/lighthouse/locales/zh-TW.json +97 -445
  182. package/front_end/third_party/lighthouse/locales/zh.json +96 -444
  183. package/front_end/third_party/lighthouse/report/bundle.d.ts +8 -14
  184. package/front_end/third_party/lighthouse/report/bundle.js +10 -49
  185. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
  186. package/front_end/third_party/web-vitals/README.chromium +5 -8
  187. package/front_end/third_party/web-vitals/package/README.md +191 -152
  188. package/front_end/third_party/web-vitals/package/dist/modules/attribution/index.d.ts +0 -1
  189. package/front_end/third_party/web-vitals/package/dist/modules/attribution/index.js +0 -1
  190. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.d.ts +2 -2
  191. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.js +45 -26
  192. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.d.ts +2 -2
  193. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js +3 -3
  194. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.d.ts +10 -10
  195. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +307 -206
  196. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +2 -2
  197. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +69 -49
  198. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.d.ts +2 -2
  199. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js +2 -2
  200. package/front_end/third_party/web-vitals/package/dist/modules/index.d.ts +0 -1
  201. package/front_end/third_party/web-vitals/package/dist/modules/index.js +0 -1
  202. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +33 -0
  203. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +111 -0
  204. package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.d.ts +4 -0
  205. package/front_end/third_party/web-vitals/package/dist/modules/{attribution/deprecated.js → lib/LCPEntryManager.js} +6 -7
  206. package/front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.d.ts +6 -0
  207. package/front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.js +44 -0
  208. package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.js +1 -1
  209. package/front_end/third_party/web-vitals/package/dist/modules/lib/generateUniqueID.js +1 -1
  210. package/front_end/third_party/web-vitals/package/dist/modules/lib/getActivationStart.js +1 -1
  211. package/front_end/third_party/web-vitals/package/dist/modules/lib/getNavigationEntry.js +5 -7
  212. package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.d.ts +1 -1
  213. package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.js +9 -12
  214. package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.d.ts +1 -0
  215. package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js +52 -33
  216. package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +0 -2
  217. package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.js +2 -2
  218. package/front_end/third_party/web-vitals/package/dist/modules/lib/initUnique.d.ts +6 -0
  219. package/front_end/third_party/web-vitals/package/dist/modules/{deprecated.js → lib/initUnique.js} +11 -4
  220. package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js +3 -6
  221. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js +6 -6
  222. package/front_end/third_party/web-vitals/package/dist/modules/lib/{whenIdle.d.ts → whenIdleOrHidden.d.ts} +1 -1
  223. package/front_end/third_party/web-vitals/package/dist/modules/lib/{whenIdle.js → whenIdleOrHidden.js} +10 -8
  224. package/front_end/third_party/web-vitals/package/dist/modules/onCLS.js +17 -35
  225. package/front_end/third_party/web-vitals/package/dist/modules/onFCP.js +3 -5
  226. package/front_end/third_party/web-vitals/package/dist/modules/onINP.d.ts +9 -7
  227. package/front_end/third_party/web-vitals/package/dist/modules/onINP.js +27 -19
  228. package/front_end/third_party/web-vitals/package/dist/modules/onLCP.js +33 -26
  229. package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.js +2 -4
  230. package/front_end/third_party/web-vitals/package/dist/modules/types/base.d.ts +6 -5
  231. package/front_end/third_party/web-vitals/package/dist/modules/types/cls.d.ts +5 -3
  232. package/front_end/third_party/web-vitals/package/dist/modules/types/inp.d.ts +80 -33
  233. package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +6 -2
  234. package/front_end/third_party/web-vitals/package/dist/modules/types.d.ts +28 -4
  235. package/front_end/third_party/web-vitals/package/dist/modules/types.js +0 -1
  236. package/front_end/third_party/web-vitals/package/package.json +4 -10
  237. package/front_end/third_party/web-vitals/package/src/attribution/index.ts +0 -1
  238. package/front_end/third_party/web-vitals/package/src/attribution/onCLS.ts +58 -33
  239. package/front_end/third_party/web-vitals/package/src/attribution/onFCP.ts +4 -4
  240. package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +382 -258
  241. package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +96 -69
  242. package/front_end/third_party/web-vitals/package/src/attribution/onTTFB.ts +3 -3
  243. package/front_end/third_party/web-vitals/package/src/index.ts +0 -1
  244. package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +146 -0
  245. package/front_end/third_party/web-vitals/package/src/{attribution/deprecated.ts → lib/LCPEntryManager.ts} +6 -9
  246. package/front_end/third_party/web-vitals/package/src/lib/LayoutShiftManager.ts +50 -0
  247. package/front_end/third_party/web-vitals/package/src/lib/bindReporter.ts +1 -1
  248. package/front_end/third_party/web-vitals/package/src/lib/generateUniqueID.ts +1 -1
  249. package/front_end/third_party/web-vitals/package/src/lib/getActivationStart.ts +1 -1
  250. package/front_end/third_party/web-vitals/package/src/lib/getNavigationEntry.ts +5 -8
  251. package/front_end/third_party/web-vitals/package/src/lib/getSelector.ts +12 -12
  252. package/front_end/third_party/web-vitals/package/src/lib/getVisibilityWatcher.ts +57 -35
  253. package/front_end/third_party/web-vitals/package/src/lib/initMetric.ts +2 -2
  254. package/front_end/third_party/web-vitals/package/src/{deprecated.ts → lib/initUnique.ts} +14 -8
  255. package/front_end/third_party/web-vitals/package/src/lib/observe.ts +3 -11
  256. package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts +12 -6
  257. package/front_end/third_party/web-vitals/package/src/lib/{whenIdle.ts → whenIdleOrHidden.ts} +10 -8
  258. package/front_end/third_party/web-vitals/package/src/onCLS.ts +17 -38
  259. package/front_end/third_party/web-vitals/package/src/onFCP.ts +3 -6
  260. package/front_end/third_party/web-vitals/package/src/onINP.ts +33 -28
  261. package/front_end/third_party/web-vitals/package/src/onLCP.ts +36 -29
  262. package/front_end/third_party/web-vitals/package/src/onTTFB.ts +2 -5
  263. package/front_end/third_party/web-vitals/package/src/types/base.ts +5 -5
  264. package/front_end/third_party/web-vitals/package/src/types/cls.ts +5 -3
  265. package/front_end/third_party/web-vitals/package/src/types/inp.ts +88 -33
  266. package/front_end/third_party/web-vitals/package/src/types/lcp.ts +6 -2
  267. package/front_end/third_party/web-vitals/package/src/types.ts +47 -4
  268. package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +75 -0
  269. package/front_end/third_party/web-vitals/rebuild.sh +32 -18
  270. package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +5 -10
  271. package/front_end/third_party/web-vitals/web-vitals.ts +0 -2
  272. package/front_end/ui/components/buttons/Button.ts +1 -1
  273. package/front_end/ui/components/docs/console_insight/basic.ts +3 -2
  274. package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +2 -0
  275. package/front_end/ui/components/text_editor/TextEditor.ts +0 -2
  276. package/front_end/ui/legacy/EmptyWidget.ts +11 -1
  277. package/front_end/ui/legacy/InspectorView.ts +2 -0
  278. package/front_end/ui/legacy/SplitWidget.ts +2 -0
  279. package/front_end/ui/legacy/TabbedPane.ts +1 -0
  280. package/front_end/ui/legacy/TargetCrashedScreen.ts +1 -0
  281. package/front_end/ui/legacy/Toolbar.ts +25 -4
  282. package/front_end/ui/legacy/UIUtils.ts +28 -13
  283. package/front_end/ui/legacy/ViewManager.ts +1 -0
  284. package/front_end/ui/legacy/Widget.ts +5 -0
  285. package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +7 -20
  286. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +2 -0
  287. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -0
  288. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +1 -1
  289. package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -0
  290. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +1 -0
  291. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -0
  292. package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -0
  293. package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -0
  294. package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -0
  295. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +1 -0
  296. package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +9 -8
  297. package/front_end/ui/visual_logging/KnownContextValues.ts +17 -0
  298. package/mcp/README.md +7 -0
  299. package/mcp/mcp.ts +8 -0
  300. package/package.json +1 -1
  301. package/front_end/models/live-metrics/web-vitals-injected/OnEachInteraction.ts +0 -34
  302. package/front_end/third_party/web-vitals/package/attribution.d.ts +0 -16
  303. package/front_end/third_party/web-vitals/package/attribution.js +0 -18
  304. package/front_end/third_party/web-vitals/package/dist/modules/attribution/deprecated.d.ts +0 -7
  305. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFID.d.ts +0 -11
  306. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFID.js +0 -46
  307. package/front_end/third_party/web-vitals/package/dist/modules/deprecated.d.ts +0 -5
  308. package/front_end/third_party/web-vitals/package/dist/modules/lib/interactions.d.ts +0 -31
  309. package/front_end/third_party/web-vitals/package/dist/modules/lib/interactions.js +0 -107
  310. package/front_end/third_party/web-vitals/package/dist/modules/lib/onHidden.d.ts +0 -1
  311. package/front_end/third_party/web-vitals/package/dist/modules/lib/onHidden.js +0 -22
  312. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/firstInputPolyfill.d.ts +0 -7
  313. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/firstInputPolyfill.js +0 -147
  314. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/getFirstHiddenTimePolyfill.d.ts +0 -1
  315. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/getFirstHiddenTimePolyfill.js +0 -25
  316. package/front_end/third_party/web-vitals/package/dist/modules/onFID.d.ts +0 -13
  317. package/front_end/third_party/web-vitals/package/dist/modules/onFID.js +0 -70
  318. package/front_end/third_party/web-vitals/package/dist/modules/types/fid.d.ts +0 -46
  319. package/front_end/third_party/web-vitals/package/dist/modules/types/fid.js +0 -16
  320. package/front_end/third_party/web-vitals/package/src/attribution/onFID.ts +0 -62
  321. package/front_end/third_party/web-vitals/package/src/lib/interactions.ts +0 -139
  322. package/front_end/third_party/web-vitals/package/src/lib/onHidden.ts +0 -23
  323. package/front_end/third_party/web-vitals/package/src/lib/polyfills/firstInputPolyfill.ts +0 -174
  324. package/front_end/third_party/web-vitals/package/src/onFID.ts +0 -105
  325. package/front_end/third_party/web-vitals/package/src/types/fid.ts +0 -65
  326. package/front_end/ui/components/text_editor/textEditor.css +0 -18
  327. package/front_end/ui/legacy/inlineButton.css +0 -22
  328. /package/front_end/entrypoints/{rehydrated_devtools_app/rehydrated_devtools_app.ts → trace_app/trace_app.ts} +0 -0
@@ -14,7 +14,21 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import type {LoadState, Metric} from './base.js';
17
+ import type {
18
+ LoadState,
19
+ Metric,
20
+ ReportOpts,
21
+ AttributionReportOpts,
22
+ } from './base.js';
23
+
24
+ export interface INPReportOpts extends ReportOpts {
25
+ durationThreshold?: number;
26
+ }
27
+
28
+ export interface INPAttributionReportOpts extends AttributionReportOpts {
29
+ durationThreshold?: number;
30
+ onEachInteraction?: (interaction: INPMetricWithAttribution) => void;
31
+ }
18
32
 
19
33
  /**
20
34
  * An INP-specific version of the Metric object.
@@ -24,6 +38,22 @@ export interface INPMetric extends Metric {
24
38
  entries: PerformanceEventTiming[];
25
39
  }
26
40
 
41
+ export interface INPLongestScriptSummary {
42
+ /**
43
+ * The longest Long Animation Frame script entry that intersects the INP
44
+ * interaction.
45
+ */
46
+ entry: PerformanceScriptTiming;
47
+ /**
48
+ * The INP subpart where the longest script ran.
49
+ */
50
+ subpart: 'input-delay' | 'processing-duration' | 'presentation-delay';
51
+ /**
52
+ * The amount of time the longest script intersected the INP duration.
53
+ */
54
+ intersectingDuration: number;
55
+ }
56
+
27
57
  /**
28
58
  * An object containing potentially-helpful debugging information that
29
59
  * can be sent along with the INP value for the current page visit in order
@@ -31,37 +61,21 @@ export interface INPMetric extends Metric {
31
61
  */
32
62
  export interface INPAttribution {
33
63
  /**
34
- * A selector identifying the element that the user first interacted with
35
- * as part of the frame where the INP candidate interaction occurred.
36
- * If this value is an empty string, that generally means the element was
37
- * removed from the DOM after the interaction.
64
+ * By default, a selector identifying the element that the user first
65
+ * interacted with as part of the frame where the INP candidate interaction
66
+ * occurred. If this value is an empty string, that generally means the
67
+ * element was removed from the DOM after the interaction. If the
68
+ * `generateTarget` configuration option was passed, then this will instead
69
+ * be the return value of that function, falling back to the default if that
70
+ * returns null or undefined.
38
71
  */
39
72
  interactionTarget: string;
40
- /**
41
- * A reference to the HTML element identified by `interactionTargetSelector`.
42
- * NOTE: for attribution purpose, a selector identifying the element is
43
- * typically more useful than the element itself. However, the element is
44
- * also made available in case additional context is needed.
45
- */
46
- interactionTargetElement: Node | undefined;
47
73
  /**
48
74
  * The time when the user first interacted during the frame where the INP
49
75
  * candidate interaction occurred (if more than one interaction occurred
50
76
  * within the frame, only the first time is reported).
51
77
  */
52
78
  interactionTime: DOMHighResTimeStamp;
53
- /**
54
- * The best-guess timestamp of the next paint after the interaction.
55
- * In general, this timestamp is the same as the `startTime + duration` of
56
- * the event timing entry. However, since `duration` values are rounded to
57
- * the nearest 8ms, it can sometimes appear that the paint occurred before
58
- * processing ended (which cannot happen). This value clamps the paint time
59
- * so it's always after `processingEnd` from the Event Timing API and
60
- * `renderStart` from the Long Animation Frame API (where available).
61
- * It also averages the duration values for all entries in the same
62
- * animation frame, which should be closer to the "real" value.
63
- */
64
- nextPaintTime: DOMHighResTimeStamp;
65
79
  /**
66
80
  * The type of interaction, based on the event type of the `event` entry
67
81
  * that corresponds to the interaction (i.e. the first `event` entry
@@ -70,20 +84,19 @@ export interface INPAttribution {
70
84
  * and for "keydown" or "keyup" events this will be "keyboard".
71
85
  */
72
86
  interactionType: 'pointer' | 'keyboard';
87
+ /**
88
+ * The best-guess timestamp of the next paint after the interaction.
89
+ * In general, this timestamp is the same as the `startTime + duration` of
90
+ * the event timing entry. However, since duration values are rounded to the
91
+ * nearest 8ms (and can be rounded down), this value is clamped to always be
92
+ * reported after the processing times.
93
+ */
94
+ nextPaintTime: DOMHighResTimeStamp;
73
95
  /**
74
96
  * An array of Event Timing entries that were processed within the same
75
97
  * animation frame as the INP candidate interaction.
76
98
  */
77
99
  processedEventEntries: PerformanceEventTiming[];
78
- /**
79
- * If the browser supports the Long Animation Frame API, this array will
80
- * include any `long-animation-frame` entries that intersect with the INP
81
- * candidate interaction's `startTime` and the `processingEnd` time of the
82
- * last event processed within that animation frame. If the browser does not
83
- * support the Long Animation Frame API or no `long-animation-frame` entries
84
- * are detect, this array will be empty.
85
- */
86
- longAnimationFrameEntries: PerformanceLongAnimationFrameTiming[];
87
100
  /**
88
101
  * The time from when the user interacted with the page until when the
89
102
  * browser was first able to start processing event listeners for that
@@ -112,6 +125,48 @@ export interface INPAttribution {
112
125
  * (e.g. usually in the `dom-interactive` phase) it can result in long delays.
113
126
  */
114
127
  loadState: LoadState;
128
+ /**
129
+ * If the browser supports the Long Animation Frame API, this array will
130
+ * include any `long-animation-frame` entries that intersect with the INP
131
+ * candidate interaction's `startTime` and the `processingEnd` time of the
132
+ * last event processed within that animation frame. If the browser does not
133
+ * support the Long Animation Frame API or no `long-animation-frame` entries
134
+ * are detected, this array will be empty.
135
+ */
136
+ longAnimationFrameEntries: PerformanceLongAnimationFrameTiming[];
137
+ /**
138
+ * Summary information about the longest script entry intersecting the INP
139
+ * duration. Note, only script entries above 5 milliseconds are reported by
140
+ * the Long Animation Frame API.
141
+ */
142
+ longestScript?: INPLongestScriptSummary;
143
+ /**
144
+ * The total duration of Long Animation Frame scripts that intersect the INP
145
+ * duration excluding any forced style and layout (that is included in
146
+ * totalStyleAndLayout). Note, this is limited to scripts > 5 milliseconds.
147
+ */
148
+ totalScriptDuration?: number;
149
+ /**
150
+ * The total style and layout duration from any Long Animation Frames
151
+ * intersecting the INP interaction. This includes any end-of-frame style and
152
+ * layout duration + any forced style and layout duration.
153
+ */
154
+ totalStyleAndLayoutDuration?: number;
155
+ /**
156
+ * The off main-thread presentation delay from the end of the last Long
157
+ * Animation Frame (where available) until the INP end point.
158
+ */
159
+ totalPaintDuration?: number;
160
+ /**
161
+ * The total unattributed time not included in any of the previous totals.
162
+ * This includes scripts < 5 milliseconds and other timings not attributed
163
+ * by Long Animation Frame (including when a frame is < 50ms and so has no
164
+ * Long Animation Frame).
165
+ * When no Long Animation Frames are present this will be undefined, rather
166
+ * than everything being unattributed to make it clearer when it's expected
167
+ * to be small.
168
+ */
169
+ totalUnattributedDuration?: number;
115
170
  }
116
171
 
117
172
  /**
@@ -31,9 +31,13 @@ export interface LCPMetric extends Metric {
31
31
  */
32
32
  export interface LCPAttribution {
33
33
  /**
34
- * The element corresponding to the largest contentful paint for the page.
34
+ * By default, a selector identifying the element corresponding to the
35
+ * largest contentful paint for the page. If the `generateTarget`
36
+ * configuration option was passed, then this will instead be the return
37
+ * value of that function, falling back to the default if that returns null
38
+ * or undefined.
35
39
  */
36
- element?: string;
40
+ target?: string;
37
41
  /**
38
42
  * The URL (if applicable) of the LCP image resource. If the LCP element
39
43
  * is a text node, this value will not be set.
@@ -19,7 +19,6 @@ export * from './types/polyfills.js';
19
19
 
20
20
  export * from './types/cls.js';
21
21
  export * from './types/fcp.js';
22
- export * from './types/fid.js';
23
22
  export * from './types/inp.js';
24
23
  export * from './types/lcp.js';
25
24
  export * from './types/ttfb.js';
@@ -67,7 +66,7 @@ declare global {
67
66
 
68
67
  // https://wicg.github.io/layout-instability/#sec-layout-shift-attribution
69
68
  interface LayoutShiftAttribution {
70
- node?: Node;
69
+ node: Node | null;
71
70
  previousRect: DOMRectReadOnly;
72
71
  currentRect: DOMRectReadOnly;
73
72
  }
@@ -89,9 +88,53 @@ declare global {
89
88
  readonly element: Element | null;
90
89
  }
91
90
 
91
+ // https://w3c.github.io/long-animation-frame/#sec-PerformanceLongAnimationFrameTiming
92
+ export type ScriptInvokerType =
93
+ | 'classic-script'
94
+ | 'module-script'
95
+ | 'event-listener'
96
+ | 'user-callback'
97
+ | 'resolve-promise'
98
+ | 'reject-promise';
99
+
100
+ // https://w3c.github.io/long-animation-frame/#sec-PerformanceLongAnimationFrameTiming
101
+ export type ScriptWindowAttribution =
102
+ | 'self'
103
+ | 'descendant'
104
+ | 'ancestor'
105
+ | 'same-page'
106
+ | 'other';
107
+
108
+ // https://w3c.github.io/long-animation-frame/#sec-PerformanceLongAnimationFrameTiming
109
+ interface PerformanceScriptTiming extends PerformanceEntry {
110
+ /* Overloading PerformanceEntry */
111
+ readonly startTime: DOMHighResTimeStamp;
112
+ readonly duration: DOMHighResTimeStamp;
113
+ readonly name: string;
114
+ readonly entryType: string;
115
+
116
+ readonly invokerType: ScriptInvokerType;
117
+ readonly invoker: string;
118
+ readonly executionStart: DOMHighResTimeStamp;
119
+ readonly sourceURL: string;
120
+ readonly sourceFunctionName: string;
121
+ readonly sourceCharPosition: number;
122
+ readonly pauseDuration: DOMHighResTimeStamp;
123
+ readonly forcedStyleAndLayoutDuration: DOMHighResTimeStamp;
124
+ readonly window?: Window;
125
+ readonly windowAttribution: ScriptWindowAttribution;
126
+ }
127
+
92
128
  // https://w3c.github.io/long-animation-frame/#sec-PerformanceLongAnimationFrameTiming
93
129
  interface PerformanceLongAnimationFrameTiming extends PerformanceEntry {
94
- renderStart: DOMHighResTimeStamp;
95
- duration: DOMHighResTimeStamp;
130
+ readonly startTime: DOMHighResTimeStamp;
131
+ readonly duration: DOMHighResTimeStamp;
132
+ readonly name: string;
133
+ readonly entryType: string;
134
+ readonly renderStart: DOMHighResTimeStamp;
135
+ readonly styleAndLayoutStart: DOMHighResTimeStamp;
136
+ readonly blockingDuration: DOMHighResTimeStamp;
137
+ readonly firstUIEventTimestamp: DOMHighResTimeStamp;
138
+ readonly scripts: PerformanceScriptTiming[];
96
139
  }
97
140
  }
@@ -0,0 +1,75 @@
1
+ From 491debaabfe255b3c046c79db34defee146e5eec Mon Sep 17 00:00:00 2001
2
+ From: Connor Clark <cjamcl@gmail.com>
3
+ Date: Fri, 10 Oct 2025 09:46:44 -0700
4
+ Subject: [PATCH] Add onEachInteraction to onINP options
5
+
6
+ This adds an "onEachInteraction" option to onINP, which exposes to us
7
+ each interaction. It also calls attributeINP on each value given to the
8
+ callback.
9
+
10
+ ---
11
+ src/attribution/onINP.ts | 35 ++++++++++++++++++++++++++++++++++-
12
+ src/types/inp.ts | 1 +
13
+ 2 files changed, 35 insertions(+), 1 deletion(-)
14
+
15
+ diff --git a/src/attribution/onINP.ts b/src/attribution/onINP.ts
16
+ index 479a00f..d295263 100644
17
+ --- a/src/attribution/onINP.ts
18
+ +++ b/src/attribution/onINP.ts
19
+ @@ -240,7 +240,40 @@ export const onINP = (
20
+ cleanupPending = false;
21
+ };
22
+
23
+ - interactionManager._onBeforeProcessingEntry = groupEntriesByRenderTime;
24
+ + async function handleOnEachInteractionCallback(
25
+ + entry: PerformanceEventTiming,
26
+ + ) {
27
+ + if (!opts.onEachInteraction) {
28
+ + return;
29
+ + }
30
+ +
31
+ + // Wait a microtask so this "pre" processing callback actually
32
+ + // becomes a "post" processing callback.
33
+ + void (await Promise.resolve());
34
+ + if (!entry.interactionId) {
35
+ + return;
36
+ + }
37
+ +
38
+ + const interaction = attributeINP({
39
+ + entries: [entry],
40
+ + // The only value we really need for `attributeINP` is `entries`
41
+ + // Everything else is included to fill out the type.
42
+ + name: 'INP',
43
+ + rating: 'good',
44
+ + value: entry.duration,
45
+ + delta: entry.duration,
46
+ + navigationType: 'navigate',
47
+ + id: 'N/A',
48
+ + });
49
+ + opts.onEachInteraction(interaction);
50
+ + }
51
+ +
52
+ + interactionManager._onBeforeProcessingEntry = (
53
+ + entry: PerformanceEventTiming,
54
+ + ) => {
55
+ + void handleOnEachInteractionCallback(entry);
56
+ + groupEntriesByRenderTime(entry);
57
+ + };
58
+ interactionManager._onAfterProcessingINPCandidate = saveInteractionTarget;
59
+
60
+ const getIntersectingLoAFs = (
61
+ diff --git a/src/types/inp.ts b/src/types/inp.ts
62
+ index 7dfa9bb..f87a2c5 100644
63
+ --- a/src/types/inp.ts
64
+ +++ b/src/types/inp.ts
65
+ @@ -27,6 +27,7 @@ export interface INPReportOpts extends ReportOpts {
66
+
67
+ export interface INPAttributionReportOpts extends AttributionReportOpts {
68
+ durationThreshold?: number;
69
+ + onEachInteraction?: (interaction: INPMetricWithAttribution) => void;
70
+ }
71
+
72
+ /**
73
+ --
74
+ 2.51.0.760.g7b8bcc2412-goog
75
+
@@ -4,21 +4,35 @@ set -euo pipefail
4
4
 
5
5
  SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
6
6
 
7
- # Roll the latest version of the package from NPM
8
- vpython3 scripts/deps/roll_front_end_third_party.py web-vitals web-vitals dist
9
-
10
- # We need this one helper function to be exported, so modify the source .ts and then rebuild
11
- sed -i -e 's/^const attributeINP/export const attributeINP/g' $SCRIPT_DIR/package/src/attribution/onINP.ts
12
-
13
- # See other edits mentioned in README.chromium
14
-
15
- # Delete package bundles as devtools doesn't consume them
16
- rm -f "$SCRIPT_DIR"/package/dist/*.*js
17
-
18
- # Instead devtools compiles the JS from this tsc compile.
19
- # rough tsc version of https://github.com/GoogleChrome/web-vitals/blob/main/tsconfig.json
20
- # Minor variations in the *.d.ts files are fine, but make sure the only change to onINP.js is the
21
- # `export` added above.
22
- node_modules/.bin/tsc -d -t esnext -m nodenext --moduleResolution nodenext --lib es2017,DOM --strict --outDir $SCRIPT_DIR/package/dist/modules/ $SCRIPT_DIR/package/src/**/*.ts
23
-
24
- echo "Rebuild complete. Ensure any manual edits are handled appropriately."
7
+ VERSION=5.1.0
8
+ GIT_SHA=1b872cf5f2159e8ace0e98d55d8eb54fb09adfbe # web-vitals does not tag releases.
9
+
10
+ # Note: this is just to handle updating README.chromium.
11
+ # For the actual sources, below we checkout the repo, apply local patches, then build with tsc.
12
+ vpython3 scripts/deps/roll_front_end_third_party.py web-vitals web-vitals dist $VERSION
13
+
14
+ cd "$SCRIPT_DIR"
15
+
16
+ # As per above comment, we don't need this from npm.
17
+ rm -rf package/src package/dist
18
+
19
+ if [ ! -d tmp-repo ]; then
20
+ git clone http://github.com/GoogleChrome/web-vitals tmp-repo
21
+ fi
22
+
23
+ cd tmp-repo
24
+ rm -fr .git/rebase-apply
25
+ git checkout main
26
+ git reset --hard $GIT_SHA
27
+ git am ../patches/*.patch
28
+ # Note: to modify the local patches applied, exit the script at this point:
29
+ # exit 1
30
+ # then cd into tmp-repo, make whatever modifications you need, then write the patches back:
31
+ # git format-patch -o ../patches origin/main
32
+ cd -
33
+
34
+ # Copy the source files to our repo, and build it.
35
+ cp -r tmp-repo/src package/src
36
+ ../../../node_modules/.bin/tsc -d -t esnext -m esnext --moduleResolution node --strict --outDir package/dist/modules/ package/src/**/*.ts package/src/index.ts
37
+
38
+ echo "Rebuild complete."
@@ -3,16 +3,16 @@
3
3
  "composite": true
4
4
  },
5
5
  "files": [
6
- "package/dist/modules/attribution/deprecated.js",
7
6
  "package/dist/modules/attribution/index.js",
8
7
  "package/dist/modules/attribution/onCLS.js",
9
8
  "package/dist/modules/attribution/onFCP.js",
10
- "package/dist/modules/attribution/onFID.js",
11
9
  "package/dist/modules/attribution/onINP.js",
12
10
  "package/dist/modules/attribution/onLCP.js",
13
11
  "package/dist/modules/attribution/onTTFB.js",
14
- "package/dist/modules/deprecated.js",
15
12
  "package/dist/modules/index.js",
13
+ "package/dist/modules/lib/InteractionManager.js",
14
+ "package/dist/modules/lib/LCPEntryManager.js",
15
+ "package/dist/modules/lib/LayoutShiftManager.js",
16
16
  "package/dist/modules/lib/bfcache.js",
17
17
  "package/dist/modules/lib/bindReporter.js",
18
18
  "package/dist/modules/lib/doubleRAF.js",
@@ -23,18 +23,14 @@
23
23
  "package/dist/modules/lib/getSelector.js",
24
24
  "package/dist/modules/lib/getVisibilityWatcher.js",
25
25
  "package/dist/modules/lib/initMetric.js",
26
- "package/dist/modules/lib/interactions.js",
26
+ "package/dist/modules/lib/initUnique.js",
27
27
  "package/dist/modules/lib/observe.js",
28
- "package/dist/modules/lib/onHidden.js",
29
- "package/dist/modules/lib/polyfills/firstInputPolyfill.js",
30
- "package/dist/modules/lib/polyfills/getFirstHiddenTimePolyfill.js",
31
28
  "package/dist/modules/lib/polyfills/interactionCountPolyfill.js",
32
29
  "package/dist/modules/lib/runOnce.js",
33
30
  "package/dist/modules/lib/whenActivated.js",
34
- "package/dist/modules/lib/whenIdle.js",
31
+ "package/dist/modules/lib/whenIdleOrHidden.js",
35
32
  "package/dist/modules/onCLS.js",
36
33
  "package/dist/modules/onFCP.js",
37
- "package/dist/modules/onFID.js",
38
34
  "package/dist/modules/onINP.js",
39
35
  "package/dist/modules/onLCP.js",
40
36
  "package/dist/modules/onTTFB.js",
@@ -42,7 +38,6 @@
42
38
  "package/dist/modules/types/base.js",
43
39
  "package/dist/modules/types/cls.js",
44
40
  "package/dist/modules/types/fcp.js",
45
- "package/dist/modules/types/fid.js",
46
41
  "package/dist/modules/types/inp.js",
47
42
  "package/dist/modules/types/lcp.js",
48
43
  "package/dist/modules/types/polyfills.js",
@@ -1,5 +1,3 @@
1
1
  export * from './package/dist/modules/index.js';
2
2
  export * as Attribution from './package/dist/modules/attribution/index.js';
3
3
  export {onBFCacheRestore} from './package/dist/modules/lib/bfcache.js';
4
- export {attributeINP} from './package/dist/modules/attribution/onINP.js';
5
- export {entryPreProcessingCallbacks} from './package/dist/modules/lib/interactions.js';
@@ -370,7 +370,7 @@ export class Button extends HTMLElement {
370
370
  html`
371
371
  <style>${buttonStyles}</style>
372
372
  <button title=${ifDefined(this.#props.title)}
373
- .disabled=${this.#props.disabled}
373
+ ?disabled=${this.#props.disabled}
374
374
  class=${classMap(classes)}
375
375
  aria-pressed=${ifDefined(this.#props.toggled)}
376
376
  aria-label=${ifDefined(this.#props.accessibleLabel)}
@@ -3,6 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Host from '../../../../core/host/host.js';
6
+ import * as Console from '../../../../panels/console/console.js';
6
7
  import * as Explain from '../../../../panels/explain/explain.js';
7
8
  import * as FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
8
9
  import * as ComponentHelpers from '../../helpers/helpers.js';
@@ -23,11 +24,11 @@ const component = new ConsoleInsight(
23
24
  isPageReloadRecommended: false,
24
25
  sources: [
25
26
  {
26
- type: Explain.SourceType.MESSAGE,
27
+ type: Console.PromptBuilder.SourceType.MESSAGE,
27
28
  value: 'Something went wrong\n\nSomething went wrong',
28
29
  },
29
30
  {
30
- type: Explain.SourceType.NETWORK_REQUEST,
31
+ type: Console.PromptBuilder.SourceType.NETWORK_REQUEST,
31
32
  value: `Request: https://example.com/data.html
32
33
 
33
34
  Request headers:
@@ -39,11 +39,13 @@ export function legacyWrapper<T extends Platform.Constructor.Constructor<UI.Widg
39
39
  }
40
40
 
41
41
  override wasShown(): void {
42
+ super.wasShown();
42
43
  this.#component.wasShown();
43
44
  void this.#component.render();
44
45
  }
45
46
 
46
47
  override willHide(): void {
48
+ super.willHide();
47
49
  this.#component.willHide();
48
50
  }
49
51
 
@@ -10,7 +10,6 @@ import * as CodeHighlighter from '../code_highlighter/code_highlighter.js';
10
10
 
11
11
  import {baseConfiguration, dummyDarkTheme, dynamicSetting, DynamicSetting, themeSelection} from './config.js';
12
12
  import {toLineColumn, toOffset} from './position.js';
13
- import textEditorStyles from './textEditor.css.js';
14
13
 
15
14
  declare global {
16
15
  interface HTMLElementTagNameMap {
@@ -42,7 +41,6 @@ export class TextEditor extends HTMLElement {
42
41
  super();
43
42
  this.#pendingState = pendingState;
44
43
  this.#shadow.createChild('style').textContent = CodeHighlighter.codeHighlighterStyles;
45
- this.#shadow.createChild('style').textContent = textEditorStyles;
46
44
  }
47
45
 
48
46
  #createEditor(): CodeMirror.EditorView {
@@ -26,6 +26,7 @@ interface EmptyWidgetInput {
26
26
  header: string;
27
27
  text: string;
28
28
  link?: Platform.DevToolsPath.UrlString|undefined|null;
29
+ extraElements?: Element[];
29
30
  }
30
31
 
31
32
  interface EmptyWidgetOutput {
@@ -47,6 +48,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
47
48
  ${input.link ? XLink.create(
48
49
  input.link, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more') : ''}
49
50
  </div>
51
+ ${input.extraElements}
50
52
  </div>`, target);
51
53
  // clang-format on
52
54
  };
@@ -56,6 +58,8 @@ export class EmptyWidget extends VBox {
56
58
  #text: string;
57
59
  #link: Platform.DevToolsPath.UrlString|undefined|null;
58
60
  #view: View;
61
+ #firstUpdate = true;
62
+ #extraElements: Element[] = [];
59
63
 
60
64
  constructor(headerOrElement: string|HTMLElement, text = '', element?: HTMLElement, view = DEFAULT_VIEW) {
61
65
  const header = typeof headerOrElement === 'string' ? headerOrElement : '';
@@ -86,8 +90,14 @@ export class EmptyWidget extends VBox {
86
90
  }
87
91
 
88
92
  override performUpdate(): void {
93
+ if (this.#firstUpdate) {
94
+ this.#extraElements = [...this.element.children];
95
+ this.#firstUpdate = false;
96
+ }
89
97
  const output = {contentElement: undefined};
90
- this.#view({header: this.#header, text: this.#text, link: this.#link}, output, this.element);
98
+ this.#view(
99
+ {header: this.#header, text: this.#text, link: this.#link, extraElements: this.#extraElements}, output,
100
+ this.element);
91
101
  if (output.contentElement) {
92
102
  this.contentElement = output.contentElement;
93
103
  }
@@ -362,6 +362,7 @@ export class InspectorView extends VBox implements ViewLocationResolver {
362
362
  }
363
363
 
364
364
  override wasShown(): void {
365
+ super.wasShown();
365
366
  this.#resizeObserver.observe(this.element);
366
367
  this.#observedResize();
367
368
  this.element.ownerDocument.addEventListener('keydown', this.keyDownBound, false);
@@ -371,6 +372,7 @@ export class InspectorView extends VBox implements ViewLocationResolver {
371
372
  }
372
373
 
373
374
  override willHide(): void {
375
+ super.willHide();
374
376
  this.#resizeObserver.unobserve(this.element);
375
377
  this.element.ownerDocument.removeEventListener('keydown', this.keyDownBound, false);
376
378
  DockController.instance().removeEventListener(
@@ -648,11 +648,13 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
648
648
  }
649
649
 
650
650
  override wasShown(): void {
651
+ super.wasShown();
651
652
  this.#forceUpdateLayout();
652
653
  ZoomManager.instance().addEventListener(ZoomManagerEvents.ZOOM_CHANGED, this.onZoomChanged, this);
653
654
  }
654
655
 
655
656
  override willHide(): void {
657
+ super.willHide();
656
658
  ZoomManager.instance().removeEventListener(ZoomManagerEvents.ZOOM_CHANGED, this.onZoomChanged, this);
657
659
  }
658
660
 
@@ -503,6 +503,7 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
503
503
  }
504
504
 
505
505
  override wasShown(): void {
506
+ super.wasShown();
506
507
  const effectiveTab = this.currentTab || this.tabsHistory[0];
507
508
  if (effectiveTab && this.autoSelectFirstItemOnShow) {
508
509
  this.selectTab(effectiveTab.id);
@@ -42,6 +42,7 @@ export class TargetCrashedScreen extends VBox {
42
42
  }
43
43
 
44
44
  override willHide(): void {
45
+ super.willHide();
45
46
  this.hideCallback.call(null);
46
47
  }
47
48
  }
@@ -94,7 +94,7 @@ export class Toolbar extends HTMLElement {
94
94
  if (element instanceof Buttons.Button.Button) {
95
95
  item = new ToolbarButton('', undefined, undefined, undefined, element);
96
96
  } else if (element instanceof ToolbarInputElement) {
97
- item = element.item;
97
+ item = element.item as ToolbarItem;
98
98
  } else if (element instanceof HTMLSelectElement) {
99
99
  item = new ToolbarComboBox(null, element.title, undefined, undefined, element);
100
100
  } else {
@@ -833,11 +833,12 @@ export class ToolbarFilter extends ToolbarInput {
833
833
  }
834
834
 
835
835
  export class ToolbarInputElement extends HTMLElement {
836
- static observedAttributes = ['value'];
836
+ static observedAttributes = ['value', 'disabled'];
837
837
 
838
- item!: ToolbarInput;
838
+ item?: ToolbarInput;
839
839
  datalist: HTMLDataListElement|null = null;
840
840
  value: string|undefined = undefined;
841
+ #disabled = false;
841
842
 
842
843
  connectedCallback(): void {
843
844
  if (this.item) {
@@ -866,6 +867,9 @@ export class ToolbarInputElement extends HTMLElement {
866
867
  if (this.value) {
867
868
  this.item.setValue(this.value);
868
869
  }
870
+ if (this.#disabled) {
871
+ this.item.setEnabled(false);
872
+ }
869
873
  this.item.addEventListener(ToolbarInput.Event.TEXT_CHANGED, event => {
870
874
  this.dispatchEvent(new CustomEvent('change', {detail: event.data}));
871
875
  });
@@ -875,7 +879,7 @@ export class ToolbarInputElement extends HTMLElement {
875
879
  }
876
880
 
877
881
  override focus(): void {
878
- this.item.focus();
882
+ this.item?.focus();
879
883
  }
880
884
 
881
885
  async #onAutocomplete(expression: string, prefix: string, force?: boolean): Promise<Suggestion[]> {
@@ -894,8 +898,25 @@ export class ToolbarInputElement extends HTMLElement {
894
898
  } else {
895
899
  this.value = newValue;
896
900
  }
901
+ } else if (name === 'disabled') {
902
+ this.#disabled = typeof newValue === 'string';
903
+ if (this.item) {
904
+ this.item.setEnabled(!this.#disabled);
905
+ }
906
+ }
907
+ }
908
+
909
+ set disabled(disabled: boolean) {
910
+ if (disabled) {
911
+ this.setAttribute('disabled', '');
912
+ } else {
913
+ this.removeAttribute('disabled');
897
914
  }
898
915
  }
916
+
917
+ get disabled(): boolean {
918
+ return this.hasAttribute('disabled');
919
+ }
899
920
  }
900
921
  customElements.define('devtools-toolbar-input', ToolbarInputElement);
901
922