chrome-devtools-frontend 1.0.1545096 → 1.0.1547571

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 (301) hide show
  1. package/.stylelintrc.json +5 -1
  2. package/docs/contributing/infrastructure.md +2 -2
  3. package/docs/styleguide/ux/styles.md +1 -1
  4. package/eslint.config.mjs +2 -1
  5. package/front_end/Images/generate-css-vars.js +1 -1
  6. package/front_end/Images/src/arrow-down.svg +8 -1
  7. package/front_end/Images/src/arrow-up.svg +8 -1
  8. package/front_end/core/common/common.ts +0 -2
  9. package/front_end/core/host/AidaClient.ts +1 -1
  10. package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
  11. package/front_end/core/host/UserMetrics.ts +0 -5
  12. package/front_end/core/i18n/collect-ui-strings.js +1 -1
  13. package/front_end/core/i18n/generate-locales-js.js +1 -1
  14. package/front_end/core/platform/HostRuntime.ts +25 -0
  15. package/front_end/core/platform/KeyboardUtilities.ts +2 -2
  16. package/front_end/core/platform/StringUtilities.ts +1 -1
  17. package/front_end/core/platform/api/HostRuntime.ts +45 -0
  18. package/front_end/core/platform/api/api.ts +7 -0
  19. package/front_end/core/{common/Worker.ts → platform/browser/HostRuntime.ts} +27 -12
  20. package/front_end/core/platform/browser/browser.ts +7 -0
  21. package/front_end/core/platform/node/HostRuntime.ts +85 -0
  22. package/front_end/core/platform/node/node.ts +7 -0
  23. package/front_end/core/platform/platform.ts +2 -2
  24. package/front_end/core/sdk/AnimationModel.ts +1 -1
  25. package/front_end/core/sdk/CSSModel.ts +1 -1
  26. package/front_end/core/sdk/CSSProperty.ts +1 -1
  27. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +1 -1
  28. package/front_end/core/sdk/ConsoleModel.ts +1 -1
  29. package/front_end/core/sdk/Cookie.ts +1 -1
  30. package/front_end/core/sdk/DOMModel.ts +2 -2
  31. package/front_end/core/sdk/DebuggerModel.ts +1 -1
  32. package/front_end/core/sdk/NetworkManager.ts +6 -0
  33. package/front_end/core/sdk/PreloadingModel.ts +1 -1
  34. package/front_end/core/sdk/RemoteObject.ts +1 -1
  35. package/front_end/core/sdk/ResourceTreeModel.ts +1 -1
  36. package/front_end/core/sdk/Script.ts +4 -4
  37. package/front_end/core/sdk/SourceMapScopesInfo.ts +141 -23
  38. package/front_end/core/sdk/Target.ts +5 -14
  39. package/front_end/core/sdk/TargetManager.ts +26 -4
  40. package/front_end/core/sdk/sdk-meta.ts +62 -0
  41. package/front_end/devtools_compatibility.js +0 -1
  42. package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +2 -2
  43. package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +15 -18
  44. package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +8 -5
  45. package/front_end/entrypoints/main/ExecutionContextSelector.ts +1 -1
  46. package/front_end/entrypoints/main/MainImpl.ts +4 -4
  47. package/front_end/foundation/Universe.ts +2 -2
  48. package/front_end/generated/Deprecation.ts +26 -0
  49. package/front_end/generated/InspectorBackendCommands.ts +5 -4
  50. package/front_end/generated/SupportedCSSProperties.js +17 -15
  51. package/front_end/generated/protocol-mapping.d.ts +2 -0
  52. package/front_end/generated/protocol-proxy-api.d.ts +4 -0
  53. package/front_end/generated/protocol.ts +19 -29
  54. package/front_end/models/ai_assistance/AiConversation.ts +268 -0
  55. package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -172
  56. package/front_end/models/ai_assistance/BuiltInAi.ts +131 -134
  57. package/front_end/models/ai_assistance/ChangeManager.ts +9 -0
  58. package/front_end/models/ai_assistance/ConversationHandler.ts +27 -52
  59. package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -8
  60. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +6 -2
  61. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
  62. package/front_end/models/ai_assistance/agents/StylingAgent.ts +3 -19
  63. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  64. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +313 -313
  65. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +8 -6
  66. package/front_end/models/ai_assistance/performance/AICallTree.snapshot.txt +33 -33
  67. package/front_end/models/ai_assistance/performance/AICallTree.ts +9 -3
  68. package/front_end/models/bindings/CSSWorkspaceBinding.ts +5 -3
  69. package/front_end/models/bindings/SASSSourceMapping.ts +6 -4
  70. package/front_end/models/cpu_profile/CPUProfileDataModel.ts +10 -7
  71. package/front_end/models/crux-manager/CrUXManager.ts +7 -4
  72. package/front_end/models/formatter/FormatterWorkerPool.ts +9 -7
  73. package/front_end/models/har/Importer.ts +1 -1
  74. package/front_end/models/issues_manager/ContrastCheckTrigger.ts +1 -1
  75. package/front_end/models/issues_manager/GenericIssue.ts +12 -9
  76. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
  77. package/front_end/models/persistence/AutomaticFileSystemManager.ts +1 -1
  78. package/front_end/models/trace/handlers/SamplesHandler.ts +3 -0
  79. package/front_end/models/trace/helpers/Trace.ts +13 -0
  80. package/front_end/models/trace/types/TraceEvents.ts +2 -1
  81. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +29 -0
  82. package/front_end/models/workspace/IgnoreListManager.ts +1 -2
  83. package/front_end/models/workspace/UISourceCode.ts +50 -0
  84. package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -1
  85. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +86 -159
  86. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +8 -0
  87. package/front_end/panels/ai_assistance/components/ChatView.ts +56 -33
  88. package/front_end/panels/animation/AnimationTimeline.ts +0 -8
  89. package/front_end/panels/application/ExtensionStorageModel.ts +1 -1
  90. package/front_end/panels/application/FrameDetailsView.ts +64 -36
  91. package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
  92. package/front_end/panels/application/components/components.ts +0 -2
  93. package/front_end/panels/common/AiCodeGenerationTeaser.ts +80 -0
  94. package/front_end/panels/common/common.ts +2 -1
  95. package/front_end/panels/console/ConsoleInsightTeaser.ts +166 -100
  96. package/front_end/panels/console/ConsolePrompt.ts +4 -2
  97. package/front_end/panels/console/ConsoleViewMessage.ts +77 -29
  98. package/front_end/panels/console/ConsoleViewport.ts +2 -3
  99. package/front_end/panels/console/consoleInsightTeaser.css +1 -0
  100. package/front_end/panels/coverage/CoverageModel.ts +2 -2
  101. package/front_end/panels/elements/ElementIssueUtils.ts +2 -2
  102. package/front_end/panels/elements/ElementsPanel.ts +1 -1
  103. package/front_end/panels/elements/ElementsTreeOutline.ts +17 -7
  104. package/front_end/panels/elements/NodeStackTraceWidget.ts +6 -5
  105. package/front_end/panels/elements/StylePropertyTreeElement.ts +24 -21
  106. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  107. package/front_end/panels/elements/cssValueTraceView.css +1 -1
  108. package/front_end/panels/elements/elements-meta.ts +1 -0
  109. package/front_end/panels/explain/components/ConsoleInsight.ts +44 -57
  110. package/front_end/panels/explain/components/consoleInsight.css +46 -1
  111. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +1 -2
  112. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +19 -0
  113. package/front_end/panels/network/RequestConditionsDrawer.ts +116 -42
  114. package/front_end/panels/network/networkLogView.css +11 -0
  115. package/front_end/panels/network/networkTimingTable.css +8 -6
  116. package/front_end/panels/network/requestConditionsDrawer.css +10 -1
  117. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
  118. package/front_end/panels/profiler/HeapSnapshotProxy.ts +15 -14
  119. package/front_end/panels/profiler/ProfilesPanel.ts +1 -2
  120. package/front_end/panels/recorder/components/StepEditor.ts +1 -1
  121. package/front_end/panels/security/SecurityPanelSidebar.ts +1 -3
  122. package/front_end/panels/settings/KeybindsSettingsTab.ts +21 -22
  123. package/front_end/panels/sources/CSSPlugin.ts +1 -1
  124. package/front_end/panels/sources/CoveragePlugin.ts +5 -5
  125. package/front_end/panels/sources/DebuggerPlugin.ts +2 -2
  126. package/front_end/panels/sources/NavigatorView.ts +1 -1
  127. package/front_end/panels/sources/Plugin.ts +1 -1
  128. package/front_end/panels/sources/ProfilePlugin.ts +22 -14
  129. package/front_end/panels/sources/SourcesSearchScope.ts +1 -1
  130. package/front_end/panels/sources/UISourceCodeFrame.ts +2 -1
  131. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +10 -2
  132. package/front_end/panels/sources/sources-meta.ts +0 -62
  133. package/front_end/panels/timeline/README.md +1 -9
  134. package/front_end/panels/timeline/ThreadAppender.ts +0 -7
  135. package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
  136. package/front_end/panels/timeline/TimelinePanel.ts +8 -8
  137. package/front_end/panels/timeline/TimelineUIUtils.ts +5 -1
  138. package/front_end/panels/timeline/components/ExportTraceOptions.ts +15 -1
  139. package/front_end/panels/timeline/components/LiveMetricsView.ts +37 -1
  140. package/front_end/panels/timeline/components/exportTraceOptions.css +11 -2
  141. package/front_end/panels/timeline/enable-easter-egg.js +1 -1
  142. package/front_end/panels/timeline/utils/Treemap.ts +1 -1
  143. package/front_end/third_party/chromium/README.chromium +1 -1
  144. package/front_end/third_party/puppeteer/README.chromium +2 -2
  145. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts +66 -0
  146. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
  147. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js +57 -0
  148. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
  149. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
  151. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
  152. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +2 -2
  153. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  154. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts +1 -0
  156. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
  157. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js +1 -0
  158. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js.map +1 -1
  159. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +1 -6
  161. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
  162. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +0 -4
  163. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +18 -23
  165. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  166. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
  167. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  168. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +16 -0
  169. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  170. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts +4 -62
  171. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js +9 -73
  173. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts.map +1 -1
  176. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.js.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +3 -3
  180. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  181. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +8 -1
  182. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  183. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +11 -1
  184. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  187. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  188. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  189. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  190. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  192. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +9 -10
  193. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +80 -81
  194. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts +66 -0
  195. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
  196. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js +52 -0
  197. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
  198. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +1 -1
  199. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
  200. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
  201. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +2 -2
  202. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  203. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  204. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts +1 -0
  205. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
  206. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js +1 -0
  207. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js.map +1 -1
  208. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  209. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +1 -6
  210. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
  211. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +0 -4
  212. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  213. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +18 -23
  214. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  215. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
  216. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  217. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +16 -0
  218. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  219. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts +4 -62
  220. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
  221. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js +6 -69
  222. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
  223. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts +1 -1
  224. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts.map +1 -1
  225. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.js.map +1 -1
  226. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +1 -1
  227. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  228. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +3 -3
  229. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  230. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +8 -1
  231. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  232. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +11 -1
  233. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
  234. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  235. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  236. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  237. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  238. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  239. package/front_end/third_party/puppeteer/package/lib/types.d.ts +9 -10
  240. package/front_end/third_party/puppeteer/package/package.json +3 -3
  241. package/front_end/third_party/puppeteer/package/src/api/DeviceRequestPrompt.ts +79 -0
  242. package/front_end/third_party/puppeteer/package/src/api/Frame.ts +1 -1
  243. package/front_end/third_party/puppeteer/package/src/api/Page.ts +2 -2
  244. package/front_end/third_party/puppeteer/package/src/api/api.ts +1 -0
  245. package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +1 -9
  246. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +21 -31
  247. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +18 -0
  248. package/front_end/third_party/puppeteer/package/src/cdp/DeviceRequestPrompt.ts +6 -72
  249. package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +2 -4
  250. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +7 -2
  251. package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +14 -0
  252. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  253. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  254. package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +1 -0
  255. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -0
  256. package/front_end/ui/components/text_editor/javascript.ts +1 -1
  257. package/front_end/ui/legacy/ARIAUtils.ts +2 -2
  258. package/front_end/ui/legacy/ActionRegistration.ts +11 -0
  259. package/front_end/ui/legacy/ListWidget.ts +51 -18
  260. package/front_end/ui/legacy/ReportView.ts +1 -1
  261. package/front_end/ui/legacy/SoftDropDown.ts +2 -2
  262. package/front_end/ui/legacy/TabbedPane.ts +3 -3
  263. package/front_end/ui/legacy/TextPrompt.ts +3 -2
  264. package/front_end/ui/legacy/Treeoutline.ts +3 -2
  265. package/front_end/ui/legacy/UIUtils.ts +11 -10
  266. package/front_end/ui/legacy/Widget.ts +3 -2
  267. package/front_end/ui/legacy/components/color_picker/ContrastInfo.ts +1 -1
  268. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +5 -4
  269. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +87 -111
  270. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +62 -39
  271. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +1 -1
  272. package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +2 -2
  273. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -9
  274. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +41 -13
  275. package/front_end/ui/legacy/components/utils/jsUtils.css +28 -0
  276. package/front_end/ui/legacy/inspectorCommon.css +2 -2
  277. package/front_end/ui/legacy/legacy.ts +2 -0
  278. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  279. package/front_end/ui/visual_logging/LoggingConfig.ts +2 -1
  280. package/inspector_overlay/tool_window_controls.ts +4 -1
  281. package/mcp/mcp.ts +1 -1
  282. package/package.json +2 -3
  283. package/front_end/panels/application/components/StackTrace.ts +0 -239
  284. package/front_end/panels/application/components/stackTraceLinkButton.css +0 -16
  285. package/front_end/panels/application/components/stackTraceRow.css +0 -50
  286. package/front_end/panels/explain/components/consoleInsightSourcesList.css +0 -51
  287. package/front_end/ui/components/docs/README.md +0 -6
  288. package/front_end/ui/components/docs/building-ui-documentation/ComponentEvents.md +0 -54
  289. package/front_end/ui/components/docs/building-ui-documentation/ComponentPerformance.md +0 -136
  290. package/front_end/ui/components/docs/building-ui-documentation/CreatingComponents.md +0 -242
  291. package/front_end/ui/components/docs/building-ui-documentation/README.md +0 -23
  292. package/front_end/ui/components/docs/building-ui-documentation/StylingComponents.md +0 -66
  293. package/front_end/ui/components/docs/building-ui-documentation/TestingComponents.md +0 -111
  294. package/front_end/ui/components/docs/component_docs.ts +0 -24
  295. package/front_end/ui/components/docs/component_docs_styles.css +0 -53
  296. package/front_end/ui/components/docs/create_breadcrumbs.ts +0 -44
  297. package/front_end/ui/components/docs/slider/basic.html +0 -20
  298. package/front_end/ui/components/docs/switch/basic.html +0 -20
  299. /package/front_end/models/issues_manager/descriptions/{genericFormAriaLabelledByToNonExistingId.md → genericFormAriaLabelledByToNonExistingIdError.md} +0 -0
  300. /package/front_end/models/issues_manager/descriptions/{genericFormLabelHasNeitherForNorNestedInput.md → genericFormLabelHasNeitherForNorNestedInputError.md} +0 -0
  301. /package/front_end/{core/platform → ui/legacy}/DOMUtilities.ts +0 -0
