chrome-devtools-frontend 1.0.1662965 → 1.0.1664496

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 (273) hide show
  1. package/.agents/skills/{creating-a-model → devtools-model-management}/SKILL.md +0 -1
  2. package/.agents/skills/devtools-ux-writing-refactor/SKILL.md +2 -1
  3. package/.agents/skills/fixing-skipped-tests/SKILL.md +3 -3
  4. package/.agents/skills/merging-devtools-module/SKILL.md +1 -1
  5. package/.agents/skills/migrate-chromium-test/SKILL.md +3 -2
  6. package/.agents/skills/repro-flaky-tests/SKILL.md +71 -31
  7. package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +1 -0
  8. package/docs/ui_engineering.md +2 -0
  9. package/eslint.config.mjs +1 -0
  10. package/front_end/core/common/Settings.ts +75 -0
  11. package/front_end/core/protocol_client/PuppeteerDevToolsConnection.ts +112 -0
  12. package/front_end/core/sdk/CPUProfilerModel.ts +21 -13
  13. package/front_end/core/sdk/CSSContainerQuery.ts +1 -1
  14. package/front_end/core/sdk/CSSLayer.ts +1 -1
  15. package/front_end/core/sdk/CSSMedia.ts +1 -1
  16. package/front_end/core/sdk/CSSModel.ts +1 -1
  17. package/front_end/core/sdk/CSSNavigation.ts +1 -1
  18. package/front_end/core/sdk/CSSProperty.ts +1 -1
  19. package/front_end/core/sdk/CSSQuery.ts +1 -1
  20. package/front_end/core/sdk/CSSRule.ts +1 -1
  21. package/front_end/core/sdk/CSSScope.ts +1 -1
  22. package/front_end/core/sdk/CSSStartingStyle.ts +1 -1
  23. package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
  24. package/front_end/core/sdk/CSSStyleSheetHeader.ts +1 -1
  25. package/front_end/core/sdk/CSSSupports.ts +1 -1
  26. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +1 -1
  27. package/front_end/core/sdk/NetworkManager.ts +1 -1
  28. package/front_end/core/sdk/NetworkRequest.ts +7 -7
  29. package/front_end/core/sdk/Resource.ts +1 -1
  30. package/front_end/core/sdk/ScopeTreeCache.ts +1 -1
  31. package/front_end/core/sdk/Script.ts +1 -1
  32. package/front_end/core/sdk/ServerSentEvents.ts +1 -1
  33. package/front_end/core/sdk/SourceMap.ts +1 -1
  34. package/front_end/core/sdk/SourceMapScopesInfo.ts +1 -1
  35. package/front_end/core/sdk/sdk-meta.ts +3 -3
  36. package/front_end/{models → core}/text_utils/ContentProvider.ts +4 -6
  37. package/front_end/{models → core}/text_utils/StaticContentProvider.ts +4 -6
  38. package/front_end/{models → core}/text_utils/StreamingContentData.ts +1 -2
  39. package/front_end/{models → core}/text_utils/TextRange.ts +6 -3
  40. package/front_end/{models → core}/text_utils/TextUtils.ts +7 -7
  41. package/front_end/{models → core}/text_utils/WasmDisassembly.ts +2 -2
  42. package/front_end/core/text_utils/text_utils.ts +27 -0
  43. package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +1 -1
  44. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +1 -1
  45. package/front_end/entrypoints/main/MainImpl.ts +14 -1
  46. package/front_end/foundation/Universe.ts +1 -1
  47. package/front_end/models/ai_assistance/AgentProject.ts +1 -1
  48. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +3 -6
  49. package/front_end/models/ai_assistance/agents/AiAgent.ts +1 -1
  50. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +19 -11
  51. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
  52. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +23 -10
  53. package/front_end/models/ai_assistance/agents/StorageAgent.ts +19 -18
  54. package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -3
  55. package/front_end/models/ai_assistance/contexts/FileContext.ts +7 -3
  56. package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +39 -11
  57. package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +6 -3
  58. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +1 -1
  59. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +4 -4
  60. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +8 -8
  61. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +76 -3
  62. package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +11 -1
  63. package/front_end/models/badges/AiExplorerBadge.ts +8 -3
  64. package/front_end/models/badges/Badge.ts +1 -0
  65. package/front_end/models/badges/UserBadges.ts +11 -5
  66. package/front_end/models/bindings/CompilerScriptMapping.ts +1 -1
  67. package/front_end/models/bindings/ContentProviderBasedProject.ts +1 -1
  68. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +2 -2
  69. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -1
  70. package/front_end/models/bindings/DefaultScriptMapping.ts +1 -1
  71. package/front_end/models/bindings/FileUtils.ts +1 -1
  72. package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +7 -10
  73. package/front_end/models/bindings/ResourceMapping.ts +1 -1
  74. package/front_end/models/bindings/ResourceScriptMapping.ts +1 -1
  75. package/front_end/models/bindings/SASSSourceMapping.ts +1 -1
  76. package/front_end/models/bindings/StylesSourceMapping.ts +1 -1
  77. package/front_end/models/breakpoints/BreakpointManager.ts +1 -1
  78. package/front_end/models/crux-manager/CrUXManager.ts +1 -1
  79. package/front_end/models/emulation/EmulatedDevices.ts +3 -2
  80. package/front_end/models/har/Importer.ts +1 -1
  81. package/front_end/models/har/Writer.ts +1 -1
  82. package/front_end/models/issues_manager/IssueAggregator.ts +9 -0
  83. package/front_end/models/issues_manager/IssuesManager.ts +5 -0
  84. package/front_end/models/issues_manager/LazyLoadImageIssue.ts +76 -0
  85. package/front_end/models/issues_manager/descriptions/lazyLoadImageZeroSize.md +7 -0
  86. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  87. package/front_end/models/javascript_metadata/NativeFunctions.js +9 -10
  88. package/front_end/models/live-metrics/LiveMetrics.ts +2 -3
  89. package/front_end/models/logs/NetworkLog.ts +4 -3
  90. package/front_end/models/logs/logs-meta.ts +3 -3
  91. package/front_end/models/network_time_calculator/NetworkTimeCalculator.ts +4 -4
  92. package/front_end/models/persistence/Automapping.ts +1 -1
  93. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +2 -2
  94. package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +1 -1
  95. package/front_end/models/persistence/IsolatedFileSystem.ts +2 -2
  96. package/front_end/models/persistence/NetworkPersistenceManager.ts +1 -1
  97. package/front_end/models/persistence/PersistenceImpl.ts +1 -1
  98. package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
  99. package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +1 -1
  100. package/front_end/models/source_map_scopes/NamesResolver.ts +1 -1
  101. package/front_end/models/text_utils/text_utils.ts +2 -24
  102. package/front_end/models/trace/insights/ImageDelivery.ts +2 -2
  103. package/front_end/models/trace/insights/LegacyJavaScript.ts +1 -1
  104. package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
  105. package/front_end/models/trace/insights/ThirdParties.ts +1 -1
  106. package/front_end/models/workspace/FileManager.ts +1 -1
  107. package/front_end/models/workspace/UISourceCode.ts +1 -1
  108. package/front_end/models/workspace/WorkspaceImpl.ts +1 -1
  109. package/front_end/models/workspace_diff/WorkspaceDiff.ts +1 -1
  110. package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -1
  111. package/front_end/panels/accessibility/AccessibilityStrings.ts +2 -2
  112. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -1
  113. package/front_end/panels/ai_assistance/ExportConversation.ts +1 -1
  114. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +1 -1
  115. package/front_end/panels/ai_assistance/components/ChatMessage.ts +1 -1
  116. package/front_end/panels/application/AppManifestView.ts +4 -4
  117. package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -2
  118. package/front_end/panels/application/CrashReportContextView.ts +1 -1
  119. package/front_end/panels/application/DOMStorageItemsView.ts +1 -1
  120. package/front_end/panels/application/DeviceBoundSessionsView.ts +4 -4
  121. package/front_end/panels/application/ExtensionStorageItemsView.ts +1 -1
  122. package/front_end/panels/application/FrameDetailsView.ts +1 -1
  123. package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +12 -2
  124. package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
  125. package/front_end/panels/application/application.ts +2 -0
  126. package/front_end/panels/application/components/BackForwardCacheView.ts +21 -5
  127. package/front_end/panels/application/components/CrashReportContextGrid.ts +1 -1
  128. package/front_end/panels/application/components/TrustTokensView.ts +2 -2
  129. package/front_end/panels/application/preloading/PreloadingView.ts +1 -1
  130. package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +2 -2
  131. package/front_end/panels/application/preloading/components/PreloadingString.ts +2 -2
  132. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -4
  133. package/front_end/panels/autofill/AutofillView.ts +1 -1
  134. package/front_end/panels/common/AiCodeCompletionTeaser.ts +1 -1
  135. package/front_end/panels/common/ExtensionServer.ts +1 -1
  136. package/front_end/panels/console/ConsoleFilter.ts +1 -1
  137. package/front_end/panels/console/ConsoleSidebar.ts +1 -1
  138. package/front_end/panels/console/ConsoleView.ts +1 -1
  139. package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
  140. package/front_end/panels/console/PromptBuilder.ts +1 -1
  141. package/front_end/panels/coverage/CoverageDecorationManager.ts +9 -1
  142. package/front_end/panels/coverage/CoverageModel.ts +1 -1
  143. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +1 -1
  144. package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +1 -1
  145. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +1 -1
  146. package/front_end/panels/elements/AccessibilityTreeView.ts +38 -3
  147. package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +1 -1
  148. package/front_end/panels/elements/ElementIssueUtils.ts +2 -2
  149. package/front_end/panels/elements/ElementsTreeElement.ts +10 -3
  150. package/front_end/panels/elements/StandaloneStylesContainer.ts +1 -1
  151. package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
  152. package/front_end/panels/elements/StylePropertyTreeElement.ts +1 -1
  153. package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +1 -1
  154. package/front_end/panels/elements/StylesContainer.ts +1 -1
  155. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  156. package/front_end/panels/elements/components/CSSPropertyDocsView.ts +1 -1
  157. package/front_end/panels/explain/components/ConsoleInsight.ts +2 -2
  158. package/front_end/panels/issues/AffectedLazyLoadImagesView.ts +76 -0
  159. package/front_end/panels/issues/AffectedResourcesView.ts +1 -1
  160. package/front_end/panels/issues/CorsIssueDetailsView.ts +1 -1
  161. package/front_end/panels/issues/IssueView.ts +2 -0
  162. package/front_end/panels/issues/issues.ts +2 -0
  163. package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
  164. package/front_end/panels/lighthouse/LighthouseController.ts +5 -0
  165. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +1 -1
  166. package/front_end/panels/network/BinaryResourceView.ts +1 -1
  167. package/front_end/panels/network/NetworkDataGridNode.ts +29 -7
  168. package/front_end/panels/network/NetworkLogView.ts +1 -1
  169. package/front_end/panels/network/NetworkLogViewColumns.ts +6 -6
  170. package/front_end/panels/network/NetworkPanel.ts +4 -4
  171. package/front_end/panels/network/NetworkSearchScope.ts +1 -1
  172. package/front_end/panels/network/RequestConditionsDrawer.ts +1 -1
  173. package/front_end/panels/network/RequestHTMLView.ts +1 -1
  174. package/front_end/panels/network/RequestPayloadView.ts +1 -1
  175. package/front_end/panels/network/RequestPreviewView.ts +1 -1
  176. package/front_end/panels/network/RequestResponseView.ts +1 -1
  177. package/front_end/panels/network/ResourceChunkView.ts +1 -1
  178. package/front_end/panels/network/ResourceDirectSocketChunkView.ts +1 -1
  179. package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -1
  180. package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -1
  181. package/front_end/panels/network/forward/UIRequestLocation.ts +1 -1
  182. package/front_end/panels/network/network-meta.ts +3 -3
  183. package/front_end/panels/profiler/HeapProfileView.ts +6 -6
  184. package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
  185. package/front_end/panels/profiler/ProfileDataGrid.ts +12 -8
  186. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -1
  187. package/front_end/panels/recorder/RecorderPanel.ts +493 -381
  188. package/front_end/panels/recorder/RecordingListView.ts +8 -37
  189. package/front_end/panels/recorder/RecordingView.ts +54 -27
  190. package/front_end/panels/recorder/SelectorPicker.ts +0 -13
  191. package/front_end/panels/recorder/StepEditor.ts +6 -14
  192. package/front_end/panels/recorder/StepView.ts +36 -105
  193. package/front_end/panels/search/SearchResultsPane.ts +1 -1
  194. package/front_end/panels/security/SecurityPanel.ts +3 -3
  195. package/front_end/panels/settings/AISettingsTab.ts +4 -4
  196. package/front_end/panels/settings/components/SyncSection.ts +4 -4
  197. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +3 -3
  198. package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
  199. package/front_end/panels/sources/BreakpointsView.ts +1 -1
  200. package/front_end/panels/sources/CoveragePlugin.ts +1 -1
  201. package/front_end/panels/sources/DebuggerPlugin.ts +4 -4
  202. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +27 -3
  203. package/front_end/panels/sources/NavigatorView.ts +1 -1
  204. package/front_end/panels/sources/PersistenceActions.ts +1 -1
  205. package/front_end/panels/sources/SourcesNavigator.ts +1 -1
  206. package/front_end/panels/sources/SourcesSearchScope.ts +1 -1
  207. package/front_end/panels/sources/TabbedEditorContainer.ts +3 -3
  208. package/front_end/panels/sources/UISourceCodeFrame.ts +1 -1
  209. package/front_end/panels/sources/components/HeadersView.ts +1 -1
  210. package/front_end/panels/sources/filteredUISourceCodeListProvider.css +12 -1
  211. package/front_end/panels/sources/sources-meta.ts +1 -1
  212. package/front_end/panels/timeline/StatusDialog.ts +1 -1
  213. package/front_end/panels/timeline/TimelineController.ts +24 -3
  214. package/front_end/panels/timeline/TimelinePanel.ts +116 -25
  215. package/front_end/panels/timeline/TimelineSelectorStatsView.ts +2 -2
  216. package/front_end/panels/timeline/TimelineUIUtils.ts +1 -1
  217. package/front_end/panels/timeline/components/CWVMetrics.ts +1 -1
  218. package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -1
  219. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -2
  220. package/front_end/panels/timeline/timeline-meta.ts +13 -0
  221. package/front_end/services/tracing/TracingManager.ts +27 -2
  222. package/front_end/third_party/chromium/README.chromium +1 -1
  223. package/front_end/third_party/lighthouse/README.chromium +2 -2
  224. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1418 -1413
  225. package/front_end/third_party/lighthouse/locales/en-US.json +12 -6
  226. package/front_end/third_party/lighthouse/locales/en-XL.json +12 -6
  227. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
  228. package/front_end/third_party/puppeteer/puppeteer.ts +20 -1
  229. package/front_end/ui/components/highlighting/HighlightElement.ts +4 -1
  230. package/front_end/ui/components/highlighting/HighlightManager.ts +1 -1
  231. package/front_end/ui/components/highlighting/MarkupHighlight.ts +1 -1
  232. package/front_end/ui/components/markdown_view/MarkdownView.ts +46 -2
  233. package/front_end/ui/components/markdown_view/markdownView.css +23 -0
  234. package/front_end/ui/components/text_editor/config.ts +1 -1
  235. package/front_end/ui/components/tree_outline/TreeOutline.ts +7 -1
  236. package/front_end/ui/legacy/Infobar.ts +1 -1
  237. package/front_end/ui/legacy/InspectorView.ts +12 -7
  238. package/front_end/ui/legacy/SuggestBox.ts +1 -1
  239. package/front_end/ui/legacy/TextPrompt.ts +1 -1
  240. package/front_end/ui/legacy/Toolbar.ts +5 -2
  241. package/front_end/ui/legacy/Treeoutline.ts +26 -7
  242. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +1 -1
  243. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +1 -1
  244. package/front_end/ui/legacy/components/data_grid/ViewportDataGrid.ts +1 -1
  245. package/front_end/ui/legacy/components/data_grid/dataGrid.css +1 -1
  246. package/front_end/ui/legacy/components/inline_editor/AnimationTimingUI.ts +27 -13
  247. package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +5 -2
  248. package/front_end/ui/legacy/components/inline_editor/CSSLinearEasingModel.ts +23 -0
  249. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +161 -54
  250. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -1
  251. package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +1 -1
  252. package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -1
  253. package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -1
  254. package/front_end/ui/legacy/components/source_frame/JSONView.ts +105 -115
  255. package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +1 -1
  256. package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +1 -1
  257. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -3
  258. package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +1 -1
  259. package/front_end/ui/legacy/components/source_frame/XMLView.ts +5 -1
  260. package/front_end/ui/legacy/components/source_frame/jsonView.css +4 -0
  261. package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
  262. package/front_end/ui/legacy/inspectorCommon.css +6 -2
  263. package/front_end/ui/settings/SettingUIRegistration.ts +105 -0
  264. package/front_end/ui/settings/settings.ts +9 -0
  265. package/front_end/ui/visual_logging/KnownContextValues.ts +13 -0
  266. package/mcp/mcp.ts +1 -0
  267. package/package.json +1 -1
  268. /package/.agents/skills/{verification → devtools-verification}/SKILL.md +0 -0
  269. /package/front_end/{models → core}/text_utils/CodeMirrorUtils.ts +0 -0
  270. /package/front_end/{models → core}/text_utils/ContentData.ts +0 -0
  271. /package/front_end/{models → core}/text_utils/Text.ts +0 -0
  272. /package/front_end/{models → core}/text_utils/TextCursor.ts +0 -0
  273. /package/front_end/{models → core}/text_utils/TextUtils.snapshot.txt +0 -0
