chrome-devtools-frontend 1.0.1538523 → 1.0.1539728

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 (245) hide show
  1. package/eslint.config.mjs +1 -1
  2. package/front_end/core/protocol_client/CDPConnection.ts +12 -10
  3. package/front_end/core/protocol_client/InspectorBackend.ts +74 -101
  4. package/front_end/core/protocol_client/NodeURL.ts +1 -3
  5. package/front_end/core/sdk/ChildTargetManager.ts +5 -41
  6. package/front_end/core/sdk/Connections.ts +9 -58
  7. package/front_end/core/sdk/DOMModel.ts +1 -0
  8. package/front_end/core/sdk/RehydratingConnection.ts +1 -1
  9. package/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts +15 -26
  10. package/front_end/entrypoints/node_app/{NodeConnectionsPanel.ts → app/NodeConnectionsPanel.ts} +8 -8
  11. package/front_end/entrypoints/node_app/{NodeMain.ts → app/NodeMain.ts} +11 -11
  12. package/front_end/entrypoints/node_app/app/app.ts +6 -0
  13. package/front_end/entrypoints/node_app/node_app.ts +4 -2
  14. package/front_end/generated/{InspectorBackendCommands.js → InspectorBackendCommands.ts} +16 -34
  15. package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +18 -3
  16. package/front_end/models/trace/types/TraceEvents.ts +19 -0
  17. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +49 -26
  18. package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -1
  19. package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
  20. package/front_end/panels/ai_assistance/components/ChatView.ts +1 -134
  21. package/front_end/panels/ai_assistance/components/DisabledWidget.ts +170 -0
  22. package/front_end/panels/ai_assistance/components/ExploreWidget.ts +4 -4
  23. package/front_end/panels/ai_assistance/components/chatView.css +0 -31
  24. package/front_end/panels/ai_assistance/components/disabledWidget.css +45 -0
  25. package/front_end/panels/animation/AnimationTimeline.ts +1 -1
  26. package/front_end/panels/application/components/FrameDetailsView.ts +1 -1
  27. package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
  28. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -3
  29. package/front_end/panels/elements/ElementsTreeElement.ts +123 -95
  30. package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
  31. package/front_end/panels/elements/NodeStackTraceWidget.ts +8 -2
  32. package/front_end/panels/explain/components/ConsoleInsight.ts +0 -1
  33. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +57 -33
  34. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +1 -1
  35. package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +12 -5
  36. package/front_end/panels/network/RequestInitiatorView.ts +1 -1
  37. package/front_end/panels/network/components/EditableSpan.ts +1 -1
  38. package/front_end/panels/recorder/components/StepView.ts +1 -1
  39. package/front_end/panels/recorder/models/RecordingPlayer.ts +8 -7
  40. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +4 -4
  41. package/front_end/panels/timeline/TimelineFlameChartView.ts +10 -10
  42. package/front_end/panels/timeline/TimelinePanel.ts +3 -3
  43. package/front_end/panels/timeline/TimelineUIUtils.ts +21 -24
  44. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +3 -2
  45. package/front_end/panels/utils/utils.ts +4 -2
  46. package/front_end/services/puppeteer/PuppeteerConnection.ts +56 -53
  47. package/front_end/third_party/puppeteer/README.chromium +2 -2
  48. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +3 -1
  49. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
  50. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js +4 -2
  51. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
  52. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts +3 -1
  53. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
  54. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
  55. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
  56. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.js +1 -1
  57. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.js.map +1 -1
  58. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
  59. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.js +4 -3
  60. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.js.map +1 -1
  61. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +1 -1
  62. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  63. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +1 -1
  64. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
  65. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.d.ts +2 -1
  66. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.d.ts.map +1 -1
  67. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.js +3 -2
  68. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.js.map +1 -1
  69. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  70. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +26 -9
  71. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  72. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
  73. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +11 -0
  75. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  76. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +9 -2
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js +4 -2
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +2 -2
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.d.ts.map +1 -1
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.js +2 -1
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.js.map +1 -1
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.d.ts +6 -1
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.d.ts.map +1 -1
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.js +11 -2
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.js.map +1 -1
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts +2 -0
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js +4 -3
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js.map +1 -1
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +7 -0
  98. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  99. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  100. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts +4 -0
  101. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  102. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +10 -4
  103. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
  104. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  105. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  106. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  107. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +9 -3
  108. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +37 -18
  109. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +3 -1
  110. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
  111. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js +4 -2
  112. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
  113. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts +3 -1
  114. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
  115. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
  116. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.js +1 -1
  118. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.js.map +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.js +4 -3
  121. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.js.map +1 -1
  122. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  124. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
  126. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.d.ts +2 -1
  127. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.d.ts.map +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.js +3 -2
  129. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.js.map +1 -1
  130. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  131. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +26 -9
  132. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  133. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
  134. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  135. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +11 -0
  136. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  137. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  138. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +9 -2
  139. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
  140. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
  141. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js +4 -2
  142. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -1
  143. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts +1 -1
  144. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +2 -2
  146. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
  147. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.d.ts.map +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.js +2 -1
  149. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.js.map +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.d.ts +6 -1
  151. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.d.ts.map +1 -1
  152. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.js +11 -2
  153. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.js.map +1 -1
  154. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts +2 -0
  155. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
  156. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js +4 -3
  157. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js.map +1 -1
  158. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +7 -0
  159. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +4 -0
  161. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  162. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +10 -4
  163. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  165. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  166. package/front_end/third_party/puppeteer/package/lib/types.d.ts +9 -3
  167. package/front_end/third_party/puppeteer/package/package.json +3 -3
  168. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +4 -2
  169. package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +3 -1
  170. package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +1 -0
  171. package/front_end/third_party/puppeteer/package/src/bidi/BrowserConnector.ts +8 -1
  172. package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +1 -1
  173. package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +4 -1
  174. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +34 -10
  175. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +13 -0
  176. package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +8 -2
  177. package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +4 -0
  178. package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +2 -2
  179. package/front_end/third_party/puppeteer/package/src/cdp/CdpSession.ts +2 -1
  180. package/front_end/third_party/puppeteer/package/src/cdp/Connection.ts +15 -1
  181. package/front_end/third_party/puppeteer/package/src/common/CallbackRegistry.ts +7 -5
  182. package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +8 -0
  183. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +22 -1
  184. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  185. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
  186. package/front_end/ui/components/switch/Switch.docs.ts +38 -0
  187. package/front_end/ui/components/tooltips/Tooltip.ts +69 -45
  188. package/front_end/ui/legacy/Slider.docs.ts +49 -0
  189. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +77 -5
  190. package/front_end/ui/legacy/components/utils/Linkifier.ts +62 -3
  191. package/front_end/ui/visual_logging/KnownContextValues.ts +8 -0
  192. package/package.json +1 -1
  193. package/front_end/third_party/puppeteer/package/src/templates/version.ts.tmpl +0 -4
  194. package/front_end/ui/components/docs/color_swatch/basic.html +0 -32
  195. package/front_end/ui/components/docs/color_swatch/basic.ts +0 -38
  196. package/front_end/ui/components/docs/color_swatch/change-color.html +0 -24
  197. package/front_end/ui/components/docs/color_swatch/change-color.ts +0 -28
  198. package/front_end/ui/components/docs/computed_style_property/basic.html +0 -25
  199. package/front_end/ui/components/docs/computed_style_property/basic.ts +0 -19
  200. package/front_end/ui/components/docs/computed_style_property/traceable.html +0 -25
  201. package/front_end/ui/components/docs/computed_style_property/traceable.ts +0 -16
  202. package/front_end/ui/components/docs/computed_style_trace/basic.html +0 -25
  203. package/front_end/ui/components/docs/computed_style_trace/basic.ts +0 -24
  204. package/front_end/ui/components/docs/console_insight/basic.html +0 -28
  205. package/front_end/ui/components/docs/console_insight/basic.ts +0 -103
  206. package/front_end/ui/components/docs/console_insight/error.html +0 -28
  207. package/front_end/ui/components/docs/console_insight/error.ts +0 -33
  208. package/front_end/ui/components/docs/console_insight/loading.html +0 -28
  209. package/front_end/ui/components/docs/console_insight/loading.ts +0 -47
  210. package/front_end/ui/components/docs/elements_breadcrumbs/basic.html +0 -43
  211. package/front_end/ui/components/docs/elements_breadcrumbs/basic.ts +0 -54
  212. package/front_end/ui/components/docs/elements_breadcrumbs/helpers.ts +0 -29
  213. package/front_end/ui/components/docs/elements_breadcrumbs/scroll-to-active-element.html +0 -38
  214. package/front_end/ui/components/docs/elements_breadcrumbs/scroll-to-active-element.ts +0 -90
  215. package/front_end/ui/components/docs/elements_breadcrumbs/scroll.html +0 -29
  216. package/front_end/ui/components/docs/elements_breadcrumbs/scroll.ts +0 -62
  217. package/front_end/ui/components/docs/icon_button/basic.html +0 -34
  218. package/front_end/ui/components/docs/icon_button/basic.ts +0 -67
  219. package/front_end/ui/components/docs/issue_counter/basic.html +0 -35
  220. package/front_end/ui/components/docs/issue_counter/basic.ts +0 -34
  221. package/front_end/ui/components/docs/issue_link_icon/basic.html +0 -31
  222. package/front_end/ui/components/docs/issue_link_icon/basic.ts +0 -26
  223. package/front_end/ui/components/docs/linear_memory_inspector/basic.html +0 -26
  224. package/front_end/ui/components/docs/linear_memory_inspector/basic.ts +0 -44
  225. package/front_end/ui/components/docs/menu/basic.html +0 -28
  226. package/front_end/ui/components/docs/menu/basic.ts +0 -66
  227. package/front_end/ui/components/docs/recorder_control_button/basic.html +0 -20
  228. package/front_end/ui/components/docs/recorder_control_button/basic.ts +0 -15
  229. package/front_end/ui/components/docs/recorder_recording_list_view/basic.html +0 -20
  230. package/front_end/ui/components/docs/recorder_recording_list_view/basic.ts +0 -26
  231. package/front_end/ui/components/docs/recorder_select_button/basic.html +0 -20
  232. package/front_end/ui/components/docs/recorder_select_button/basic.ts +0 -81
  233. package/front_end/ui/components/docs/recorder_split_view/basic.html +0 -17
  234. package/front_end/ui/components/docs/recorder_split_view/basic.ts +0 -22
  235. package/front_end/ui/components/docs/request_link_icon/basic.html +0 -31
  236. package/front_end/ui/components/docs/request_link_icon/basic.ts +0 -21
  237. package/front_end/ui/components/docs/slider/basic.ts +0 -62
  238. package/front_end/ui/components/docs/style_property_editor/flex.html +0 -21
  239. package/front_end/ui/components/docs/style_property_editor/flex.ts +0 -52
  240. package/front_end/ui/components/docs/style_property_editor/grid.html +0 -22
  241. package/front_end/ui/components/docs/style_property_editor/grid.ts +0 -50
  242. package/front_end/ui/components/docs/style_property_editor/masonry.html +0 -21
  243. package/front_end/ui/components/docs/style_property_editor/masonry.ts +0 -50
  244. package/front_end/ui/components/docs/switch/basic.ts +0 -51
  245. /package/front_end/entrypoints/node_app/{nodeConnectionsPanel.css → app/nodeConnectionsPanel.css} +0 -0