@@ -94,6 +94,14 @@ const DATA_USAGE_URL = 'https://developer.chrome.com/docs/devtools/ai-assistance
94
94
  const EXPLAIN_TEASER_ACTION_ID = 'explain.console-message.teaser';
95
95
  const SLOW_GENERATION_CUTOFF_MILLISECONDS = 3500;
96
96
 
97
+ const enum State {
98
+ READY = 'ready',
99
+ GENERATING = 'generating', // Before receiving first chunk
100
+ PARTIAL_TEASER = 'partial-teaser', // After receiving first chunk
101
+ TEASER = 'teaser',
102
+ ERROR = 'error',
103
+ }
104
+
97
105
  interface ViewInput {
98
106
  onTellMeMoreClick: (event: Event) => void;
99
107
  // If multiple ConsoleInsightTeasers exist, each one needs a unique id. Otherwise showing and
@@ -105,7 +113,121 @@ interface ViewInput {
105
113
  dontShowChanged: (e: Event) => void;
106
114
  hasTellMeMoreButton: boolean;
107
115
  isSlowGeneration: boolean;
108
- isError: boolean;
116
+ state: State;
117
+ }
118
+
119
+ function renderGenerating(input: ViewInput): Lit.TemplateResult {
120
+ // clang-format off
121
+ return html`
122
+ <div class="teaser-tooltip-container">
123
+ <div class="response-container">
124
+ <h2>${input.isSlowGeneration ?
125
+ lockedString(UIStringsNotTranslate.summarizingTakesABitLonger) :
126
+ lockedString(UIStringsNotTranslate.summarizing)
127
+ }</h2>
128
+ <div
129
+ role="presentation"
130
+ aria-label=${lockedString(UIStringsNotTranslate.loading)}
131
+ class="loader"
132
+ style="clip-path: url(${'#clipPath-' + input.uuid});"
133
+ >
134
+ <svg width="100%" height="58">
135
+ <defs>
136
+ <clipPath id=${'clipPath-' + input.uuid}>
137
+ <rect x="0" y="0" width="100%" height="12" rx="8"></rect>
138
+ <rect x="0" y="20" width="100%" height="12" rx="8"></rect>
139
+ <rect x="0" y="40" width="100%" height="12" rx="8"></rect>
140
+ </clipPath>
141
+ </defs>
142
+ </svg>
143
+ </div>
144
+ </div>
145
+ ${renderFooter(input)}
146
+ </div>
147
+ `;
148
+ // clang-format on
149
+ }
150
+
151
+ function renderError(input: ViewInput): Lit.TemplateResult {
152
+ // clang-format off
153
+ return html`
154
+ <div class="teaser-tooltip-container">
155
+ <h2>${lockedString(UIStringsNotTranslate.summaryNotAvailable)}</h2>
156
+ ${renderFooter(input)}
157
+ </div>
158
+ `;
159
+ // clang-format on
160
+ }
161
+
162
+ function renderDontShowCheckbox(input: ViewInput): Lit.TemplateResult {
163
+ // clang-format off
164
+ return html`
165
+ <devtools-checkbox
166
+ aria-label=${lockedString(UIStringsNotTranslate.dontShow)}
167
+ @change=${input.dontShowChanged}
168
+ jslog=${VisualLogging.toggle('explain.teaser.dont-show').track({ change: true })}>
169
+ ${lockedString(UIStringsNotTranslate.dontShow)}
170
+ </devtools-checkbox>
171
+ `;
172
+ // clang-format on
173
+ }
174
+
175
+ function renderFooter(input: ViewInput): Lit.TemplateResult {
176
+ // clang-format off
177
+ return html`
178
+ <div class="tooltip-footer">
179
+ ${input.hasTellMeMoreButton ? html`
180
+ <devtools-button
181
+ title=${lockedString(UIStringsNotTranslate.tellMeMore)}
182
+ .jslogContext=${'insights-teaser-tell-me-more'}
183
+ .variant=${Buttons.Button.Variant.PRIMARY}
184
+ @click=${input.onTellMeMoreClick}
185
+ >
186
+ <devtools-icon class="lightbulb-icon" name="lightbulb-spark"></devtools-icon>
187
+ ${lockedString(UIStringsNotTranslate.tellMeMore)}
188
+ </devtools-button>
189
+ ` : Lit.nothing}
190
+ <devtools-button
191
+ .iconName=${'info'}
192
+ .variant=${Buttons.Button.Variant.ICON}
193
+ aria-details=${'teaser-info-tooltip-' + input.uuid}
194
+ .accessibleLabel=${lockedString(UIStringsNotTranslate.learnDataUsage)}
195
+ ></devtools-button>
196
+ <devtools-tooltip
197
+ id=${'teaser-info-tooltip-' + input.uuid}
198
+ variant="rich"
199
+ jslogContext="teaser-info-tooltip"
200
+ trigger="both"
201
+ hover-delay=500
202
+ >
203
+ <div class="info-tooltip-text">${lockedString(UIStringsNotTranslate.infoTooltipText)}</div>
204
+ <div class="learn-more">
205
+ <x-link
206
+ class="devtools-link"
207
+ title=${lockedString(UIStringsNotTranslate.learnMoreAboutAiSummaries)}
208
+ href=${DATA_USAGE_URL}
209
+ jslog=${VisualLogging.link().track({click: true, keydown:'Enter|Space'}).context('explain.teaser.learn-more')}
210
+ >${lockedString(UIStringsNotTranslate.learnMoreAboutAiSummaries)}</x-link>
211
+ </div>
212
+ </devtools-tooltip>
213
+ ${renderDontShowCheckbox(input)}
214
+ </div>
215
+ `;
216
+ // clang-format on
217
+ }
218
+
219
+ function renderTeaser(input: ViewInput): Lit.TemplateResult {
220
+ // clang-format off
221
+ return html`
222
+ <div class="teaser-tooltip-container">
223
+ <div class="response-container">
224
+ <h2>${input.headerText}</h2>
225
+ <div class="main-text">${input.mainText}</div>
226
+ </div>
227
+ ${renderFooter(input)}
228
+ </div>
229
+ `;
230
+ // clang-format on
109
231
  }
110
232
 
111
233
  export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLElement): void => {
@@ -114,7 +236,6 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
114
236
  return;
115
237
  }