@@ -1,4 +1,3 @@
1
- ```
2
1
  ---
3
2
  name: devtools-model-management
4
3
  description: Guidelines for creating, migrating, and registering models in front_end/models/. Covers BUILD.gn, devtools_grd_files.gni, and entrypoints.
@@ -52,7 +52,7 @@ Locate all TypeScript files in the target folder that define `const UIStrings =
52
52
  * *Check sibling references:* If you change a setting name or label (for example, changing “Preserve log” to “Keep log”), search sibling files in the folder for explanatory text or status strings that reference the old name in quotes (for example, “console.clear() was prevented due to ‘Preserve log’”), and update them to match.
53
53
  2. **Cut unnecessary words:** Eliminate politeness (`please`, `sorry`), filler (`very`, `strongly`, `there is` or `there are`), and marketing fluff (`seamless`, `awesome`, `fast`, `quick`).
54
54
  3. **Contractions:** Use contractions (`don’t`, `can’t`, `isn’t`, `won’t`) instead of formal spellings (`do not`, `cannot`, `is not`, `will not`).
55
- 4. **Curly apostrophes, quotation marks, and ellipses:** Use curly apostrophes (`’`) and quotation marks (`“ ”`) for improved readability. Use the ellipsis character (`…`) instead of three periods (`...`). Use prime (`′`) and double prime (`″`) symbols as needed for measurements like length or coordinates.
55
+ 4. **Curly apostrophes, quotation marks, and ellipses:** Use curly apostrophes (`’`) in user-facing `UIStrings` values for contractions and possessives, and quotation marks (`“ ”`) for improved readability. Use the ellipsis character (`…`) instead of three periods (`...`). Use prime (`′`) and double prime (`″`) symbols as needed for measurements like length or coordinates.
56
56
  5. **Sentence case and capitalization:** Use sentence case for headings, labels, and UI element names. Capitalize only the first word, proper nouns, product names (`Chrome DevTools`), and web APIs (`Background Fetch API`).
