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
@@ -26,35 +26,114 @@ export class SourceMapScopesInfo {
26
26
  }
27
27
 
28
28
  /**
29
- * If the source map does not contain any scopes information, this factory function attempts to create bare bones scope information
29
+ * If the source map does not contain any scopes information, this factory function attempts to create scope information
30
30
  * via the script's AST combined with the mappings.
31
31
  *
32
32
  * We create the generated ranges from the scope tree and for each range we create an original scope that matches the bounds 1:1.
33
- * We don't map the bounds via mappings as mappings are often iffy and it's not strictly required to translate stack traces where we
34
- * map call-sites separately.
35
33
  */
36
34
  static createFromAst(
37
35
  sourceMap: SourceMap, scopeTree: Formatter.FormatterWorkerPool.ScopeTreeNode,
38
36
  text: TextUtils.Text.Text): SourceMapScopesInfo {
39
- const {scope, range} = convertScope(scopeTree, undefined, undefined);
40
- return new SourceMapScopesInfo(sourceMap, {scopes: [scope], ranges: [range]});
37
+ const numSourceUrls = sourceMap.sourceURLs().length;
38
+ const scopeBySourceUrl: ScopesCodec.OriginalScope[] = [];
39
+ for (let i = 0; i < numSourceUrls; i++) {
40
+ const scope: ScopesCodec.OriginalScope = {
41
+ start: {line: 0, column: 0},
42
+ end: {line: Number.POSITIVE_INFINITY, column: Number.POSITIVE_INFINITY},
43
+ isStackFrame: false,
44
+ variables: [],
45
+ children: [],
46
+ };
47
+ scopeBySourceUrl.push(scope);
48
+ }
49
+
50
+ // Convert the entire scopeTree. Returns a root range that encompasses everything,
51
+ // and inserts scopes by sourceIndex into the above scopeBySourceUrl.
52
+ const {range} = convertScope(scopeTree, undefined);
53
+ return new SourceMapScopesInfo(sourceMap, {scopes: scopeBySourceUrl, ranges: [range]});
54
+
55
+ /**
56
+ * Recursively finds the correct place in the tree to insert the new scope.
57
+ * Maintains the invariant that children are sorted and contained by their parent.
58
+ */
59
+ function insertInScope(parent: ScopesCodec.OriginalScope, newScope: ScopesCodec.OriginalScope): void {
60
+ // Check if the newScope fits strictly inside any of the existing children.
61
+ for (const child of parent.children) {
62
+ if (contains(child, newScope)) {
63
+ insertInScope(child, newScope);
64
+ return;
65
+ }
66
+ }
67
+
68
+ // When here, newScope belongs directly in parent.
69
+ // However, newScope might encompass some of parent's existing children (due
70
+ // to compiler transform quirks or arbitrary insertion order). We must move
71
+ // those children inside newScope.
72
+ const childrenToKeep: ScopesCodec.OriginalScope[] = [];
73
+ for (const child of parent.children) {
74
+ if (contains(newScope, child)) {
75
+ // child is actually inside newScope, so re-parent it.
76
+ newScope.children.push(child);
77
+ child.parent = newScope;
78
+ } else {
79
+ childrenToKeep.push(child);
80
+ }
81
+ }
82
+
83
+ // Find the correct index in the remaining children to insert newScope.
84
+ // We look for the first child that starts after the new scope.
85
+ const insertIndex = childrenToKeep.findIndex(child => compareScopes(newScope, child) < 0);
86
+ if (insertIndex === -1) {
87
+ // If no child starts after, it goes at the end.
88
+ childrenToKeep.push(newScope);
89
+ } else {
90
+ childrenToKeep.splice(insertIndex, 0, newScope);
91
+ }
92
+
93
+ // Update parent's children to only be the ones that don't belong to newScope.
94
+ parent.children = childrenToKeep;
95
+ newScope.parent = parent;
96
+ }
97
+
98
+ function contains(outer: ScopesCodec.OriginalScope, inner: ScopesCodec.OriginalScope): boolean {
99
+ return comparePositions(outer.start, inner.start) <= 0 && comparePositions(outer.end, inner.end) >= 0;
100
+ }
101
+
102
+ function compareScopes(a: ScopesCodec.OriginalScope, b: ScopesCodec.OriginalScope): number {
103
+ return comparePositions(a.start, b.start);
104
+ }
105
+
106
+ function comparePositions(a: ScopesCodec.Position, b: ScopesCodec.Position): number {
107
+ if (a.line !== b.line) {
108
+ return a.line - b.line;
109
+ }
110
+ return a.column - b.column;
111
+ }
41
112
 
42
113
  function convertScope(
43
- node: Formatter.FormatterWorkerPool.ScopeTreeNode, parentScope: ScopesCodec.OriginalScope|undefined,
44
- parentRange: ScopesCodec.GeneratedRange|
45
- undefined): {scope: ScopesCodec.OriginalScope, range: ScopesCodec.GeneratedRange} {
114
+ node: Formatter.FormatterWorkerPool.ScopeTreeNode,
115
+ parentRange: ScopesCodec.GeneratedRange|undefined): {range: ScopesCodec.GeneratedRange} {
46
116
  const start = positionFromOffset(node.start);
47
117
  const end = positionFromOffset(node.end);
118
+ const startEntry = sourceMap.findEntry(start.line, start.column);
119
+ const endEntry = sourceMap.findEntry(end.line, end.column);
120
+ const sourceIndex = startEntry?.sourceIndex;
121
+ const canMapOriginalPosition = startEntry && endEntry && sourceIndex !== undefined &&
122
+ startEntry.sourceIndex === endEntry.sourceIndex && startEntry.sourceIndex !== undefined && sourceIndex >= 0 &&
123
+ sourceIndex < numSourceUrls;
48
124
  const isStackFrame = node.kind === Formatter.FormatterWorkerPool.ScopeKind.FUNCTION;
49
125
 
50
- const scope: ScopesCodec.OriginalScope = {
51
- start,
52
- end,
53
- name: sourceMap.findEntry(start.line, start.column, 0)?.name,
54
- isStackFrame,
55
- variables: [],
56
- children: [],
57
- };
126
+ let scope: ScopesCodec.OriginalScope|undefined;
127
+ if (canMapOriginalPosition) {
128
+ scope = {
129
+ start: {line: startEntry.sourceLineNumber, column: startEntry.sourceColumnNumber},
130
+ end: {line: endEntry.sourceLineNumber, column: endEntry.sourceColumnNumber},
131
+ name: startEntry.name,
132
+ isStackFrame,
133
+ variables: [],
134
+ children: [],
135
+ };
136
+ }
58
137
 
59
138
  const range: ScopesCodec.GeneratedRange = {
60
139
  start,
@@ -67,11 +146,14 @@ export class SourceMapScopesInfo {
67
146
  };
68
147
 
69
148
  parentRange?.children.push(range);
70
- parentScope?.children.push(scope);
149
+ if (canMapOriginalPosition && scope) {
150
+ const rootScope = scopeBySourceUrl[sourceIndex];
151
+ insertInScope(rootScope, scope);
152
+ }
71
153
 
72
- node.children.forEach(child => convertScope(child, scope, range));
154
+ node.children.forEach(child => convertScope(child, range));
73
155
 
74
- return {scope, range};
156
+ return {range};
75
157
  }
76
158
 
77
159
  function positionFromOffset(offset: number): ScopesCodec.Position {
@@ -347,7 +429,16 @@ export class SourceMapScopesInfo {
347
429
  /**
348
430
  * Returns the authored function name of the function containing the provided generated position.
349
431
  */
350
- findOriginalFunctionName({line, column}: ScopesCodec.Position): string|null {
432
+ findOriginalFunctionName(position: ScopesCodec.Position): string|null {
433
+ const originalInnerMostScope = this.findOriginalFunctionScope(position)?.scope ?? undefined;
434
+ return this.#findFunctionNameInOriginalScopeChain(originalInnerMostScope);
435
+ }
436
+
437
+ /**
438
+ * Returns the authored function scope of the function containing the provided generated position.
439
+ */
440
+ findOriginalFunctionScope({line, column}: ScopesCodec.Position):
441
+ {scope: ScopesCodec.OriginalScope, url?: Platform.DevToolsPath.UrlString}|null {
351
442
  // There are 2 approaches:
352
443
  // 1) Find the inner-most generated range containing the provided generated position
353
444
  // and use it's OriginalScope (then walk it outwards until we hit a function).
@@ -376,7 +467,24 @@ export class SourceMapScopesInfo {
376
467
  .at(-1);
377
468
  }
378
469
 
379
- return this.#findFunctionNameInOriginalScopeChain(originalInnerMostScope) ?? null;
470
+ if (!originalInnerMostScope) {
471
+ return null;
472
+ }
473
+
474
+ const functionScope = this.#findFunctionScopeInOriginalScopeChain(originalInnerMostScope);
475
+ if (!functionScope) {
476
+ return null;
477
+ }
478
+
479
+ // Find the root scope for some given original source, to get the source url.
480
+ let rootScope: ScopesCodec.OriginalScope = functionScope;
481
+ while (rootScope.parent) {
482
+ rootScope = rootScope.parent;
483
+ }
484
+ const sourceIndex = this.#originalScopes.indexOf(rootScope);
485
+ const url = sourceIndex !== -1 ? this.#sourceMap.sourceURLForSourceIndex(sourceIndex) : undefined;
486
+
487
+ return functionScope ? {scope: functionScope, url} : null;
380
488
  }
381
489
 
382
490
  /**
@@ -403,15 +511,25 @@ export class SourceMapScopesInfo {
403
511
  return result;
404
512
  }
405
513
 
406
- #findFunctionNameInOriginalScopeChain(innerOriginalScope: ScopesCodec.OriginalScope|undefined): string|null {
514
+ #findFunctionScopeInOriginalScopeChain(innerOriginalScope: ScopesCodec.OriginalScope|undefined):
515
+ ScopesCodec.OriginalScope|null {
407
516
  for (let originalScope = innerOriginalScope; originalScope; originalScope = originalScope.parent) {
408
517
  if (originalScope.isStackFrame) {
409
- return originalScope.name ?? '';
518
+ return originalScope;
410
519
  }
411
520
  }
412
521
  return null;
413
522
  }
414
523
 
524
+ #findFunctionNameInOriginalScopeChain(innerOriginalScope: ScopesCodec.OriginalScope|undefined): string|null {
525
+ const functionScope = this.#findFunctionScopeInOriginalScopeChain(innerOriginalScope);
526
+ if (!functionScope) {
527
+ return null;
528
+ }
529
+
530
+ return functionScope.name ?? '';
531
+ }
532
+
415
533
  /**
416
534
  * Returns one or more original stack frames for this single "raw frame" or call-site.
417
535
  *
@@ -7,7 +7,7 @@ import * as Common from '../common/common.js';
7
7
  import * as Platform from '../platform/platform.js';
8
8
  import * as ProtocolClient from '../protocol_client/protocol_client.js';
9
9
 
10
- import {SDKModel} from './SDKModel.js';
10
+ import {SDKModel, type SDKModelConstructor} from './SDKModel.js';
11
11
  import type {TargetManager} from './TargetManager.js';
12
12
 
13
13
  export class Target extends ProtocolClient.InspectorBackend.TargetBase {
@@ -111,20 +111,11 @@ export class Target extends ProtocolClient.InspectorBackend.TargetBase {
111
111
  this.#targetInfo = targetInfo;
112
112
  }
113
113
 
114
- createModels(required: Set<new(arg1: Target) => SDKModel>): void {
114
+ /** Creates the models in the order in which they are provided */
115
+ createModels(models: SDKModelConstructor[]): void {
115
116
  this.#creatingModels = true;
116
- const registeredModels = Array.from(SDKModel.registeredModels.entries());
117
- // Create early models.
118
- for (const [modelClass, info] of registeredModels) {
119
- if (info.early) {
120
- this.model(modelClass);
121
- }
122
- }
123
- // Create autostart and required models.
124
- for (const [modelClass, info] of registeredModels) {
125
- if (info.autostart || required.has(modelClass)) {
126
- this.model(modelClass);
127
- }
117
+ for (const model of models) {
118
+ this.model(model);
128
119
  }
129
120
  this.#creatingModels = false;
130
121
  }
@@ -10,7 +10,7 @@ import {assertNotNullOrUndefined} from '../platform/platform.js';
10
10
  import type * as ProtocolClient from '../protocol_client/protocol_client.js';
11
11
  import * as Root from '../root/root.js';
12
12
 
13
- import {SDKModel, type SDKModelConstructor} from './SDKModel.js';
13
+ import {type RegistrationInfo, SDKModel, type SDKModelConstructor} from './SDKModel.js';
14
14
  import {Target, Type as TargetType} from './Target.js';
15
15
 
16
16
  export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
@@ -31,8 +31,12 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
31
31
  #scopeTarget: Target|null;
32
32
  #defaultScopeSet: boolean;
33
33
  readonly #scopeChangeListeners: Set<() => void>;
34
+ readonly #overrideAutoStartModels?: Set<SDKModelConstructor>;
34
35
 
35
- constructor() {
36
+ /**
37
+ * @param overrideAutoStartModels If provided, then the `autostart` flag on {@link RegistrationInfo} will be ignored.
38
+ */
39
+ constructor(overrideAutoStartModels?: Set<SDKModelConstructor>) {
36
40
  super();
37
41
  this.#targets = new Set();
38
42
  this.#observers = new Set();
@@ -44,6 +48,7 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
44
48
  this.#scopedObservers = new WeakSet();
45
49
  this.#defaultScopeSet = false;
46
50
  this.#scopeChangeListeners = new Set();
51
+ this.#overrideAutoStartModels = overrideAutoStartModels;
47
52
  }
48
53
 
49
54
  static instance({forceNew}: {
@@ -205,6 +210,23 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
205
210
  this.#scopedObservers.delete(targetObserver);
206
211
  }
207
212
 
213
+ /** @returns The set of models we create unconditionally for new targets in the order in which they should be created */
214
+ #autoStartModels(): SDKModelConstructor[] {
215
+ const earlyModels = new Set<SDKModelConstructor>();
216
+ const models = new Set<SDKModelConstructor>();
217
+ const shouldAutostart = (model: SDKModelConstructor, info: RegistrationInfo): boolean =>
218
+ this.#overrideAutoStartModels ? this.#overrideAutoStartModels.has(model) : info.autostart;
219
+
220
+ for (const [model, info] of SDKModel.registeredModels) {
221
+ if (info.early) {
222
+ earlyModels.add(model);
223
+ } else if (shouldAutostart(model, info) || this.#modelObservers.has(model)) {
224
+ models.add(model);
225
+ }
226
+ }
227
+ return [...earlyModels, ...models];
228
+ }
229
+
208
230
  createTarget(
209
231
  id: Protocol.Target.TargetID|'main', name: string, type: TargetType, parentTarget: Target|null,
210
232
  sessionId?: string, waitForDebuggerInPage?: boolean, connection?: ProtocolClient.CDPConnection.CDPConnection,
@@ -214,7 +236,7 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
214
236
  if (waitForDebuggerInPage) {
215
237
  void target.pageAgent().invoke_waitForDebugger();
216
238
  }
217
- target.createModels(new Set(this.#modelObservers.keysArray()));
239
+ target.createModels(this.#autoStartModels());
218
240
  this.#targets.add(target);
219
241
 
220
242
  const inScope = this.isInScope(target);
@@ -316,7 +338,7 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
316
338
  this.#browserTarget = new Target(
317
339
  this, /* #id*/ 'main', /* #name*/ 'browser', TargetType.BROWSER, /* #parentTarget*/ null,
318
340
  /* #sessionId */ '', /* suspended*/ false, /* #connection*/ null, /* targetInfo*/ undefined);
319
- this.#browserTarget.createModels(new Set(this.#modelObservers.keysArray()));
341
+ this.#browserTarget.createModels(this.#autoStartModels());
320
342
  }
321
343
  const targetId =
322
344
  await Host.InspectorFrontendHost.InspectorFrontendHostInstance.initialTargetId() as Protocol.Target.TargetID;
@@ -363,6 +363,30 @@ const UIStrings = {
363
363
  */
364
364
  networkCacheExplanation:
365
365
  'Disabling the network cache will simulate a network experience similar to a first time visitor.',
366
+ /**
367
+ * @description Setting under the Sources category to toggle usage of JavaScript source maps.
368
+ */
369
+ javaScriptSourceMaps: 'JavaScript source maps',
370
+ /**
371
+ * @description Title of a setting under the Sources category that can be invoked through the Command Menu
372
+ */
373
+ enableJavaScriptSourceMaps: 'Enable JavaScript source maps',
374
+ /**
375
+ * @description Title of a setting under the Sources category that can be invoked through the Command Menu
376
+ */
377
+ disableJavaScriptSourceMaps: 'Disable JavaScript source maps',
378
+ /**
379
+ * @description Title of a setting under the Sources category
380
+ */
381
+ cssSourceMaps: 'CSS source maps',
382
+ /**
383
+ * @description Title of a setting under the Sources category that can be invoked through the Command Menu
384
+ */
385
+ enableCssSourceMaps: 'Enable CSS source maps',
386
+ /**
387
+ * @description Title of a setting under the Sources category that can be invoked through the Command Menu
388
+ */
389
+ disableCssSourceMaps: 'Disable CSS source maps',
366
390
  } as const;
367
391
  const str_ = i18n.i18n.registerUIStrings('core/sdk/sdk-meta.ts', UIStrings);
368
392
  const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
@@ -1132,3 +1156,41 @@ Common.Settings.registerSettingExtension({
1132
1156
  tooltip: i18nLazyString(UIStrings.remoteFileLoadingInfo),
1133
1157
  }
1134
1158
  });
1159
+
1160
+ Common.Settings.registerSettingExtension({
1161
+ category: Common.Settings.SettingCategory.SOURCES,
1162
+ storageType: Common.Settings.SettingStorageType.SYNCED,
1163
+ title: i18nLazyString(UIStrings.javaScriptSourceMaps),
1164
+ settingName: 'js-source-maps-enabled',
1165
+ settingType: Common.Settings.SettingType.BOOLEAN,
1166
+ defaultValue: true,
1167
+ options: [
1168
+ {
1169
+ value: true,
1170
+ title: i18nLazyString(UIStrings.enableJavaScriptSourceMaps),
1171
+ },
1172
+ {
1173
+ value: false,
1174
+ title: i18nLazyString(UIStrings.disableJavaScriptSourceMaps),
1175
+ },
1176
+ ],
1177
+ });
1178
+
1179
+ Common.Settings.registerSettingExtension({
1180
+ category: Common.Settings.SettingCategory.SOURCES,
1181
+ storageType: Common.Settings.SettingStorageType.SYNCED,
1182
+ title: i18nLazyString(UIStrings.cssSourceMaps),
1183
+ settingName: 'css-source-maps-enabled',
1184
+ settingType: Common.Settings.SettingType.BOOLEAN,
1185
+ defaultValue: true,
1186
+ options: [
1187
+ {
1188
+ value: true,
1189
+ title: i18nLazyString(UIStrings.enableCssSourceMaps),
1190
+ },
1191
+ {
1192
+ value: false,
1193
+ title: i18nLazyString(UIStrings.disableCssSourceMaps),
1194
+ },
1195
+ ],
1196
+ });
@@ -450,7 +450,6 @@
450
450
  TimelineNavigationSettingState: 'DevTools.TimelineNavigationSettingState',
451
451
  SyncSetting: 'DevTools.SyncSetting',
452
452
  SwatchActivated: 'DevTools.SwatchActivated',
453
- AnimationPlaybackRateChanged: 'DevTools.AnimationPlaybackRateChanged',
454
453
  BuiltInAiAvailability: 'DevTools.BuiltInAiAvailability'
455
454
  // LINT.ThenChange(/front_end/core/host/InspectorFrontendHostAPI.ts:EnumeratedHistogram)
456
455
  };
@@ -260,8 +260,8 @@ export class HTMLModel {
260
260
  this.#updateDOM(token);
261
261
 
262
262
  const element = this.#stack[this.#stack.length - 1];
263
- if (element && (element.name === 'script' || element.name === 'style') && element.openTag &&
264
- element.openTag.endOffset === lastOffset) {
263
+ if (element && (element.name === 'script' || element.name === 'style') &&
264
+ element.openTag?.endOffset === lastOffset) {
265
265
  return AbortTokenization;
266
266
  }
267
267
 
@@ -174,7 +174,7 @@ export class JavaScriptFormatter {
174
174
  return 'sts';
175
175
  }
176
176
  } else if (nodeType === 'ObjectPattern') {
177
- if (node.parent && node.parent.type === 'VariableDeclarator' && AT.punctuator(token, '{')) {
177
+ if (node.parent?.type === 'VariableDeclarator' && AT.punctuator(token, '{')) {
178
178
  return 'st';
179
179
  }
180
180
  if (AT.punctuator(token, ',')) {
@@ -203,7 +203,7 @@ export class JavaScriptFormatter {
203
203
  }
204
204
  } else if (nodeType === 'WithStatement') {
205
205
  if (AT.punctuator(token, ')')) {
206
- return node.body && node.body.type === 'BlockStatement' ? 'ts' : 'tn>';
206
+ return node.body?.type === 'BlockStatement' ? 'ts' : 'tn>';
207
207
  }
208
208
  } else if (nodeType === 'SwitchStatement') {
209
209
  if (AT.punctuator(token, '{')) {
@@ -269,11 +269,11 @@ export class JavaScriptFormatter {
269
269
  }
270
270
  } else if (nodeType === 'IfStatement') {
271
271
  if (AT.punctuator(token, ')')) {
272
- return node.consequent && node.consequent.type === 'BlockStatement' ? 'ts' : 'tn>';
272
+ return node.consequent?.type === 'BlockStatement' ? 'ts' : 'tn>';
273
273
  }
274
274
 
275
275
  if (AT.keyword(token, 'else')) {
276
- const preFormat = node.consequent && node.consequent.type === 'BlockStatement' ? 'st' : 'n<t';
276
+ const preFormat = node.consequent?.type === 'BlockStatement' ? 'st' : 'n<t';
277
277
  let postFormat = 'n>';
278
278
  if (node.alternate && (node.alternate.type === 'BlockStatement' || node.alternate.type === 'IfStatement')) {
279
279
  postFormat = 's';
@@ -285,7 +285,7 @@ export class JavaScriptFormatter {
285
285
  return 'ts';
286
286
  }
287
287
  } else if (nodeType === 'SequenceExpression' && AT.punctuator(token, ',')) {
288
- return node.parent && node.parent.type === 'SwitchCase' ? 'ts' : 'tn';
288
+ return node.parent?.type === 'SwitchCase' ? 'ts' : 'tn';
289
289
  } else if (nodeType === 'ForStatement' || nodeType === 'ForOfStatement' || nodeType === 'ForInStatement') {
290
290
  if (AT.punctuator(token, ';')) {
291
291
  return 'ts';
@@ -295,14 +295,14 @@ export class JavaScriptFormatter {
295
295
  }
296
296
 
297
297
  if (AT.punctuator(token, ')')) {
298
- return node.body && node.body.type === 'BlockStatement' ? 'ts' : 'tn>';
298
+ return node.body?.type === 'BlockStatement' ? 'ts' : 'tn>';
299
299
  }
300
300
  } else if (nodeType === 'WhileStatement') {
301
301
  if (AT.punctuator(token, ')')) {
302
- return node.body && node.body.type === 'BlockStatement' ? 'ts' : 'tn>';
302
+ return node.body?.type === 'BlockStatement' ? 'ts' : 'tn>';
303
303
  }
304
304
  } else if (nodeType === 'DoWhileStatement') {
305
- const blockBody = node.body && node.body.type === 'BlockStatement';
305
+ const blockBody = node.body?.type === 'BlockStatement';
306
306
  if (AT.keyword(token, 'do')) {
307
307
  return blockBody ? 'ts' : 'tn>';
308
308
  }
@@ -369,34 +369,31 @@ export class JavaScriptFormatter {
369
369
  return 'n<';
370
370
  }
371
371
  } else if (nodeType === 'BlockStatement') {
372
- if (node.parent && node.parent.type === 'IfStatement') {
372
+ if (node.parent?.type === 'IfStatement') {
373
373
  const parentNode = (node.parent as Acorn.ESTree.IfStatement);
374
374
  if (parentNode.alternate && parentNode.consequent === node) {
375
375
  return '';
376
376
  }
377
377
  }
378
- if (node.parent && node.parent.type === 'FunctionExpression' && node.parent.parent &&
379
- node.parent.parent.type === 'Property') {
378
+ if (node.parent?.type === 'FunctionExpression' && node.parent.parent?.type === 'Property') {
380
379
  return '';
381
380
  }
382
- if (node.parent && node.parent.type === 'FunctionExpression' && node.parent.parent &&
383
- node.parent.parent.type === 'VariableDeclarator') {
381
+ if (node.parent?.type === 'FunctionExpression' && node.parent.parent?.type === 'VariableDeclarator') {
384
382
  return '';
385
383
  }
386
- if (node.parent && node.parent.type === 'FunctionExpression' && node.parent.parent &&
387
- node.parent.parent.type === 'CallExpression') {
384
+ if (node.parent?.type === 'FunctionExpression' && node.parent.parent?.type === 'CallExpression') {
388
385
  return '';
389
386
  }
390
- if (node.parent && node.parent.type === 'DoWhileStatement') {
387
+ if (node.parent?.type === 'DoWhileStatement') {
391
388
  return '';
392
389
  }
393
- if (node.parent && node.parent.type === 'TryStatement') {
390
+ if (node.parent?.type === 'TryStatement') {
394
391
  const parentNode = (node.parent as Acorn.ESTree.TryStatement);
395
392
  if (parentNode.block === node) {
396
393
  return 's';
397
394
  }
398
395
  }
399
- if (node.parent && node.parent.type === 'CatchClause') {
396
+ if (node.parent?.type === 'CatchClause') {
400
397
  const parentNode = (node.parent as Acorn.ESTree.CatchClause);
401
398
  // @ts-expect-error We are doing a subtype check, without properly checking whether
402
399
  // it exists. We can't fix that, unless we use proper typechecking
@@ -7,7 +7,7 @@ import * as Platform from '../../core/platform/platform.js';
7
7
  import * as FormatterWorker from './formatter_worker.js';
8
8
  import {FormatterActions} from './FormatterActions.js';
9
9
 
10
- self.onmessage = function(event: MessageEvent): void {
10
+ Platform.HostRuntime.HOST_RUNTIME.workerScope.onmessage = function(event): void {
11
11
  const method: FormatterActions = event.data.method;
12
12
  const params: {
13
13
  indentString: string,
@@ -22,17 +22,20 @@ self.onmessage = function(event: MessageEvent): void {
22
22
 
23
23
  switch (method) {
24
24
  case FormatterActions.FORMAT:
25
- self.postMessage(FormatterWorker.FormatterWorker.format(params.mimeType, params.content, params.indentString));
25
+ Platform.HostRuntime.HOST_RUNTIME.workerScope.postMessage(
26
+ FormatterWorker.FormatterWorker.format(params.mimeType, params.content, params.indentString));
26
27
  break;
27
28
  case FormatterActions.PARSE_CSS:
28
29
  FormatterWorker.CSSRuleParser.parseCSS(params.content, self.postMessage);
29
30
  break;
30
31
  case FormatterActions.JAVASCRIPT_SUBSTITUTE: {
31
- self.postMessage(FormatterWorker.Substitute.substituteExpression(params.content, params.mapping));
32
+ Platform.HostRuntime.HOST_RUNTIME.workerScope.postMessage(
33
+ FormatterWorker.Substitute.substituteExpression(params.content, params.mapping));
32
34
  break;
33
35
  }
34
36
  case FormatterActions.JAVASCRIPT_SCOPE_TREE: {
35
- self.postMessage(FormatterWorker.ScopeParser.parseScopes(params.content, params.sourceType)?.export());
37
+ Platform.HostRuntime.HOST_RUNTIME.workerScope.postMessage(
38
+ FormatterWorker.ScopeParser.parseScopes(params.content, params.sourceType)?.export());
36
39
  break;
37
40
  }
38
41
  default:
@@ -40,4 +43,4 @@ self.onmessage = function(event: MessageEvent): void {
40
43
  }
41
44
  };
42
45
 
43
- self.postMessage('workerReady');
46
+ Platform.HostRuntime.HOST_RUNTIME.workerScope.postMessage('workerReady');
@@ -45,7 +45,7 @@ export class ExecutionContextSelector implements SDK.TargetManager.SDKModelObser
45
45
 
46
46
  modelRemoved(runtimeModel: SDK.RuntimeModel.RuntimeModel): void {
47
47
  const currentExecutionContext = this.#context.flavor(SDK.RuntimeModel.ExecutionContext);
48
- if (currentExecutionContext && currentExecutionContext.runtimeModel === runtimeModel) {
48
+ if (currentExecutionContext?.runtimeModel === runtimeModel) {
49
49
  this.#currentExecutionContextGone();
50
50
  }
51
51
 
@@ -183,7 +183,7 @@ export class MainImpl {
183
183
  Host.userMetrics.syncSetting(Common.Settings.Settings.instance().moduleSetting<boolean>('sync-preferences').get());
184
184
  const veLogging = config.devToolsVeLogging;
185
185
 
186
- // Used by e2e_non_hosted to put VE Logs into "test mode".
186
+ // Used by e2e to put VE Logs into "test mode".
187
187
  const veLogsTestMode = Common.Settings.Settings.instance().createSetting('veLogsTestMode', false).get();
188
188
 
189
189
  if (veLogging?.enabled) {
@@ -504,7 +504,7 @@ export class MainImpl {
504
504
  LiveMetrics.LiveMetrics.instance();
505
505
  CrUXManager.CrUXManager.instance();
506
506
 
507
- void AiAssistanceModel.BuiltInAi.BuiltInAi.instance();
507
+ AiAssistanceModel.BuiltInAi.BuiltInAi.instance();
508
508
 
509
509
  new PauseListener();
510
510
 
@@ -717,7 +717,7 @@ export class MainImpl {
717
717
  // @ts-expect-error Used in ElementsTreeOutline
718
718
  eventCopy['original'] = event;
719
719
  const document = event.target && (event.target as HTMLElement).ownerDocument;
720
- const target = document ? Platform.DOMUtilities.deepActiveElement(document) : null;
720
+ const target = document ? UI.DOMUtilities.deepActiveElement(document) : null;
721
721
  if (target) {
722
722
  target.dispatchEvent(eventCopy);
723
723
  }
@@ -778,7 +778,7 @@ export class ZoomActionDelegate implements UI.ActionRegistration.ActionDelegate
778
778
  export class SearchActionDelegate implements UI.ActionRegistration.ActionDelegate {
779
779
  handleAction(_context: UI.Context.Context, actionId: string): boolean {
780
780
  let searchableView = UI.SearchableView.SearchableView.fromElement(
781
- Platform.DOMUtilities.deepActiveElement(document),
781
+ UI.DOMUtilities.deepActiveElement(document),
782
782
  );
783
783
  if (!searchableView) {
784
784
  const currentPanel = (UI.InspectorView.InspectorView.instance().currentPanelDeprecated() as UI.Panel.Panel);
@@ -9,8 +9,8 @@ import * as Bindings from '../models/bindings/bindings.js';
9
9
  import * as Workspace from '../models/workspace/workspace.js';
10
10
 
11
11
  export interface CreationOptions {
12
- // Settings things
13
12
  settingsCreationOptions: Common.Settings.SettingsCreationOptions;
13
+ overrideAutoStartModels?: Set<SDK.SDKModel.SDKModelConstructor>;
14
14
  }
15
15
 
16
16
  export class Universe {
@@ -24,7 +24,7 @@ export class Universe {
24
24
  ...options.settingsCreationOptions,
25
25
  });
26
26
 
27
- const targetManager = new SDK.TargetManager.TargetManager();
27
+ const targetManager = new SDK.TargetManager.TargetManager(options.overrideAutoStartModels);
28
28
  this.context.set(SDK.TargetManager.TargetManager, targetManager);
29
29
 
30
30
  const workspace = new Workspace.Workspace.WorkspaceImpl();