116
238
 
117
- const showPlaceholder = !Boolean(input.mainText);
118
239
  // clang-format off
119
240
  render(html`
120
241
  <style>${consoleInsightTeaserStyles}</style>
@@ -126,83 +247,18 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
126
247
  prefer-span-left
127
248
  jslogContext="console-insight-teaser"
128
249
  >
129
- <div class="teaser-tooltip-container">
130
- ${input.isError ? html`
131
- <h2>${lockedString(UIStringsNotTranslate.summaryNotAvailable)}</h2>
132
- ` :
133
- showPlaceholder ? html`
134
- <div class="response-container">
135
- <h2>${input.isSlowGeneration ?
136
- lockedString(UIStringsNotTranslate.summarizingTakesABitLonger) :
137
- lockedString(UIStringsNotTranslate.summarizing)
138
- }</h2>
139
- <div
140
- role="presentation"
141
- aria-label=${lockedString(UIStringsNotTranslate.loading)}
142
- class="loader"
143
- style="clip-path: url(${'#clipPath-' + input.uuid});"
144
- >
145
- <svg width="100%" height="58">
146
- <defs>
147
- <clipPath id=${'clipPath-' + input.uuid}>
148
- <rect x="0" y="0" width="100%" height="12" rx="8"></rect>
149
- <rect x="0" y="20" width="100%" height="12" rx="8"></rect>
150
- <rect x="0" y="40" width="100%" height="12" rx="8"></rect>
151
- </clipPath>
152
- </defs>
153
- </svg>
154
- </div>
155
- </div>
156
- ` : html`
157
- <div class="response-container">
158
- <h2>${input.headerText}</h2>
159
- <div class="main-text">${input.mainText}</div>
160
- </div>
161
- `
250
+ ${(() => {
251
+ switch (input.state) {
252
+ case State.READY:
253
+ case State.GENERATING:
254
+ return renderGenerating(input);
255
+ case State.ERROR:
256
+ return renderError(input);
257
+ case State.PARTIAL_TEASER:
258
+ case State.TEASER:
259
+ return renderTeaser(input);
162
260
  }
163
- <div class="tooltip-footer">
164
- ${input.hasTellMeMoreButton ? html`
165
- <devtools-button
166
- title=${lockedString(UIStringsNotTranslate.tellMeMore)}
167
- .jslogContext=${'insights-teaser-tell-me-more'}
168
- .variant=${Buttons.Button.Variant.PRIMARY}
169
- @click=${input.onTellMeMoreClick}
170
- >
171
- <devtools-icon class="lightbulb-icon" name="lightbulb-spark"></devtools-icon>
172
- ${lockedString(UIStringsNotTranslate.tellMeMore)}
173
- </devtools-button>
174
- ` : Lit.nothing}
175
- <devtools-button
176
- .iconName=${'info'}
177
- .variant=${Buttons.Button.Variant.ICON}
178
- aria-details=${'teaser-info-tooltip-' + input.uuid}
179
- .accessibleLabel=${lockedString(UIStringsNotTranslate.learnDataUsage)}
180
- ></devtools-button>
181
- <devtools-tooltip
182
- id=${'teaser-info-tooltip-' + input.uuid}
183
- variant="rich"
184
- jslogContext="teaser-info-tooltip"
185
- trigger="both"
186
- hover-delay=500
187
- >
188
- <div class="info-tooltip-text">${lockedString(UIStringsNotTranslate.infoTooltipText)}</div>
189
- <div class="learn-more">
190
- <x-link
191
- class="devtools-link"
192
- title=${lockedString(UIStringsNotTranslate.learnMoreAboutAiSummaries)}
193
- href=${DATA_USAGE_URL}
194
- jslog=${VisualLogging.link().track({click: true, keydown:'Enter|Space'}).context('explain.teaser.learn-more')}
195
- >${lockedString(UIStringsNotTranslate.learnMoreAboutAiSummaries)}</x-link>
196
- </div>
197
- </devtools-tooltip>
198
- <devtools-checkbox
199
- aria-label=${lockedString(UIStringsNotTranslate.dontShow)}
200
- @change=${input.dontShowChanged}
201
- jslog=${VisualLogging.toggle('explain.teaser.dont-show').track({ change: true })}>
202
- ${lockedString(UIStringsNotTranslate.dontShow)}
203
- </devtools-checkbox>
204
- </div>
205
- </div>
261
+ })()}
206
262
  </devtools-tooltip>
207
263
  `, target);