57
57
  * Don’t capitalize feature names (for example, `conditional breakpoint` or `command menu`).
58
58
  * Capitalize panel names and UX elements that are named after panels (for example, `Show Application`, `Toggle Console`, `Console sidebar`, or `Styles`).
@@ -62,6 +62,7 @@ Locate all TypeScript files in the target folder that define `const UIStrings =
62
62
  6. **Punctuation and actionability:** Remove trailing periods from single-sentence labels or titles. Ensure that error messages instruct the user how to recover (for example, `Shorten filename to 64 characters or less` instead of `Invalid filename`). Ensure that ARIA labels and multi-sentence tooltips have consistent terminal punctuation.
63
63
  7. **Terminology (glossary):** Strictly follow standard DevTools UI terminology and letter casing (`panel`, `tab`, `drawer`, `sidebar`, `datagrid` or `table`, `action bar`, `status bar`, and `live expressions section`). Never use `pane` or call tabs `panes` in UI strings or localization (L10n) comments.
64
64
  8. **Localization (L10n) comments:** Ensure that every string in `UIStrings` has a preceding `@description` comment that explains where and when it appears. This information is used for translators who need to understand the context in which the string is used.
65
+ * **Straight apostrophes in comments:** Always use straight apostrophes (`'`) in code comments (such as `@description` comments and L10n annotations), even if the UI string itself uses curly apostrophes (`’`).
65
66
  * Use precise terminology and correct letter casing (see rule 7). Ensure that the description is easy to understand and provides enough context for translators. For descriptions that are underspecified or