@@ -6,16 +6,17 @@ import * as i18n from '../../core/i18n/i18n.js';
6
6
  import type * as Platform from '../../core/platform/platform.js';
7
7
  import type * as ProtocolClient from '../../core/protocol_client/protocol_client.js';
8
8
  import * as SDK from '../../core/sdk/sdk.js';
9
+ import type * as Protocol from '../../generated/protocol.js';
9
10
 
10
11
  import type * as ReportRenderer from './LighthouseReporterTypes.js';
11
12
 
12
13
  /**
13
14
  * @file
14
- * ┌────────────┐
15
- * CDP Backend
16
- * └────────────┘
15
+ * ┌───────────────┐
16
+ * CDPConnection
17
+ * └───────────────┘
17
18
  * │ ▲
18
- * │ │ parallelConnection
19
+ * │ │
19
20
  * ┌┐ ▼ │ ┌┐
20
21
  * ││ dispatchProtocolMessage sendProtocolMessage ││
21
22
  * ││ │ ▲ ││
@@ -28,7 +29,10 @@ import type * as ReportRenderer from './LighthouseReporterTypes.js';
28
29
  * ││ onFrontendMessage notifyFrontendViaWorkerMessage ││
29
30
  * ││ │ ▲ ││
30
31
  * ││ ▼ │ ││
31
- * LighthouseWorkerService ││ Either ConnectionProxy or LegacyPort ││
32
+ * LighthouseWorkerService ││ WorkerConnectionTransport ││
33
+ * ││ │ ▲ ││
34
+ * ││ ▼ │ ││
35
+ * ││ CDPConnection ││
32
36
  * ││ │ ▲ ││
33
37
  * ││ ┌─────────────────────┼─┼───────────────────────┐ ││
34
38
  * ││ │ Lighthouse ┌────▼──────┐ │ ││
@@ -37,10 +41,10 @@ import type * as ReportRenderer from './LighthouseReporterTypes.js';
37
41
  * └┘ └───────────────────────────────────────────────┘ └┘
38
42
  *
39
43
  * - All messages traversing the worker boundary are action-wrapped.
40
- * - All messages over the parallelConnection speak pure CDP.
41
- * - All messages within ConnectionProxy/LegacyPort speak pure CDP.
42
- * - The foundational CDP connection is `parallelConnection`.
43
- * - All connections within the worker are not actual ParallelConnection's.
44
+ * - All messages over the CDPConnection speak pure CDP.
45
+ * - Within the worker we also use a 'CDPConnection' but with a custom
46
+ * transport called WorkerConnectionTransport.
47
+ * - All messages within WorkerConnectionTransport/LegacyPort speak pure CDP.
44
48
  */