208
264
  // clang-format on
@@ -213,8 +269,7 @@ export type View = typeof DEFAULT_VIEW;
213
269
  export class ConsoleInsightTeaser extends UI.Widget.Widget {
214
270
  #view: View;
215
271
  #uuid: string;
216
- #isGenerating = false;
217
- #builtInAi: AiAssistanceModel.BuiltInAi.BuiltInAi|undefined;
272
+ #builtInAi: AiAssistanceModel.BuiltInAi.BuiltInAi;
218
273
  #promptBuilder: PromptBuilder;
219
274
  #headerText = '';
220
275
  #mainText = '';
@@ -223,9 +278,9 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
223
278
  #abortController: null|AbortController = null;
224
279
  #isSlow = false;
225
280
  #timeoutId: ReturnType<typeof setTimeout>|null = null;
226
- #isError = false;
227
281
  #aidaAvailability?: Host.AidaClient.AidaAccessPreconditions;
228
282
  #boundOnAidaAvailabilityChange: () => Promise<void>;
283
+ #state: State;
229
284
 
230
285
  constructor(uuid: string, consoleViewMessage: ConsoleViewMessage, element?: HTMLElement, view?: View) {
231
286
  super(element);
@@ -234,6 +289,8 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
234
289
  this.#promptBuilder = new PromptBuilder(consoleViewMessage);
235
290
  this.#consoleViewMessage = consoleViewMessage;
236
291
  this.#boundOnAidaAvailabilityChange = this.#onAidaAvailabilityChange.bind(this);
292
+ this.#builtInAi = AiAssistanceModel.BuiltInAi.BuiltInAi.instance();
293
+ this.#state = State.READY;
237
294
  this.requestUpdate();
238
295
  }
239
296
 
@@ -316,10 +373,24 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
316
373
  }