66
67
  ambiguous, figure out the context by looking at the use site of the
67
68
  string and come up with a better description.
@@ -20,10 +20,10 @@ This skill outlines the workflow for fixing skipped tests in the DevTools codeba
20
20
  - You should look for occurrences like `it.skip('[crbug.com/<bugid>] ...', ...)` or skipped describes that mention the bug ID.
21
21
 
22
22
  4. **Iterative Fix Process**
23
- - **Step 1:** Change `it.skip` or `describe.skip` to `it.only` or `describe.only` for *one* of the tests associated with the bug, so that only that specific test runs.
24
- - **Step 2:** Re-run the tests (e.g., `npm run test -- <path_to_test_file>`) using the guidelines from the `devtools-verification` skill. If you are dealing with flaky tests, you can use the `--repeat=x` flag (e.g. `npm run test -- <path_to_test_file> --repeat=20`) to run the test multiple times to reproduce the flakiness.
23
+ - **Step 1:** Remove `it.skip` or `describe.skip` for *one* of the tests associated with the bug.
24
+ - **Step 2:** Re-run the specific test using its exact test ID (e.g., `npm run test path/to/foo.test.ts:test_name`) using the guidelines from the `devtools-verification` skill. If you are dealing with flaky tests, you can use the `--repeat=x` flag (e.g. `npm run test -- --repeat=20 path/to/foo.test.ts:test_name`) to run the test multiple times to reproduce the flakiness. This flag works for both E2E and unit tests.
25
25
  - **Step 3:** Analyze the test failure and make the necessary fixes to the code or the test itself.
26
- - **Step 4:** Re-run the test to ensure the fix is correct. Remove `.only`.
26
+ - **Step 4:** Re-run the test to ensure the fix is correct.
27
27
  - **Step 5:** Remove the `[crbug.com/<bugid>]` prefix from the test name string if it is present.
28
28
  - **Step 6:** Remove any comments directly above the test that explain the reason why the test was skipped (e.g., `// TODO(crbug...): Flaky`).
29
29
  - **Step 7:** Apply the fix to the remaining tests, un-skipping them one by one or in batches, and verifying until all are passing.
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: devtools-module-merging
2
+ name: merging-devtools-module
3
3
  description: Workflow for merging a DevTools submodule into its parent module. Covers BUILD.gn consolidation and updating devtools_grd_files.gni.
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: devtools-migrate-chromium-test
2
+ name: migrate-chromium-test
3
3
  description: Use when migrating Chromium layout tests to DevTools unit tests
4
4
  ---
5
5
 
@@ -26,6 +26,7 @@ description: Use when migrating Chromium layout tests to DevTools unit tests
26
26
  - If tests require a repetitive setup extract it into a test helper function at the top of the file.
27
27
  - Code comments must be full sentences ending with a period, except when the entire comment is a URL.
28
28
  - Do not include comments of the form `// Replaces web test: http/tests/devtools/persistence/automapping-absolute-paths.js`. Since we plan to remove migrated web tests, these are not useful references.
29
+ - **Important** If the test imports only `TestRunner` and no other TestRunner helper or DevTools code. The test should be move to the inspector-protocol test, and the issue should be closed as "Won't Fix (Infeasible)" and add the issue to the hotlist with ID 8691563.
29
30
 
30
31
  4. **Update BUILD.gn**:
31
32
 
@@ -40,7 +41,7 @@ description: Use when migrating Chromium layout tests to DevTools unit tests
40
41
 
41
42
  - Critically review the newly created test to ensure it provides meaningful coverage. Cross-reference it with the original Chromium layout test to verify that all original behaviors, edge cases, and assertions have been fully migrated and are actively being tested.
42
43
  - If the newly added test does not test any logic from the component but just the getters from the mocked data explain to the user that this test does not add value and it's better to close it without adding the test. Provide a command without executing it to close the issue as "Fixed".
43
- - If the newly added test uses too extensive mocks of CDP objects and methods explain to the user that the test should be foundation e2e test instead of unit test and we won't migrate it. Provide a command without executing it to close the issue as "Won't Fix (Infeasible)".
44
+ - If the newly added test uses too extensive mocks of CDP objects and methods explain to the user that the test should be foundation e2e test instead of unit test and we won't migrate it. **CRITICAL** upload a comment to the issue with your investigation and the reason why you won't submit a CL and close the issue as "Won't Fix (Infeasible)" and add the issue to the hotlist with ID 8687901.
44
45
 
45
46
  7. **Upload the CL:**
46
47
 
@@ -1,53 +1,93 @@
1
1
  ---
2
- name: repro-flaky-test
2
+ name: repro-flaky-tests
3
3
  description: Reproduce and investigate flakiness in a test.
4
4
  ---
5
5
 
6
- # Fixing flaky Tests
6
+ # Workflow
7
7
 
8
- This skill outlines the workflow for reproducing and fixing a flaky test in the DevTools codebase.
9
-
10
- ## Workflow
8
+ This skill outlines the workflow for reproducing and fixing a flaky test in the DevTools codebase. The work should be divided into sub-agents that should only be started when certain criteria are met.
11
9
 
12
10
  - You will be given as input, either a Chromium bug link (e.g. `crbug.com/1234567`), or a name of a test file and (optionally) the test name.
13
11
  - For example: e2e/extensions/debugger-language-plugins.test.ts and "The Debugger Language Plugins/shows sensible error messages".
14
- - If nothing is provided, as the user which test you should run.
15
- - Find the test in the codebase and look at its implementation.
16
- - Run the test three times to note how long the test runs (on average) per minute.
12
+ - If nothing is provided, ask the user which test you should run.
13
+ - Before starting the sub-agents, explain the workflow. For example:
14
+
15
+ ```
16
+ I will attempt to reproduce the flakiness (simultaneously) locally and using the 'stressor bots'. Once issues are discovered, I will attempt to fix them.
17
+ ```
17
18
 