45
49
 
46
50
  let lastId = 1;
@@ -57,14 +61,15 @@ export interface LighthouseRun {
57
61
  /**
58
62
  * ProtocolService manages a connection between the frontend (Lighthouse panel) and the Lighthouse worker.
59
63
  */
60
- export class ProtocolService {
61
- private mainSessionId?: string;
64
+ export class ProtocolService implements ProtocolClient.CDPConnection.CDPConnectionObserver {
65
+ private mainSessionId?: Protocol.Target.SessionID;
62
66
  private rootTargetId?: string;
63
- private parallelConnection?: ProtocolClient.ConnectionTransport.ConnectionTransport;
67
+ private rootTarget?: SDK.Target.Target;
64
68
  private lighthouseWorkerPromise?: Promise<Worker>;
65
69
  private lighthouseMessageUpdateCallback?: ((arg0: string) => void);
66
70
  private removeDialogHandler?: () => void;
67
71
  private configForTesting?: object;
72
+ private connection?: ProtocolClient.CDPConnection.CDPConnection;
68
73
 
69
74
  async attach(): Promise<void> {
70
75
  await SDK.TargetManager.TargetManager.instance().suspendAllTargets();
@@ -90,12 +95,15 @@ export class ProtocolService {
90
95
  throw new Error('Could not find the child target manager class for the root target');
91
96
  }
92
97
 
93
- const {connection, sessionId} = await rootChildTargetManager.createParallelConnection(message => {
94
- if (typeof message === 'string') {
95
- message = JSON.parse(message);
96
- }
97
- this.dispatchProtocolMessage(message);
98
- });
98
+ const router = rootTarget.router();
99
+ if (!router) {
100
+ throw new Error('Expected root target to have a session router');
101
+ }
102
+
103
+ const rootTargetId = await rootChildTargetManager.getParentTargetId();
104
+ const {sessionId} = await rootTarget.targetAgent().invoke_attachToTarget({targetId: rootTargetId, flatten: true});
105
+ this.connection = router;
106
+ this.connection.observe(this);
99
107
 
100
108
  // Lighthouse implements its own dialog handler like this, however its lifecycle ends when
101
109
  // the internal Lighthouse session is disposed.
@@ -114,8 +122,8 @@ export class ProtocolService {
114
122
  this.removeDialogHandler = () =>
115
123
  resourceTreeModel.removeEventListener(SDK.ResourceTreeModel.Events.JavaScriptDialogOpening, dialogHandler);
116
124
 
117
- this.parallelConnection = connection;
118
- this.rootTargetId = await rootChildTargetManager.getParentTargetId();
125
+ this.rootTargetId = rootTargetId;
126
+ this.rootTarget = rootTarget;
119
127
  this.mainSessionId = sessionId;
120
128
  }
121
129
 
@@ -166,20 +174,22 @@ export class ProtocolService {
166
174
 
167
175
  async detach(): Promise<void> {
168
176
  const oldLighthouseWorker = this.lighthouseWorkerPromise;
169
- const oldParallelConnection = this.parallelConnection;
177
+ const oldRootTarget = this.rootTarget;
170
178
 
171
179
  // When detaching, make sure that we remove the old promises, before we
172
180
  // perform any async cleanups. That way, if there is a message coming from
173
181
  // lighthouse while we are in the process of cleaning up, we shouldn't deliver
174
182
  // them to the backend.
175
183
  this.lighthouseWorkerPromise = undefined;
176
- this.parallelConnection = undefined;
184
+ this.rootTarget = undefined;
185
+ this.connection?.unobserve(this);
186
+ this.connection = undefined;
177
187
 
178
188
  if (oldLighthouseWorker) {
179
189
  (await oldLighthouseWorker).terminate();
180
190
  }
181
- if (oldParallelConnection) {
182
- await oldParallelConnection.disconnect();
191
+ if (oldRootTarget && this.mainSessionId) {
192
+ await oldRootTarget.targetAgent().invoke_detachFromTarget({sessionId: this.mainSessionId});
183
193
  }
184
194
  await SDK.TargetManager.TargetManager.instance().resumeAllTargets();
185
195
  this.removeDialogHandler?.();
@@ -189,7 +199,11 @@ export class ProtocolService {
189
199
  this.lighthouseMessageUpdateCallback = callback;
190
200
  }
191
201
 
192
- private dispatchProtocolMessage(message: string|object): void {
202
+ onEvent<T extends ProtocolClient.CDPConnection.Event>(event: ProtocolClient.CDPConnection.CDPEvent<T>): void {
203
+ this.dispatchProtocolMessage(event);
204
+ }
205
+
206
+ private dispatchProtocolMessage(message: ProtocolClient.CDPConnection.CDPReceivableMessage): void {
193
207
  // A message without a sessionId is the main session of the main target (call it "Main session").
194
208
  // A parallel connection and session was made that connects to the same main target (call it "Lighthouse session").
195
209
  // Messages from the "Lighthouse session" have a sessionId.
@@ -199,15 +213,15 @@ export class ProtocolService {
199
213
  // * the message has a sessionId (is not for the "Main session")
200
214
  // * the message does not have a sessionId (is for the "Main session"), but only for the Target domain
201
215
  // (to kickstart autoAttach in LH).
202
- const protocolMessage = message as {
203
- sessionId?: string,
204
- method?: string,
205
- };
206
- if (protocolMessage.sessionId || (protocolMessage.method?.startsWith('Target'))) {
216
+ if (message.sessionId || ('method' in message && message.method?.startsWith('Target'))) {
207
217
  void this.send('dispatchProtocolMessage', {message});
208
218
  }
209
219
  }
210
220
 
221
+ onDisconnect(): void {
222
+ // Do nothing.
223
+ }
224
+
211
225
  private initWorker(): Promise<Worker> {
212
226
  this.lighthouseWorkerPromise = new Promise<Worker>(resolve => {
213
227
  const workerUrl = new URL('../../entrypoints/lighthouse_worker/lighthouse_worker.js', import.meta.url);
@@ -255,9 +269,19 @@ export class ProtocolService {
255
269
  }
256
270
 
257
271
  private sendProtocolMessage(message: string): void {
258
- if (this.parallelConnection) {
259
- this.parallelConnection.sendRawMessage(message);
260
- }
272
+ const {id, method, params, sessionId} = JSON.parse(message);
273
+ // CDPConnection manages it's own message IDs and it's important, otherwise we'd clash
274
+ // with the rest of the DevTools traffic.
275
+ // Instead, we ignore the ID coming from the worker when sending the command, but
276
+ // patch it back in when sending the response back to the worker.
277
+ void this.connection?.send(method, params, sessionId).then(response => {
278
+ this.dispatchProtocolMessage({
279
+ id,
280
+ sessionId,
281
+ result: 'result' in response ? response.result : undefined,
282
+ error: 'error' in response ? response.error : undefined,
283
+ });
284
+ });
261
285
  }
262
286
 
263
287
  private async send(action: string, args: Record<string, string|string[]|object> = {}): Promise<void> {
@@ -204,7 +204,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: Record<string, unknown>,
204
204
  @endiannesschanged=${input.onEndiannessChanged}
205
205
  @jumptopointeraddress=${input.onJumpToAddress}
206
206
  >
207
- </devtools-linear-memory-inspector-interpreter/>
207
+ </devtools-linear-memory-inspector-interpreter>
208
208
  </div>`}
209
209
  `,
210
210
  target);
@@ -163,13 +163,20 @@ export class LinearMemoryNavigator extends HTMLElement {
163
163
  'address-input': true,
164
164
  invalid: !this.#valid,
165
165
  };
166
- return html`
167
- <input class=${Lit.Directives.classMap(classMap)} data-input="true" .value=${this.#address}
168
- jslog=${VisualLogging.textField('linear-memory-inspector.address').track({
166
+ return html`<input
167
+ class=${Lit.Directives.classMap(classMap)}
168
+ data-input="true"
169
+ .value=${this.#address}
170
+ jslog=${VisualLogging.textField('linear-memory-inspector.address').track({
169
171
  change: true,
170
172
  })}
171
- title=${ifDefined(this.#valid ? i18nString(UIStrings.enterAddress) : this.#error)} @change=${
172
- this.#onAddressChange.bind(this, Mode.SUBMITTED)} @input=${this.#onAddressChange.bind(this, Mode.EDIT)}/>`;
173
+ title=${
174
+ ifDefined(
175
+ this.#valid ? i18nString(UIStrings.enterAddress) : this.#error,
176
+ )}
177
+ @change=${this.#onAddressChange.bind(this, Mode.SUBMITTED)}
178
+ @input=${this.#onAddressChange.bind(this, Mode.EDIT)}
179
+ />`;
173
180
  }
174
181
 
175
182
  #onAddressChange(mode: Mode, event: Event): void {
@@ -56,7 +56,7 @@ export class RequestInitiatorView extends UI.Widget.VBox {
56
56
  const networkManager = SDK.NetworkManager.NetworkManager.forRequest(request);
57
57
  const target = networkManager ? networkManager.target() : undefined;
58
58
  return new Components.JSPresentationUtils.StackTracePreviewContent(
59
- undefined, target, linkifier, {stackTrace: initiator.stack, tabStops: focusableLink});
59
+ undefined, target, linkifier, {runtimeStackTrace: initiator.stack, tabStops: focusableLink});
60
60
  }
61
61
 
62
62
  private createTree(): UI.TreeOutline.TreeOutlineInShadow {
@@ -75,7 +75,7 @@ export class EditableSpan extends HTMLElement {
75
75
  tabindex="0"
76
76
  .innerText=${this.#value}
77
77
  jslog=${VisualLogging.value('header-editor').track({change: true, keydown: 'Enter|Escape'})}
78
- </span>`, this.#shadow, {host: this});
78
+ ></span>`, this.#shadow, {host: this});
79
79
  // clang-format on
80
80
  }
81
81
 
@@ -456,7 +456,7 @@ function viewFunction(input: ViewInput, _output: ViewOutput, target: HTMLElement
456
456
  } data-section-index=${
457
457
  input.sectionIndex
458
458
  } class=${Lit.Directives.classMap(stepClasses)}>
459
- <svg slot="icon" width="24" height="24" height="100%" class="icon">
459
+ <svg slot="icon" width="24" height="24" class="icon">
460
460
  <circle class="circle-icon"/>
461
461
  <g class="error-icon">
462
462
  <path d="M1.5 1.5L6.5 6.5" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -104,23 +104,24 @@ export class RecordingPlayer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
104
104
  }
105
105
 
106
106
  const rootChildTargetManager = rootTarget.model(SDK.ChildTargetManager.ChildTargetManager);
107
-
108
107
  if (!rootChildTargetManager) {
109
108
  throw new Error('Could not find the child target manager class for the root target');
110
109
  }
111
110
 
112
- // Pass an empty message handler because it will be overwritten by puppeteer anyways.
113
- const result = await rootChildTargetManager.createParallelConnection(() => {});
114
- const connection = result.connection as SDK.Connections.ParallelConnectionInterface;
111
+ const router = rootTarget.router();
112
+ if (!router) {
113
+ throw new Error('Expected root target to have a router');
114
+ }
115
115
 
116
116
  const mainTargetId = await childTargetManager.getParentTargetId();
117
117
  const rootTargetId = await rootChildTargetManager.getParentTargetId();
118
-
118
+ const {sessionId} = await rootTarget.targetAgent().invoke_attachToTarget({targetId: rootTargetId, flatten: true});
119
119
  const {page, browser, puppeteerConnection} =
120
120
  await PuppeteerService.PuppeteerConnection.PuppeteerConnectionHelper.connectPuppeteerToConnectionViaTab(
121
121
  {
122
- connection,
123
- rootTargetId: rootTargetId as string,
122
+ connection: router,
123
+ targetId: rootTargetId,
124
+ sessionId,
124
125
  isPageTargetCallback: isPageTarget,
125
126
  },
126
127
  );
@@ -662,9 +662,9 @@ export class UserAgentClientHintsForm extends HTMLElement {
662
662
  change: true,
663
663
  })}
664
664
  />
665
- <devtools-icon name="bin" class="medium"
665
+ <devtools-icon name="bin"
666
666
  title=${i18nString(UIStrings.brandUserAgentDelete)}
667
- class="delete-icon"
667
+ class="medium delete-icon"
668
668
  tabindex="0"
669
669
  role="button"
670
670
  @click=${handleDeleteClick}
@@ -757,9 +757,9 @@ export class UserAgentClientHintsForm extends HTMLElement {
757
757
  change: true,
758
758
  })}
759
759
  />
760
- <devtools-icon name="bin" class="medium"
760
+ <devtools-icon name="bin"
761
761
  title=${i18nString(UIStrings.brandFullVersionListDelete)}
762
- class="delete-icon"
762
+ class="medium delete-icon"
763
763
  tabindex="0"
764
764
  role="button"
765
765
  @click=${handleDeleteClick}
@@ -456,12 +456,12 @@ export class TimelineFlameChartView extends Common.ObjectWrapper.eventMixin<Even
456
456
  this.#overlays.addEventListener(Overlays.Overlays.EventReferenceClick.eventName, event => {
457
457
  const eventRef = (event as Overlays.Overlays.EventReferenceClick);
458
458
  const fromTraceEvent = selectionFromEvent(eventRef.event);
459
- this.openSelectionDetailsView(fromTraceEvent);
459
+ void this.openSelectionDetailsView(fromTraceEvent);
460
460
  });
461
461
 
462
462
  // This is for the detail view of layout shift.
463
463
  this.element.addEventListener(TimelineInsights.EventRef.EventReferenceClick.eventName, event => {
464
- this.setSelectionAndReveal(selectionFromEvent(event.event));
464
+ void this.setSelectionAndReveal(selectionFromEvent(event.event));
465
465
  });
466
466
 
467
467
  this.element.addEventListener('keydown', this.#keydownHandler.bind(this));
@@ -1469,7 +1469,7 @@ export class TimelineFlameChartView extends Common.ObjectWrapper.eventMixin<Even
1469
1469
  }
1470
1470
  }
1471
1471
 
1472
- setSelectionAndReveal(selection: TimelineSelection|null): void {
1472
+ async setSelectionAndReveal(selection: TimelineSelection|null): Promise<void> {
1473
1473
  if (selection && this.#currentSelection && selectionsEqual(selection, this.#currentSelection)) {
1474
1474
  return;
1475
1475
  }
@@ -1507,8 +1507,7 @@ export class TimelineFlameChartView extends Common.ObjectWrapper.eventMixin<Even
1507
1507
  this.networkFlameChart.setSelectedEntry(networkIndex);
1508
1508
 
1509
1509
  if (this.detailsView) {
1510
- // TODO(crbug.com/1459265): Change to await after migration work.
1511
- void this.detailsView.setSelection(selection);
1510
+ await this.detailsView.setSelection(selection);
1512
1511
  }
1513
1512
 
1514
1513
  // Create the entry selected overlay if the selection represents a trace event
@@ -1552,9 +1551,9 @@ export class TimelineFlameChartView extends Common.ObjectWrapper.eventMixin<Even
1552
1551
  // Only opens the details view of a selection. This is used for Timing Markers. Timing markers replace
1553
1552
  // their entry with a new UI. Because of that, their entries can no longer be "selected" in the timings track,
1554
1553
  // so if clicked, we only open their details view.
1555
- openSelectionDetailsView(selection: TimelineSelection|null): void {
1554
+ async openSelectionDetailsView(selection: TimelineSelection|null): Promise<void> {
1556
1555
  if (this.detailsView) {
1557
- void this.detailsView.setSelection(selection);
1556
+ await this.detailsView.setSelection(selection);
1558
1557
  }
1559
1558
  }
1560
1559
 
@@ -1611,12 +1610,13 @@ export class TimelineFlameChartView extends Common.ObjectWrapper.eventMixin<Even
1611
1610
  this.mainFlameChart.showAllGroups();
1612
1611
  }
1613
1612
 
1614
- private onAddEntryLabelAnnotation(
1613
+ private async onAddEntryLabelAnnotation(
1615
1614
  dataProvider: TimelineFlameChartDataProvider|TimelineFlameChartNetworkDataProvider,
1616
- event: Common.EventTarget.EventTargetEvent<{entryIndex: number, withLinkCreationButton: boolean}>): void {
1615
+ event: Common.EventTarget.EventTargetEvent<{entryIndex: number, withLinkCreationButton: boolean}>):
1616
+ Promise<void> {
1617
1617
  const selection = dataProvider.createSelection(event.data.entryIndex);
1618
1618
  if (selectionIsEvent(selection)) {
1619
- this.setSelectionAndReveal(selection);
1619
+ await this.setSelectionAndReveal(selection);
1620
1620
  ModificationsManager.activeManager()?.createAnnotation(
1621
1621
  {
1622
1622
  type: 'ENTRY_LABEL',
@@ -2130,7 +2130,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2130
2130
  this.flameChart.setModel(parsedTrace, this.#eventToRelatedInsights);
2131
2131
  this.flameChart.resizeToPreferredHeights();
2132
2132
  // Reset the visual selection as we've just swapped to a new trace.
2133
- this.flameChart.setSelectionAndReveal(null);
2133
+ void this.flameChart.setSelectionAndReveal(null);
2134
2134
  this.#sideBar.setParsedTrace(parsedTrace);
2135
2135
 
2136
2136
  this.#searchableView.showWidget();
@@ -2964,7 +2964,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2964
2964
  select(selection: TimelineSelection|null): void {
2965
2965
  this.#announceSelectionToAria(this.selection, selection);
2966
2966
  this.selection = selection;
2967
- this.flameChart.setSelectionAndReveal(selection);
2967
+ void this.flameChart.setSelectionAndReveal(selection);
2968
2968
  }
2969
2969
 
2970
2970
  selectEntryAtTime(events: Trace.Types.Events.Event[]|null, time: number): void {
@@ -3044,7 +3044,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
3044
3044
 
3045
3045
  #openSummaryTab(): void {
3046
3046
  // If we have a selection, we should remove it.
3047
- this.flameChart.setSelectionAndReveal(null);
3047
+ void this.flameChart.setSelectionAndReveal(null);
3048
3048
  this.flameChart.selectDetailsViewTab(Tab.Details, null);
3049
3049
  }
3050
3050
 
@@ -40,6 +40,7 @@ import * as Platform from '../../core/platform/platform.js';
40
40
  import * as Root from '../../core/root/root.js';
41
41
  import * as SDK from '../../core/sdk/sdk.js';
42
42
  import type * as Protocol from '../../generated/protocol.js';
43
+ import * as Bindings from '../../models/bindings/bindings.js';
43
44
  import * as TextUtils from '../../models/text_utils/text_utils.js';
44
45
  import * as Trace from '../../models/trace/trace.js';
45
46
  import * as SourceMapsResolver from '../../models/trace_source_maps_resolver/trace_source_maps_resolver.js';
@@ -1700,14 +1701,14 @@ export class TimelineUIUtils {
1700
1701
  const stackTraceForEvent = Trace.Extras.StackTraceForEvent.get(event, parsedTrace.data);
1701
1702
  if (stackTraceForEvent?.callFrames.length || stackTraceForEvent?.description || stackTraceForEvent?.parent) {
1702
1703
  contentHelper.addSection(i18nString(UIStrings.functionStack));
1703
- contentHelper.createChildStackTraceElement(stackTraceForEvent);
1704
+ await contentHelper.createChildStackTraceElement(stackTraceForEvent);
1704
1705
  // TODO(andoli): also build stack trace component for other events
1705
1706
  // that have a stack trace using the StackTraceForEvent helper.
1706
1707
  } else {
1707
1708
  const stackTrace = Trace.Helpers.Trace.getZeroIndexedStackTraceInEventPayload(event);
1708
1709
  if (stackTrace?.length) {
1709
1710
  contentHelper.addSection(stackLabel);
1710
- contentHelper.createChildStackTraceElement(TimelineUIUtils.stackTraceFromCallFrames(stackTrace));
1711
+ await contentHelper.createChildStackTraceElement(TimelineUIUtils.stackTraceFromCallFrames(stackTrace));
1711
1712
  }
1712
1713
  }
1713
1714
  switch (event.name) {
@@ -1740,12 +1741,7 @@ export class TimelineUIUtils {
1740
1741
  const stackTrace = Trace.Helpers.Trace.getZeroIndexedStackTraceInEventPayload(initiator);
1741
1742
  if (stackTrace) {
1742
1743
  contentHelper.addSection(initiatorStackLabel);
1743
- contentHelper.createChildStackTraceElement(TimelineUIUtils.stackTraceFromCallFrames(stackTrace.map(frame => {
1744
- return {
1745
- ...frame,
1746
- scriptId: String(frame.scriptId) as Protocol.Runtime.ScriptId,
1747
- };
1748
- })));
1744
+ await contentHelper.createChildStackTraceElement(TimelineUIUtils.stackTraceFromCallFrames(stackTrace));
1749
1745
  }
1750
1746
 
1751
1747
  const link = this.createEntryLink(initiator);
@@ -2455,29 +2451,30 @@ export class TimelineDetailsContentHelper {
2455
2451
  this.appendElementRow(title, locationContent);
2456
2452
  }
2457
2453
 
2458
- createChildStackTraceElement(stackTrace: Protocol.Runtime.StackTrace): void {
2454
+ async createChildStackTraceElement(runtimeStackTrace: Protocol.Runtime.StackTrace): Promise<void> {
2459
2455
  if (!this.#linkifier) {
2460
2456
  return;
2461
2457
  }
2462
2458
 
2463
- // We resolve the original function name here. StackTracePreviewContent uses
2464
- // Linkifier to resolve the source code location.
2465
- const resolvedStackTrace: Protocol.Runtime.StackTrace = structuredClone(stackTrace);
2466
- let currentResolvedStackTrace: Protocol.Runtime.StackTrace|undefined = resolvedStackTrace;
2467
- while (currentResolvedStackTrace) {
2468
- currentResolvedStackTrace.callFrames = currentResolvedStackTrace.callFrames.map(
2469
- callFrame => ({
2470
- ...callFrame,
2471
- functionName: SourceMapsResolver.SourceMapsResolver.resolvedCodeLocationForCallFrame(callFrame)?.name ||
2472
- callFrame.functionName,
2473
- }));
2474
- currentResolvedStackTrace = currentResolvedStackTrace.parent;
2459
+ let callFrameContents;
2460
+ if (this.target) {
2461
+ const stackTrace = await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance()
2462
+ .createStackTraceFromProtocolRuntime(runtimeStackTrace, this.target);
2463
+ callFrameContents = new LegacyComponents.JSPresentationUtils.StackTracePreviewContent(
2464
+ undefined, this.target ?? undefined, this.#linkifier, {stackTrace, tabStops: true, showColumnNumber: true});
2465
+ } else {
2466
+ // I _think_ this only happens during tests.
2467
+ // See "TimelineFlameChartView > shows the details for a selected main thread event".
2468
+ // For now, just defer to the still-supported legacy runtime stack trace. When
2469
+ // that is removed, we could instead create a stub StackTrace ourselves, even
2470
+ // without a `target`.
2471
+ callFrameContents = new LegacyComponents.JSPresentationUtils.StackTracePreviewContent(
2472
+ undefined, this.target ?? undefined, this.#linkifier,
2473
+ {runtimeStackTrace, tabStops: true, showColumnNumber: true});
2475
2474
  }
2475
+
2476
2476
  const stackTraceElement =
2477
2477
  this.tableElement.createChild('div', 'timeline-details-view-row timeline-details-stack-values');
2478
- const callFrameContents = new LegacyComponents.JSPresentationUtils.StackTracePreviewContent(
2479
- undefined, this.target ?? undefined, this.#linkifier,
2480
- {stackTrace: resolvedStackTrace, tabStops: true, showColumnNumber: true});
2481
2478
  callFrameContents.markAsRoot();
2482
2479
  callFrameContents.show(stackTraceElement);
2483
2480
  }
@@ -11,6 +11,7 @@ import * as Trace from '../../../models/trace/trace.js';
11
11
  import * as Buttons from '../../../ui/components/buttons/buttons.js';
12
12
  import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
13
13
  import * as Lit from '../../../ui/lit/lit.js';
14
+ import {nothing} from '../../../ui/lit/lit.js';
14
15
  import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
15
16
 
16
17
  import type {BaseInsightComponent} from './insights/BaseInsightComponent.js';
@@ -428,10 +429,10 @@ export class SidebarSingleInsightSet extends HTMLElement {
428
429
  this.#data.activeCategory,
429
430
  );
430
431
 
431
- const renderInsightComponent = (insightData: CategorizedInsightData): Lit.TemplateResult => {
432
+ const renderInsightComponent = (insightData: CategorizedInsightData): Lit.LitTemplate => {
432
433
  const {componentClass, model} = insightData;
433
434
  if (!this.#data.parsedTrace?.insights) {
434
- return html``;
435
+ return nothing;
435
436
  }
436
437
 
437
438
  const agentFocus = AIAssistance.AIContext.AgentFocus.fromInsight(this.#data.parsedTrace, model);
@@ -91,8 +91,10 @@ export class PanelUtils {
91
91
  if (request.hasThirdPartyCookiePhaseoutIssue()) {
92
92
  // clang-format off
93
93
  return html`<devtools-icon
94
- class="icon" name="warning-filled" title=${i18nString(UIStrings.thirdPartyPhaseout)}
95
- </devtools-icon>`;
94
+ class="icon"
95
+ name="warning-filled"
96
+ title=${i18nString(UIStrings.thirdPartyPhaseout)}
97
+ ></devtools-icon>`;
96
98
  // clang-format on
97
99
  }
98
100