317
374
 
318
375
  maybeGenerateTeaser(): void {
319
- this.requestUpdate();
320
- if (!this.#isInactive && !this.#isGenerating && !Boolean(this.#mainText) &&
321
- Common.Settings.Settings.instance().moduleSetting('console-insight-teasers-enabled').get()) {
322
- void this.#generateTeaserText();
376
+ switch (this.#state) {
377
+ case State.READY:
378
+ if (!this.#isInactive &&
379
+ Common.Settings.Settings.instance().moduleSetting('console-insight-teasers-enabled').get()) {
380
+ void this.#generateTeaserText();
381
+ }
382
+ this.requestUpdate();
383
+ return;
384
+ case State.GENERATING:
385
+ console.error('Trying trigger teaser generation when state is "GENERATING"');
386
+ return;
387
+ case State.PARTIAL_TEASER:
388
+ console.error('Trying trigger teaser generation when state is "PARTIAL_TEASER"');
389
+ return;
390
+ // These are terminal states. No need to update anything.
391
+ case State.TEASER:
392
+ case State.ERROR:
393
+ return;
323
394
  }
324
395
  }
325
396
 
@@ -327,11 +398,11 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
327
398
  if (this.#abortController) {
328
399
  this.#abortController.abort();
329
400
  }
330
- if (this.#isGenerating) {
401
+ if (this.#state === State.GENERATING || this.#state === State.PARTIAL_TEASER) {
331
402
  this.#mainText = '';
403
+ this.#state = State.READY;
332
404
  Host.userMetrics.actionTaken(Host.UserMetrics.Action.InsightTeaserGenerationAborted);
333
405
  }
334
- this.#isGenerating = false;
335
406
  if (this.#timeoutId) {
336
407
  clearTimeout(this.#timeoutId);
337
408
  }
@@ -352,7 +423,7 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
352
423
 
353
424
  async #generateTeaserText(): Promise<void> {
354
425
  this.#headerText = this.#consoleViewMessage.toMessageTextString().substring(0, 70);
355
- this.#isGenerating = true;
426
+ this.#state = State.GENERATING;
356
427
  Host.userMetrics.actionTaken(Host.UserMetrics.Action.InsightTeaserGenerationStarted);
357
428
  this.#timeoutId = setTimeout(this.#setSlow.bind(this), SLOW_GENERATION_CUTOFF_MILLISECONDS);
358
429
  const startTime = performance.now();
@@ -362,6 +433,7 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
362
433
  for await (const chunk of this.#getOnDeviceInsight()) {
363
434
  teaserText += chunk;
364
435
  this.#mainText = teaserText;
436
+ this.#state = State.PARTIAL_TEASER;
365
437
  this.requestUpdate();
366
438
  if (!firstChunkReceived) {
367
439
  firstChunkReceived = true;
@@ -370,12 +442,13 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
370
442
  }
371
443
  } catch (err) {
372
444
  // Ignore `AbortError` errors, which are thrown on mouse leave.
373
- if (err.name !== 'AbortError') {
445
+ if (err.name === 'AbortError') {
446
+ this.#state = State.READY;
447
+ } else {
374
448
  console.error(err.name, err.message);
375
- this.#isError = true;
449
+ this.#state = State.ERROR;
376
450
  Host.userMetrics.actionTaken(Host.UserMetrics.Action.InsightTeaserGenerationErrored);
377
451
  }
378
- this.#isGenerating = false;
379
452
  clearTimeout(this.#timeoutId);
380
453
  this.requestUpdate();
381
454
  return;
@@ -383,7 +456,7 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
383
456
 
384
457
  clearTimeout(this.#timeoutId);
385
458
  Host.userMetrics.consoleInsightTeaserGenerated(performance.now() - startTime);
386
- this.#isGenerating = false;
459
+ this.#state = State.TEASER;
387
460
  this.#mainText = teaserText;
388
461
  Host.userMetrics.actionTaken(Host.UserMetrics.Action.InsightTeaserGenerationCompleted);
389
462
  this.requestUpdate();
@@ -391,13 +464,6 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
391
464
 
392
465
  async * #getOnDeviceInsight(): AsyncGenerator<string> {
393
466
  const {prompt} = await this.#promptBuilder.buildPrompt();
394
- if (!this.#builtInAi) {
395
- this.#builtInAi = await AiAssistanceModel.BuiltInAi.BuiltInAi.instance();
396
- if (!this.#builtInAi) {
397
- this.#isInactive = true;
398
- throw new Error('Cannot instantiate BuiltInAi');
399
- }
400
- }
401
467
  this.#abortController = new AbortController();
402
468
  const stream = this.#builtInAi.getConsoleInsight(prompt, this.#abortController);
403
469
  for await (const chunk of stream) {
@@ -436,7 +502,7 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
436
502
  dontShowChanged: this.#dontShowChanged.bind(this),
437
503
  hasTellMeMoreButton: this.#hasTellMeMoreButton(),
438
504
  isSlowGeneration: this.#isSlow,
439
- isError: this.#isError,
505
+ state: this.#state,
440
506
  },
441
507
  undefined, this.contentElement);
442
508
  }
@@ -285,7 +285,7 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
285
285
  if (preview.deepTextContent() !== TextEditor.Config.contentIncludingHint(this.editor.editor).trim()) {
286
286
  this.innerPreviewElement.appendChild(preview);
287
287
  }
288
- if (result && 'object' in result && result.object && result.object.subtype === 'node') {
288
+ if (result && 'object' in result && result.object?.subtype === 'node') {
289
289
  this.highlightingNode = true;
290
290
  SDK.OverlayModel.OverlayModel.highlightObjectAsDOMNode(result.object);
291
291
  } else if (this.highlightingNode) {
@@ -448,7 +448,9 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
448
448
  }
449
449
 
450
450
  private async handleEnter(forceEvaluate?: boolean): Promise<void> {
451
- if (this.#selfXssWarningShown && this.text() === i18nString(UIStrings.allowPasting)) {
451
+ if (this.#selfXssWarningShown &&
452
+ (this.text() === i18nString(UIStrings.allowPasting) ||
453
+ this.text() === `'${i18nString(UIStrings.allowPasting)}'`)) {
452
454
  Common.Console.Console.instance().log(this.text());
453
455
  this.editor.dispatch({
454
456
  changes: {from: 0, to: this.editor.state.doc.length},
@@ -223,6 +223,14 @@ const UIStrings = {
223
223
  * @description Tooltip shown when user hovers over the cookie icon to explain that the button will bring the user to the cookie report
224
224
  */
225
225
  SeeIssueInCookieReport: 'Click to open privacy and security panel and show third-party cookie report',
226
+ /**
227
+ * @description Element text content in Object Properties Section
228
+ */
229
+ dots: '(...)',
230
+ /**
231
+ * @description Element title in Object Properties Section
232
+ */
233
+ invokePropertyGetter: 'Invoke property getter',
226
234
  } as const;
227
235
  const str_ = i18n.i18n.registerUIStrings('panels/console/ConsoleViewMessage.ts', UIStrings);
228
236
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -282,6 +290,14 @@ const hoverButtonObserver = new IntersectionObserver(results => {
282
290
  }
283
291
  });
284
292
 
293
+ function appendOrShow(parent: Element, child: DocumentFragment|UI.Widget.Widget): void {
294
+ if (child instanceof UI.Widget.Widget) {
295
+ child.show(parent, null, /* suppressOprhanWidgetError=*/ true);
296
+ } else {
297
+ parent.appendChild(child);
298
+ }
299
+ }
300
+
285
301
  export class ConsoleViewMessage implements ConsoleViewportElement {
286
302
  protected message: SDK.ConsoleModel.ConsoleMessage;
287
303
  private readonly linkifier: Components.Linkifier.Linkifier;
@@ -452,7 +468,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
452
468
  if (this.message.type === Protocol.Runtime.ConsoleAPICalledEventType.Assert) {
453
469
  this.messagePrefix = i18nString(UIStrings.assertionFailed);
454
470
  }
455
- if (this.message.parameters && this.message.parameters.length === 1) {
471
+ if (this.message.parameters?.length === 1) {
456
472
  const parameter = this.message.parameters[0];
457
473
  if (typeof parameter !== 'string' && parameter.type === 'string') {
458
474
  messageElement = this.tryFormatAsError((parameter.value as string));
@@ -528,7 +544,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
528
544
  this.selectableChildren.push({element: linkElement, forceSelect: () => linkElement.focus()});
529
545
  return linkElement;
530
546
  });
531
- messageElement.appendChild(fragment);
547
+ appendOrShow(messageElement, fragment);
532
548
  }
533
549
  return messageElement;
534
550
  }
@@ -767,7 +783,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
767
783
  for (let i = 0; i < parameters.length; ++i) {
768
784
  // Inline strings when formatting.
769
785
  if (shouldFormatMessage && parameters[i].type === 'string') {
770
- formattedResult.appendChild(this.linkifyStringAsFragment(parameters[i].description || ''));
786
+ appendOrShow(formattedResult, this.linkifyStringAsFragment(parameters[i].description || ''));
771
787
  } else {
772
788
  formattedResult.appendChild(this.formatParameter(parameters[i], false, true));
773
789
  }
@@ -843,9 +859,10 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
843
859
  const result = document.createElement('span');
844
860
  const description = obj.description || '';
845
861
  if (description.length > getMaxTokenizableStringLength()) {
846
- const propertyValue =
847
- new ObjectUI.ObjectPropertiesSection.ExpandableTextPropertyValue(description, getLongStringVisibleLength());
848
- result.appendChild(propertyValue.element);
862
+ const propertyValue = new ObjectUI.ObjectPropertiesSection.ExpandableTextPropertyValue();
863
+ propertyValue.text = description;
864
+ propertyValue.maxLength = getLongStringVisibleLength();
865
+ propertyValue.show(result, null, /* suppressOprhanWidgetError=*/ true);
849
866
  } else {
850
867
  UI.UIUtils.createTextChild(result, description);
851
868
  }
@@ -982,7 +999,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
982
999
  const text = Platform.StringUtilities.formatAsJSLiteral(description);
983
1000
  const result = document.createElement('span');
984
1001
  result.addEventListener('contextmenu', this.contextMenuEventFired.bind(this, output), false);
985
- result.appendChild(this.linkifyStringAsFragment(text));
1002
+ appendOrShow(result, this.linkifyStringAsFragment(text));
986
1003
  return result;
987
1004
  }
988
1005
 
@@ -999,7 +1016,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
999
1016
  let errorElement = this.tryFormatAsError(error.errorStack, details);
1000
1017
  if (!errorElement) {
1001
1018
  errorElement = document.createElement('span');
1002
- errorElement.append(this.linkifyStringAsFragment(error.errorStack));
1019
+ appendOrShow(errorElement, this.linkifyStringAsFragment(error.errorStack));
1003
1020
  }
1004
1021
 
1005
1022
  if (includeCausedByPrefix) {
@@ -1010,9 +1027,9 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1010
1027
  result.appendChild(errorElement);
1011
1028
  }
1012
1029
 
1013
- if (cause && cause.subtype === 'error') {
1030
+ if (cause?.subtype === 'error') {
1014
1031
  await formatErrorStack(cause, /* includeCausedByPrefix */ true);
1015
- } else if (cause && cause.type === 'string') {
1032
+ } else if (cause?.type === 'string') {
1016
1033
  const stringCauseElement = document.createElement('div');
1017
1034
  stringCauseElement.append(`Caused by: ${cause.value}`);
1018
1035
  result.append(stringCauseElement);
@@ -1037,11 +1054,43 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1037
1054
  return fragment;
1038
1055
  }
1039
1056
 
1057
+ createRemoteObjectAccessorPropertySpan(
1058
+ object: SDK.RemoteObject.RemoteObject|null, propertyPath: string[],
1059
+ callback: (arg0: SDK.RemoteObject.CallFunctionResult) => void): HTMLElement {
1060
+ const rootElement = document.createElement('span');
1061
+ const element = rootElement.createChild('span');
1062
+ element.textContent = i18nString(UIStrings.dots);
1063
+ if (!object) {
1064
+ return rootElement;
1065
+ }
1066
+ element.classList.add('object-value-calculate-value-button');
1067
+ UI.Tooltip.Tooltip.install(element, i18nString(UIStrings.invokePropertyGetter));
1068
+ element.addEventListener('click', onInvokeGetterClick, false);
1069
+
1070
+ function onInvokeGetterClick(event: Event): void {
1071
+ event.consume();
1072
+ if (object) {
1073
+ void object.callFunction(invokeGetter, [{value: JSON.stringify(propertyPath)}]).then(callback);
1074
+ }
1075
+ }
1076
+
1077
+ function invokeGetter(this: Object, arrayStr: string): Object {
1078
+ let result: Object = this;
1079
+ const properties = JSON.parse(arrayStr);
1080
+ for (let i = 0, n = properties.length; i < n; ++i) {
1081
+ // @ts-expect-error callFunction expects this to be a generic Object, so while this works we can't be more specific on types.
1082
+ result = result[properties[i]];
1083
+ }
1084
+ return result;
1085
+ }
1086
+
1087
+ return rootElement;
1088
+ }
1089
+
1040
1090
  private formatAsAccessorProperty(
1041
1091
  object: SDK.RemoteObject.RemoteObject|null, propertyPath: string[], isArrayEntry: boolean): HTMLElement {
1042
1092
  const rootElement =
1043
- ObjectUI.ObjectPropertiesSection.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan(
1044
- object, propertyPath, onInvokeGetterClick.bind(this));
1093
+ this.createRemoteObjectAccessorPropertySpan(object, propertyPath, onInvokeGetterClick.bind(this));
1045
1094
 
1046
1095
  function onInvokeGetterClick(this: ConsoleViewMessage, result: SDK.RemoteObject.CallFunctionResult): void {
1047
1096
  const wasThrown = result.wasThrown;
@@ -1093,7 +1142,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1093
1142
  }
1094
1143
  case 'string': {
1095
1144
  if (currentStyle.size === 0) {
1096
- formattedResult.append(this.linkifyStringAsFragment(token.value));
1145
+ appendOrShow(formattedResult, this.linkifyStringAsFragment(token.value));
1097
1146
  } else {
1098
1147
  const lines = token.value.split('\n');
1099
1148
  for (let i = 0; i < lines.length; i++) {
@@ -1104,7 +1153,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1104
1153
  wrapper.style.setProperty('contain', 'paint');
1105
1154
  wrapper.style.setProperty('display', 'inline-block');
1106
1155
  wrapper.style.setProperty('max-width', '100%');
1107
- wrapper.appendChild(this.linkifyStringAsFragment(lines[i]));
1156
+ appendOrShow(wrapper, this.linkifyStringAsFragment(lines[i]));
1108
1157
  for (const [property, {value, priority}] of currentStyle) {
1109
1158
  wrapper.style.setProperty(property, value, priority);
1110
1159
  }
@@ -1477,7 +1526,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1477
1526
  return false;
1478
1527
  }
1479
1528
  if (!Common.Settings.Settings.instance().moduleSetting('console-insight-teasers-enabled').getIfNotDisabled() ||
1480
- !AiAssistanceModel.BuiltInAi.BuiltInAi.cachedIsAvailable()) {
1529
+ !AiAssistanceModel.BuiltInAi.BuiltInAi.instance().hasSession()) {
1481
1530
  return false;
1482
1531
  }
1483
1532
  const devtoolsLocale = i18n.DevToolsLocale.DevToolsLocale.instance();
@@ -1757,13 +1806,13 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1757
1806
  for (let f = 0; f < frames.length; ++f) {
1758
1807
  const {name} = frames[f];
1759
1808
  const formattedLine = document.createElement('span');
1760
- formattedLine.appendChild(this.linkifyStringAsFragment(`${prefix} ${name} (`));
1809
+ appendOrShow(formattedLine, this.linkifyStringAsFragment(`${prefix} ${name} (`));
1761
1810
  const scriptLocationLink = this.linkifier.linkifyScriptLocation(
1762
1811
  debuggerModel.target(), null, url, lineNumber, {columnNumber, inlineFrameIndex: f});
1763
1812
  scriptLocationLink.tabIndex = -1;
1764
1813
  this.selectableChildren.push({element: scriptLocationLink, forceSelect: () => scriptLocationLink.focus()});
1765
1814
  formattedLine.appendChild(scriptLocationLink);
1766
- formattedLine.appendChild(this.linkifyStringAsFragment(suffix));
1815
+ appendOrShow(formattedLine, this.linkifyStringAsFragment(suffix));
1767
1816
  formattedLine.classList.add('formatted-stack-frame');
1768
1817
  stackTrace.insertBefore(formattedLine, insertBefore);
1769
1818
  }
@@ -1824,7 +1873,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1824
1873
  // where the error occurred. We use the source location from the
1825
1874
  // exceptionDetails and append it to the end of the message instead.
1826
1875
  if (!link && exceptionDetails && line.startsWith('SyntaxError')) {
1827
- formattedResult.appendChild(this.linkifyStringAsFragment(line));
1876
+ appendOrShow(formattedResult, this.linkifyStringAsFragment(line));
1828
1877
  const maybeScriptLocation = this.createScriptLocationLinkForSyntaxError(debuggerModel, exceptionDetails);
1829
1878
  if (maybeScriptLocation) {
1830
1879
  formattedResult.append(' (at ');
@@ -1835,18 +1884,18 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1835
1884
  continue;
1836
1885
  }
1837
1886
  if (!isCallFrame) {
1838
- formattedResult.appendChild(this.linkifyStringAsFragment(`${line}${newline}`));
1887
+ appendOrShow(formattedResult, this.linkifyStringAsFragment(`${line}${newline}`));
1839
1888
  continue;
1840
1889
  }
1841
1890
  const formattedLine = document.createElement('span');
1842
1891
  if (!link) {
1843
- formattedLine.appendChild(this.linkifyStringAsFragment(`${line}${newline}`));
1892
+ appendOrShow(formattedLine, this.linkifyStringAsFragment(`${line}${newline}`));
1844
1893
  formattedLine.classList.add('formatted-builtin-stack-frame');
1845
1894
  formattedResult.appendChild(formattedLine);
1846
1895
  continue;
1847
1896
  }
1848
1897
  const suffix = `${link.suffix}${newline}`;
1849
- formattedLine.appendChild(this.linkifyStringAsFragment(link.prefix));
1898
+ appendOrShow(formattedLine, this.linkifyStringAsFragment(link.prefix));
1850
1899
  const scriptLocationLink = this.linkifier.linkifyScriptLocation(
1851
1900
  debuggerModel.target(), link.scriptId || null, link.url, link.lineNumber, {
1852
1901
  columnNumber: link.columnNumber,
@@ -1856,7 +1905,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1856
1905
  scriptLocationLink.tabIndex = -1;
1857
1906
  this.selectableChildren.push({element: scriptLocationLink, forceSelect: () => scriptLocationLink.focus()});
1858
1907
  formattedLine.appendChild(scriptLocationLink);
1859
- formattedLine.appendChild(this.linkifyStringAsFragment(suffix));
1908
+ appendOrShow(formattedLine, this.linkifyStringAsFragment(suffix));
1860
1909
  formattedLine.classList.add('formatted-stack-frame');
1861
1910
  formattedResult.appendChild(formattedLine);
1862
1911
 
@@ -1887,13 +1936,12 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1887
1936
  private linkifyWithCustomLinkifier(
1888
1937
  string: string,
1889
1938
  linkifier: (arg0: string, arg1: Platform.DevToolsPath.UrlString, arg2?: number, arg3?: number) => Node):
1890
- DocumentFragment {
1939
+ DocumentFragment|UI.Widget.Widget {
1891
1940
  if (string.length > getMaxTokenizableStringLength()) {
1892
- const propertyValue =
1893
- new ObjectUI.ObjectPropertiesSection.ExpandableTextPropertyValue(string, getLongStringVisibleLength());
1894
- const fragment = document.createDocumentFragment();
1895
- fragment.appendChild(propertyValue.element);
1896
- return fragment;
1941
+ const propertyValue = new ObjectUI.ObjectPropertiesSection.ExpandableTextPropertyValue();
1942
+ propertyValue.text = string;
1943
+ propertyValue.maxLength = getLongStringVisibleLength();
1944
+ return propertyValue;
1897
1945
  }
1898
1946
  const container = document.createDocumentFragment();
1899
1947
  const tokens = ConsoleViewMessage.tokenizeMessageText(string);
@@ -1932,7 +1980,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1932
1980
  return container;
1933
1981
  }
1934
1982
 
1935
- private linkifyStringAsFragment(string: string): DocumentFragment {
1983
+ private linkifyStringAsFragment(string: string): DocumentFragment|UI.Widget.Widget {
1936
1984
  return this.linkifyWithCustomLinkifier(string, (text, url, lineNumber, columnNumber) => {
1937
1985
  const options = {text, lineNumber, columnNumber};
1938
1986
  const linkElement =
@@ -215,8 +215,7 @@ export class ConsoleViewport {
215
215
  private updateFocusedItem(focusLastChild?: boolean): void {
216
216
  const selectedElement = this.renderedElementAt(this.virtualSelectedIndex);
217
217
  const changed = this.lastSelectedElement !== selectedElement;
218
- const containerHasFocus =
219
- this.#contentElement === Platform.DOMUtilities.deepActiveElement(this.element.ownerDocument);
218
+ const containerHasFocus = this.#contentElement === UI.DOMUtilities.deepActiveElement(this.element.ownerDocument);
220
219
  if (this.lastSelectedElement && changed) {
221
220
  this.lastSelectedElement.classList.remove('console-selected');
222
221
  }
@@ -425,7 +424,7 @@ export class ConsoleViewport {
425
424
 
426
425
  for (let i = start; i <= end; i++) {
427
426
  const element = (this.providerElement(i) as ConsoleViewMessage);
428
- if (element && element.consoleMessage().type === 'table') {
427
+ if (element?.consoleMessage().type === 'table') {
429
428
  return true;
430
429
  }
431
430
  }