18
- ## Reproduction
19
+ ## Reproduction agents
19
20
 
20
- - Run the test enough times for a full test run to take one minute. For example, if a test takes a second to run, set it to repeat 60 times. If a test takes 5 seconds to run, run it 12 times.
21
- - Start with one minute and, if the failure does not repeat, try again and increase the time by a minute (up to a maximum of 5 minutes per run).
22
- - Use `npm run test -- path/to/foo.test.ts --grep "<test name>" --repeat <count>` to run the tests repeatedly.
23
- - Be sure to keep track of the cumulative count of how often you run the test and how often they fail, so that you can calculate a 'flaky percentage' before and after making a fix.
21
+ First, create and start two sub-agents simultaneously. One called 'local-repro' (that should attempt to reproduce the problem locally) and one called 'bot-repro' (that attempts to use the stressor bots to reproduce).
24
22
 
25
- After every round, display the *cumulative* results in a table:
23
+ ### Local reproduction (local-repro)
24
+
25
+ - Use command: `npm run test -- --repeat=<count> path/to/foo.test.ts:exact_test_id` to locally run the tests repeatedly. Both E2E and unit tests support this. Use the exact test ID printed in the test runner output (usually the suite and test names with spaces replaced by underscores). Do not use `--grep` or a `bash` script with a `for` loop.
26
+ - First run the test three times to note how long the test runs (on average).
27
+ - Then run the test continuously for 4 minutes, while noting any failures and failure rates. If the failure rate is still 0% after that, assume the problem does not reproduce locally.
28
+ - After the local test run completes, then show the results in a table. For example:
26
29
 
27
30
  ```
28
- Test: Runs Time Failures
29
- "Recorder/should be able to start a replay..." 30 60s 0 (0.00%)
30
- "The Debugger Language Plugins/shows sensible..." 60 60s 1 (1.67%)
31
+ Test: Runs Sec Failures
32
+ "Recorder/should be able to start a replay..." 30 180 0 (0.00%)
33
+ "The Debugger Language Plugins/shows sensible..." 60 180 1 (1.67%)
31
34
  ```
32
35
 
33
- Once you have one or more failures, show the error message and ask the user if they want to:
36
+ If problems were detected, list the different problems found and how often they occurred. Ask the user if the errors match the ones they are trying to get rid of.
34
37
 
35
- 1) Start investigating the test failures.
36
- 2) Continue running all the tests.
37
- 3) Run only the failed tests (to get a clearer indication of their failure rate).
38
- 4) Run only the tests that haven't failed (to attempt to get a reproduction).
38
+ ### Bot reproduction agent (bot-repro)
39
39
 
40
- ## Investigation
40
+ The second bot should do the following:
41
41
 
42
- - Create a branch flaky_tests and append a datestamp, such as _2026_07_04_14h16m.
42
+ - Create a branch with a meaningful name, such as `deflake_<test_name>`.
43
43
  - Ensure you use the instructions from the `devtools-version-control` skill to create and switch branches appropriately.
44
- - Investigate each test failure and propose a fix.
45
- - Don't commit the changes to the branch.
44
+ - Make a minor, harmless modification directly to the test file being investigated (e.g., adding a comment `// Trigger stressor bot`) to ensure the commit is not empty.
45
+ - Add this file (with `git add`) and commit it using a meaningful commit message (e.g., `git commit -m "Deflake <test name>"`). Ask the user which bug number to use for the changelist description.
46
+ - Upload this change using `git cl upload`. This creates a debugging CL that all agents (like the fix agent) will continue to work on.
47
+ - Note the <issue number> created during upload.
48
+ - To start the stressor bot, run this command (substituting `<test file>:exact_test_id` with the actual file and exact test ID):
49
+ `git cl try -B devtools-frontend/try -b e2e_stressor_linux -b e2e_stressor_win64 -b e2e_stressor_mac -p runner_args='<test file>:exact_test_id --repeat=100'`
50
+ - **Note on Screenshot Tests:** If the test involves screenshot assertions (`assertScreenshot`), it should ONLY be run on the Linux stressor bot (`-b e2e_stressor_linux`), because screenshot assertions are not supported on Mac or Windows. Furthermore, they cannot be reproduced locally on a Mac.
51
+ - **Auth Issues:** If `git cl try` fails with a login error (e.g., `Login required: run bb auth-login`), inform the user so they can resolve the auth issue and ask you to retry.
52
+
53
+ - Note that the test file name needs to be relative to the root, so use `test/e2e/foo.test.ts` instead of `e2e/foo.test.ts`.
54
+ - Check the results of the stressor tests with `git cl try-results --issue=<issue number> --patchset=<patchset number>`. You can dive into each result by id using `bb get <id>`.
55
+ - Once a test run completes, always report to the user how often the tests ran and what the failure rate was.
56
+ - Critical: Make sure that at least one test ran to completion on the bot (to catch incorrect syntax for `git cl try` or incorrect test IDs).
57
+
58
+ ## Next steps
59
+
60
+ - Monitor the results of the two agents. The local reproduction bot will likely finish sooner.
61
+ - If it does but doesn't reproduced the failure, ask the user this question:
62
+
63
+ ```
64
+ While we wait for the bots to complete their run, would you like to:
65
+
66
+ 1) Continue trying to reproduce locally
67
+ 2) Start investigating the test
68
+ ```
69
+
70
+ If they opt for investigating the test, start a new agent called 'fix-test'.
71
+
72
+ ### Fixing the test (fix-test)
73
+
74
+ The test fixing sub-agent should do the following:
75
+
76
+ - Find the test in the codebase and look at its implementation. Look at the relevant production code that is being testing.
77
+ - Look at the failures reproduced in the test (if any) by prior sub-agents.
78
+ - Suggest a fix for the failure(s).
79
+ - IMPORTANT: Ensure any dummy comments added earlier to trigger the stressor bot are removed before finalizing the fix.
80
+ - Run the full verification process (TypeScript checks, and linters) as required by the repository best practices.
81
+ - Compile and run the test locally, to make sure there are no obvious errors introduced.
82
+ - Commit the changes (to the branch created earlier). Make sure to list (in the changelist description) the test name, the fix, reasoning for why the test failed, why the fix fixes the issue and the failure rate (if non-zero). If you were not able to reproduce the error, state that the fix is speculative. Ask the user to provide the bug number to use in the changelist description.
83
+ - CRITICAL: Iff the 'local-repro' bot does not reproduce the error, the 'fix-test' agent MUST wait until the stressor bot finishes its run before uploading the fix to the server (so that the stressor try run isn't aborted prematurely). If the error reproduces locally, you can upload immediately.
84
+ - Once it is safe to do so, upload the change with `git cl upload`.
46
85
 
47
86
  ## Results
48
87
 
49
- - Before finishing, run the full verification process (TypeScript checks, and linters) as required by the repository best practices.
50
- - Request to run the test again for as long as you think it would take to be sure the problem is gone, but get permission from the user before starting very long runs (anything over 4 minutes).
51
- - For things that have a 33% failure rate before fixing (for example), only a handful of runs are needed to verify, but tests with lower failure rate need more.
52
- - NOTE: If the test fails again with the same error as before, you don't need to finish the test run but instead you should augment or replace your fix with a better one.
53
- - At the end, list the tests, state briefly why each test was failing and how the fix addresses the issue along with the failure rate before and after.
88
+ - Always verify, by running the tests again that the problem has been fixed.
89
+ - If the problem reproduces locally during your initially attempt, then always prefer a local reproduction run (don't use the bots).
90
+ - But if the problem doesn't reproduce locally, always prefer the bot-repro but run the test locally (once only per fix) to verify the fix compiles and doesn't introduce a regression..
91
+ - For things that have (let's say) a 33% failure rate before fixing (for example), a smaller amount of run is needed to verify, than for tests with lower failure rate.
92
+ - CRITICAL: If the test fails again with the same error as before (or a new error), it is clear that the fix is not working and a new fix must be implemented (repeat the verification cycle).
93
+ - Upon completion, list the tests, state briefly why each test was failing and how the fix addresses the issue along with the failure rate before and after.
@@ -21,6 +21,7 @@ clean `UI.Widget` classes that use native update rendering delegates.
21
21
  * Clean up and remove older constructors that perform custom container
22
22
  initializations or access `.element` directly for manual append
23
23
  operations.
24
+ * Note that `VBox` and `HBox` inherit directly from `Widget`. They fully support view injection (`view = DEFAULT_VIEW`), `performUpdate()`, and `requestUpdate()` without modification.
24
25
 
25
26
  2. **Upgrade View Delegates & Inject View**:
26
27
 
@@ -34,6 +34,8 @@ This approach has two main benefits:
34
34
  1. **Testability**: In unit tests, we can pass a simple stub as the view function, which allows us to test the presenter's logic without any DOM manipulation.
35
35
  2. **Clarity**: It cleanly separates the presenter's logic from its rendering logic.
36
36
 
37
+ Note that `VBox` and `HBox` inherit directly from `Widget`. They fully support view injection (`view = DEFAULT_VIEW`), `performUpdate()`, and `requestUpdate()` without modification.
38
+
37
39
  To test the `DEFAULT_VIEW` function itself, we should use screenshot and e2e tests.
38
40
 
39
41
  ## Declarative and orchestrated DOM updates
package/eslint.config.mjs CHANGED
@@ -624,6 +624,7 @@ export default defineConfig([
624
624
  '@devtools/l10n-no-locked-or-placeholder-only-phrase': 'error',
625
625
  '@devtools/l10n-no-uistrings-export': 'error',
626
626
  '@devtools/l10n-no-unused-message': 'error',
627
+ '@devtools/l10n-use-curly-apostrophes': 'error',
627
628
  },
628
629
  },
629
630
  {
@@ -102,6 +102,8 @@ export interface SettingsCreationOptions {
102
102
  console: Console;
103
103
  }
104
104
 
105
+ type NoFunction<T> = T extends(...args: never[]) => unknown ? never : T;
106
+
105
107
  export class Settings {
106
108
  readonly syncedStorage: SettingsStorage;
107
109
  readonly globalStorage: SettingsStorage;
@@ -323,6 +325,70 @@ export class Settings {
323
325
  getRegistry(): Map<string, Setting<unknown>> {
324
326
  return this.#registry;
325
327
  }
328
+
329
+ /**
330
+ * Resolves a setting descriptor to a concrete {@link Setting} instance.
331
+ *
332
+ * If a setting with the same name already exists (either pre-registered or
333
+ * previously resolved), that instance is returned. Otherwise, a new setting
334
+ * is created and registered.
335
+ *
336
+ * @param descriptor The descriptor defining the setting. Must not be conditional.
337
+ * @throws If the descriptor is conditional (contains `isAvailable`). Use `maybeResolve` instead.
338
+ */
339
+ resolve<T>(descriptor: SettingDescriptor<NoFunction<T>>&{isAvailable?: never}): Setting<T> {
340
+ if ('isAvailable' in descriptor) {
341
+ // TS can only do so much if developers downcast explicitly.
342
+ throw new Error('Use Settings#maybeResolve for conditional descriptors.');
343
+ }
344
+
345
+ return this.#resolve(descriptor);
346
+ }
347
+
348
+ #resolve<T>(descriptor: SettingDescriptor<T>): Setting<T> {
349
+ let setting = this.moduleSettings.get(descriptor.name);
350
+ if (setting) {
351
+ return setting as Setting<T>;
352
+ }
353
+
354
+ const {name, type, defaultValue, storageType} = descriptor;
355
+ const isRegex = type === SettingType.REGEX;
356
+
357
+ const isGetter =
358
+ (value: T|((config: Root.Runtime.HostConfig) => T)): value is((config: Root.Runtime.HostConfig) => T) =>
359
+ typeof value === 'function';
360
+
361
+ const evaluatedDefaultValue = isGetter(defaultValue) ? defaultValue(Root.Runtime.hostConfig) : defaultValue;
362
+ setting = isRegex && typeof evaluatedDefaultValue === 'string' ?
363
+ this.createRegExpSetting(name, evaluatedDefaultValue, undefined, storageType) :
364
+ this.createSetting(name, evaluatedDefaultValue, storageType);
365
+
366
+ this.registerModuleSetting(setting);
367
+ return setting as Setting<T>;
368
+ }
369
+
370
+ /**
371
+ * Resolves a conditional setting descriptor to a concrete {@link Setting} instance if it is available.
372
+ *
373
+ * This method checks the availability of the setting using the descriptor's `isAvailable` function
374
+ * and the current `hostConfig`. If available, it resolves and returns the setting (caching it if
375
+ * necessary). If not available (either unavailable or disabled), it returns the availability status
376
+ * and the reason.
377
+ *
378
+ * @param descriptor The conditional descriptor defining the setting.
379
+ * @returns An object with either the resolved `setting` or the availability `status` and `reason`.
380
+ */
381
+ maybeResolve<T, R>(descriptor: ConditionalSettingDescriptor<NoFunction<T>, R>): {setting: Setting<T>}|{
382
+ status: SettingAvailability.UNAVAILABLE|SettingAvailability.DISABLED, reason: R,
383
+ }
384
+ {
385
+ const available = descriptor.isAvailable(Root.Runtime.hostConfig);
386
+ if (available.status === SettingAvailability.AVAILABLE) {
387
+ return {setting: this.#resolve(descriptor)};
388
+ }
389
+
390
+ return available;
391
+ }
326
392
  }
327
393
 
328
394
  export interface SettingsBackingStore {
@@ -471,6 +537,15 @@ export class Setting<V> {
471
537
  this.#serializer = serializer;
472
538
  }
473
539
 
540
+ descriptor(): SettingDescriptor<V> {
541
+ return {
542
+ name: this.name,
543
+ type: this.type() ?? SettingType.BOOLEAN,
544
+ defaultValue: this.defaultValue,
545
+ storageType: this.#registration?.storageType,
546
+ };
547
+ }
548
+
474
549
  addChangeListener(listener: (arg0: EventTargetEvent<V>) => void, thisObject?: Object): EventDescriptor {
475
550
  return this.eventSupport.addEventListener(this.name, listener, thisObject);
476
551
  }
@@ -0,0 +1,112 @@
1
+ // Copyright 2026 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import type * as Puppeteer from '../../third_party/puppeteer/puppeteer.js';
6
+
7
+ import type * as CDPConnection from './CDPConnection.js';
8
+
9
+ // Hardcoded string literals corresponding to Puppeteer's CDPSessionEvent.SessionAttached ('sessionattached')
10
+ // and CDPSessionEvent.SessionDetached ('sessiondetached'). We redeclare these strings directly so we can use
11
+ // `import type * as Puppeteer` and avoid importing Puppeteer runtime JavaScript.
12
+ const SESSION_ATTACHED: Puppeteer.CDPSessionEventSessionAttached = 'sessionattached';
13
+ const SESSION_DETACHED: Puppeteer.CDPSessionEventSessionDetached = 'sessiondetached';
14
+
15
+ /**
16
+ * This class makes a puppeteer connection look like DevTools CDPConnection.
17
+ *
18
+ * Since we connect "root" DevTools targets to specific pages, we scope everything to a puppeteer CDP session.
19
+ *
20
+ * We don't have to recursively listen for 'sessionattached' as the "root" CDP session sees all child session attached
21
+ * events, regardless how deeply nested they are.
22
+ */
23
+ export class PuppeteerDevToolsConnection implements CDPConnection.CDPConnection {
24
+ readonly #connection: Puppeteer.Connection;
25
+ readonly #observers = new Set<CDPConnection.CDPConnectionObserver>();
26
+ readonly #sessionEventHandlers = new Map<string, Puppeteer.Handler<unknown>>();
27
+
28
+ constructor(session: Puppeteer.CDPSession) {
29
+ const connection = session.connection();
30
+ if (!connection) {
31
+ throw new Error('CDPSession has no connection');
32
+ }
33
+ this.#connection = connection;
34
+
35
+ session.on(
36
+ SESSION_ATTACHED,
37
+ this.#startForwardingCdpEvents.bind(this) as Puppeteer.Handler<unknown>,
38
+ );
39
+ session.on(
40
+ SESSION_DETACHED,
41
+ this.#stopForwardingCdpEvents.bind(this) as Puppeteer.Handler<unknown>,
42
+ );
43
+
44
+ this.#startForwardingCdpEvents(session);
45
+ }
46
+
47
+ send<T extends CDPConnection.Command>(
48
+ method: T,
49
+ params: CDPConnection.CommandParams<T>,
50
+ sessionId: string|undefined,
51
+ ): Promise<|{result: CDPConnection.CommandResult<T>}|{error: CDPConnection.CDPError}> {
52
+ if (sessionId === undefined) {
53
+ throw new Error(
54
+ 'Attempting to send on the root session. This must not happen',
55
+ );
56
+ }
57
+ const session = this.#connection.session(sessionId);
58
+ if (!session) {
59
+ throw new Error('Unknown session ' + sessionId);
60
+ }
61
+ /* eslint-disable @typescript-eslint/no-explicit-any */
62
+ return session.send(method as any, params).then(result => ({result})).catch(error => ({
63
+ error: {
64
+ code: (error as any).code ?? -32000,
65
+ message: (error as any).message ||
66
+ String(error),
67
+ },
68
+ })) as any;
69
+ /* eslint-enable @typescript-eslint/no-explicit-any */
70
+ }
71
+
72
+ observe(observer: CDPConnection.CDPConnectionObserver): void {
73
+ this.#observers.add(observer);
74
+ }
75
+
76
+ unobserve(observer: CDPConnection.CDPConnectionObserver): void {
77
+ this.#observers.delete(observer);
78
+ }
79
+
80
+ #startForwardingCdpEvents(session: Puppeteer.CDPSession): void {
81
+ const handler = this.#handleEvent.bind(
82
+ this,
83
+ session.id(),
84
+ ) as Puppeteer.Handler<unknown>;
85
+ this.#sessionEventHandlers.set(session.id(), handler);
86
+ session.on('*', handler);
87
+ }
88
+
89
+ #stopForwardingCdpEvents(session: Puppeteer.CDPSession): void {
90
+ const handler = this.#sessionEventHandlers.get(session.id());
91
+ if (handler) {
92
+ session.off('*', handler);
93
+ this.#sessionEventHandlers.delete(session.id());
94
+ }
95
+ }
96
+
97
+ #handleEvent(
98
+ sessionId: string,
99
+ type: string|symbol|number,
100
+ event: unknown,
101
+ ): void {
102
+ if (typeof type === 'string' && type !== SESSION_ATTACHED && type !== SESSION_DETACHED) {
103
+ this.#observers.forEach(
104
+ observer => observer.onEvent({
105
+ method: type as CDPConnection.Event,
106
+ sessionId,
107
+ params: event as CDPConnection.EventParams<CDPConnection.Event>,
108
+ }),
109
+ );
110
+ }
111
+ }
112
+ }
@@ -23,11 +23,10 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
23
23
 
24
24
  export class CPUProfilerModel extends SDKModel<EventTypes> implements ProtocolProxyApi.ProfilerDispatcher {
25
25
  #nextAnonymousConsoleProfileNumber: number;
26
- #anonymousConsoleProfileIdToTitle: Map<string, string>;
26
+ readonly #anonymousConsoleProfileIdToTitle: Map<string, string>;
27
27
  readonly #profilerAgent: ProtocolProxyApi.ProfilerApi;
28
28
  #preciseCoverageDeltaUpdateCallback: ((arg0: number, arg2: Protocol.Profiler.ScriptCoverage[]) => Promise<void>)|null;
29
29
  readonly #debuggerModel: DebuggerModel;
30
- readonly registeredConsoleProfileMessages: ProfileFinishedData[] = [];
31
30
 
32
31
  constructor(target: Target) {
33
32
  super(target);
@@ -62,11 +61,7 @@ export class CPUProfilerModel extends SDKModel<EventTypes> implements ProtocolPr
62
61
  title = this.#anonymousConsoleProfileIdToTitle.get(id);
63
62
  this.#anonymousConsoleProfileIdToTitle.delete(id);
64
63
  }
65
- const eventData: ProfileFinishedData = {
66
- ...this.createEventDataFrom(id, location, title),
67
- cpuProfile: profile,
68
- };
69
- this.registeredConsoleProfileMessages.push(eventData);
64
+ const eventData = new ProfileFinishedData(this.createEventDataFrom(id, location, title), profile);
70
65
  this.dispatchEventToListeners(Events.CONSOLE_PROFILE_FINISHED, eventData);
71
66
  }
72
67
 
@@ -91,10 +86,10 @@ export class CPUProfilerModel extends SDKModel<EventTypes> implements ProtocolPr
91
86
  return this.#profilerAgent.invoke_stop().then(response => response.profile || null);
92
87
  }
93
88
 
94
- startPreciseCoverage(
95
- jsCoveragePerBlock: boolean,
96
- preciseCoverageDeltaUpdateCallback: ((arg0: number, arg2: Protocol.Profiler.ScriptCoverage[]) => Promise<void>)|
97
- null): Promise<unknown> {
89
+ startPreciseCoverage(jsCoveragePerBlock: boolean,
90
+ preciseCoverageDeltaUpdateCallback:
91
+ ((arg0: number, arg2: Protocol.Profiler.ScriptCoverage[]) => Promise<void>)|
92
+ null): Promise<unknown> {
98
93
  const callCount = false;
99
94
  this.#preciseCoverageDeltaUpdateCallback = preciseCoverageDeltaUpdateCallback;
100
95
  const allowUpdatesTriggeredByBackend = true;
@@ -143,6 +138,19 @@ export interface EventData {
143
138
  cpuProfilerModel: CPUProfilerModel;
144
139
  }
145
140
 
146
- export interface ProfileFinishedData extends EventData {
147
- cpuProfile: Protocol.Profiler.Profile;
141
+ // This class is used used as a Revealer in timeline-meta.ts
142
+ export class ProfileFinishedData implements EventData {
143
+ readonly id: string;
144
+ readonly scriptLocation: Location;
145
+ readonly title: string;
146
+ readonly cpuProfilerModel: CPUProfilerModel;
147
+ readonly cpuProfile: Protocol.Profiler.Profile;
148
+
149
+ constructor(eventData: EventData, cpuProfile: Protocol.Profiler.Profile) {
150
+ this.id = eventData.id;
151
+ this.scriptLocation = eventData.scriptLocation;
152
+ this.title = eventData.title;
153
+ this.cpuProfilerModel = eventData.cpuProfilerModel;
154
+ this.cpuProfile = cpuProfile;
155
+ }
148
156
  }
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import type * as Protocol from '../../generated/protocol.js';
6
- import * as TextUtils from '../../models/text_utils/text_utils.js';
6
+ import * as TextUtils from '../text_utils/text_utils.js';
7
7
 
8
8
  import type {CSSModel} from './CSSModel.js';
9
9
  import {CSSQuery} from './CSSQuery.js';
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import type * as Protocol from '../../generated/protocol.js';
6
- import * as TextUtils from '../../models/text_utils/text_utils.js';
6
+ import * as TextUtils from '../text_utils/text_utils.js';
7
7
 
8
8
  import type {CSSModel} from './CSSModel.js';
9
9
  import {CSSQuery} from './CSSQuery.js';
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import type * as Protocol from '../../generated/protocol.js';
6
- import * as TextUtils from '../../models/text_utils/text_utils.js';
6
+ import * as TextUtils from '../text_utils/text_utils.js';
7
7
 
8
8
  import type {CSSModel} from './CSSModel.js';
9
9
  import {CSSQuery} from './CSSQuery.js';
@@ -4,11 +4,11 @@
4
4
 
5
5
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
6
6
  import type * as Protocol from '../../generated/protocol.js';
7
- import * as TextUtils from '../../models/text_utils/text_utils.js';
8
7
  import * as Common from '../common/common.js';
9
8
  import * as Host from '../host/host.js';
10
9
  import * as Platform from '../platform/platform.js';
11
10
  import * as Root from '../root/root.js';
11
+ import * as TextUtils from '../text_utils/text_utils.js';
12
12
 
13
13
  import {CSSFontFace} from './CSSFontFace.js';
14
14
  import {CSSMatchedStyles} from './CSSMatchedStyles.js';
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import type * as Protocol from '../../generated/protocol.js';
6
- import * as TextUtils from '../../models/text_utils/text_utils.js';
6
+ import * as TextUtils from '../text_utils/text_utils.js';
7
7
 
8
8
  import type {CSSModel} from './CSSModel.js';
9
9
  import {CSSQuery} from './CSSQuery.js';
@@ -3,10 +3,10 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import type * as Protocol from '../../generated/protocol.js';
6
- import * as TextUtils from '../../models/text_utils/text_utils.js';
7
6
  import * as Common from '../common/common.js';
8
7
  import * as HostModule from '../host/host.js';
9
8
  import * as Platform from '../platform/platform.js';
9
+ import * as TextUtils from '../text_utils/text_utils.js';
10
10
 
11
11
  import type {CSSMatchedStyles} from './CSSMatchedStyles.js';
12
12
  import {cssMetadata, GridAreaRowRegex} from './CSSMetadata.js';
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import type * as Protocol from '../../generated/protocol.js';
6
- import type * as TextUtils from '../../models/text_utils/text_utils.js';
6
+ import type * as TextUtils from '../text_utils/text_utils.js';
7
7
 
8
8
  import {CSSLocation, type CSSModel, type Edit} from './CSSModel.js';
9
9
  import type {CSSStyleSheetHeader} from './CSSStyleSheetHeader.js';
@@ -3,8 +3,8 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Protocol from '../../generated/protocol.js';
6
- import * as TextUtils from '../../models/text_utils/text_utils.js';
7
6
  import * as Platform from '../platform/platform.js';
7
+ import * as TextUtils from '../text_utils/text_utils.js';
8
8
 
9
9
  import {CSSContainerQuery} from './CSSContainerQuery.js';
10
10
  import {CSSLayer} from './CSSLayer.js';
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import type * as Protocol from '../../generated/protocol.js';
6
- import * as TextUtils from '../../models/text_utils/text_utils.js';
6
+ import * as TextUtils from '../text_utils/text_utils.js';
7
7
 
8
8
  import type {CSSModel} from './CSSModel.js';
9
9
  import {CSSQuery} from './CSSQuery.js';
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import type * as Protocol from '../../generated/protocol.js';
6
- import * as TextUtils from '../../models/text_utils/text_utils.js';
6
+ import * as TextUtils from '../text_utils/text_utils.js';
7
7
 
8
8
  import type {CSSModel} from './CSSModel.js';
9
9
  import {CSSQuery} from './CSSQuery.js';
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import type * as Protocol from '../../generated/protocol.js';
6
- import * as TextUtils from '../../models/text_utils/text_utils.js';
6
+ import * as TextUtils from '../text_utils/text_utils.js';
7
7
 
8
8
  import {cssMetadata} from './CSSMetadata.js';
9
9
  import type {CSSModel, Edit} from './CSSModel.js';