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
@@ -159,13 +159,13 @@ const UIStrings = {
159
159
  */
160
160
  noEvents: 'No events have been logged yet.',
161
161
  /**
162
- *@description Text to preserve the log of events after refreshing.
162
+ *@description Text to keep the log of events after refreshing.
163
163
  */
164
- preserveLog: 'Preserve log',
164
+ preserveLog: 'Keep log',
165
165
  /**
166
- *@description Tooltip text that appears on the preserve log setting when hovering over it.
166
+ *@description Tooltip text that appears on the keep log setting when hovering over it.
167
167
  */
168
- doNotClearLogOnPageReload: 'Do not clear log on page reload/navigation.',
168
+ doNotClearLogOnPageReload: 'Don’t clear log on page reload/navigation',
169
169
  /**
170
170
  *@description Label for the ID of a session.
171
171
  */
@@ -31,8 +31,8 @@
31
31
  import * as Common from '../../core/common/common.js';
32
32
  import * as i18n from '../../core/i18n/i18n.js';
33
33
  import type * as Platform from '../../core/platform/platform.js';
34
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
34
35
  import * as Protocol from '../../generated/protocol.js';
35
- import * as TextUtils from '../../models/text_utils/text_utils.js';
36
36
  import * as JSON5 from '../../third_party/json5/json5.js';
37
37
  import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
38
38
  import * as UI from '../../ui/legacy/legacy.js';
@@ -139,7 +139,7 @@ const UIStrings = {
139
139
  /**
140
140
  * @description Explanatory text in the Frame Details view
141
141
  */
142
- theFramesSchemeIsInsecure: 'The frame\'s scheme is insecure',
142
+ theFramesSchemeIsInsecure: 'The frames scheme is insecure',
143
143
  /**
144
144
  * @description This label specifies the server endpoints to which the server is reporting errors
145
145
  *and warnings through the Report-to API. Following this label will be the URL of the server.
@@ -41,6 +41,8 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
41
41
  export class ServiceWorkerCacheTreeElement extends ExpandableApplicationPanelTreeElement {
42
42
  private swCacheModels: Set<SDK.ServiceWorkerCacheModel.ServiceWorkerCacheModel>;
43
43
  private swCacheTreeElements: Set<SWCacheTreeElement>;
44
+ private swCacheModelObserver?:
45
+ SDK.TargetManager.SDKModelObserver<SDK.ServiceWorkerCacheModel.ServiceWorkerCacheModel>;
44
46
  private storageBucket?: Protocol.Storage.StorageBucket;
45
47
 
46
48
  constructor(resourcesPanel: ResourcesPanel, storageBucket?: Protocol.Storage.StorageBucket) {
@@ -53,17 +55,25 @@ export class ServiceWorkerCacheTreeElement extends ExpandableApplicationPanelTre
53
55
  this.swCacheModels = new Set();
54
56
  this.swCacheTreeElements = new Set();
55
57
  this.storageBucket = storageBucket;
58
+ this.initialize();
56
59
  }
57
60
 
58
61
  initialize(): void {
62
+ this.removeChildren();
59
63
  this.swCacheModels.clear();
60
64
  this.swCacheTreeElements.clear();
61
- SDK.TargetManager.TargetManager.instance().observeModels(SDK.ServiceWorkerCacheModel.ServiceWorkerCacheModel, {
65
+ if (this.swCacheModelObserver) {
66
+ SDK.TargetManager.TargetManager.instance().unobserveModels(SDK.ServiceWorkerCacheModel.ServiceWorkerCacheModel,
67
+ this.swCacheModelObserver);
68
+ }
69
+ this.swCacheModelObserver = {
62
70
  modelAdded: (model: SDK.ServiceWorkerCacheModel.ServiceWorkerCacheModel) =>
63
71
  this.serviceWorkerCacheModelAdded(model),
64
72
  modelRemoved: (model: SDK.ServiceWorkerCacheModel.ServiceWorkerCacheModel) =>
65
73
  this.serviceWorkerCacheModelRemoved(model),
66
- });
74
+ };
75
+ SDK.TargetManager.TargetManager.instance().observeModels(SDK.ServiceWorkerCacheModel.ServiceWorkerCacheModel,
76
+ this.swCacheModelObserver, {scoped: true});
67
77
  }
68
78
 
69
79
  override onattach(): void {
@@ -9,8 +9,8 @@ import * as Common from '../../core/common/common.js';
9
9
  import * as i18n from '../../core/i18n/i18n.js';
10
10
  import * as Platform from '../../core/platform/platform.js';
11
11
  import * as SDK from '../../core/sdk/sdk.js';
12
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
12
13
  import type * as Protocol from '../../generated/protocol.js';
13
- import * as TextUtils from '../../models/text_utils/text_utils.js';
14
14
  import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
15
15
  import * as UI from '../../ui/legacy/legacy.js';
16
16
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
@@ -26,6 +26,7 @@ import * as PreloadingTreeElement from './PreloadingTreeElement.js';
26
26
  import * as ReportingApiTreeElement from './ReportingApiTreeElement.js';
27
27
  import * as ReportingApiView from './ReportingApiView.js';
28
28
  import * as ResourcesPanel from './ResourcesPanel.js';
29
+ import * as ServiceWorkerCacheTreeElement from './ServiceWorkerCacheTreeElement.js';
29
30
  import * as ServiceWorkerCacheViews from './ServiceWorkerCacheViews.js';
30
31
  import * as ServiceWorkersView from './ServiceWorkersView.js';
31
32
  import * as ServiceWorkerUpdateCycleView from './ServiceWorkerUpdateCycleView.js';
@@ -67,6 +68,7 @@ export {
67
68
  ReportingApiTreeElement,
68
69
  ReportingApiView,
69
70
  ResourcesPanel,
71
+ ServiceWorkerCacheTreeElement,
70
72
  ServiceWorkerCacheViews,
71
73
  ServiceWorkersView,
72
74
  ServiceWorkerUpdateCycleView,
@@ -49,7 +49,7 @@ const UIStrings = {
49
49
  * the back/forward cache was not used and a normal navigation occurred instead.
50
50
  */
51
51
  normalNavigation:
52
- 'Not served from back/forward cache: to trigger back/forward cache, use Chrome\'s back/forward buttons, or use the test button below to automatically navigate away and back.',
52
+ 'Not served from back/forward cache: to trigger back/forward cache, use Chromes back/forward buttons, or use the test button below to automatically navigate away and back.',
53
53
  /**
54
54
  * @description Status text for the status of the back/forward cache status indicating that
55
55
  * the back/forward cache was used to restore the page instead of reloading it.
@@ -463,13 +463,29 @@ export class BackForwardCacheView extends UI.Widget.Widget {
463
463
  constructor(view = DEFAULT_VIEW) {
464
464
  super({useShadowDom: true, delegatesFocus: true});
465
465
  this.#view = view;
466
- this.#getMainResourceTreeModel()?.addEventListener(
467
- SDK.ResourceTreeModel.Events.PrimaryPageChanged, this.requestUpdate, this);
468
- this.#getMainResourceTreeModel()?.addEventListener(
469
- SDK.ResourceTreeModel.Events.BackForwardCacheDetailsUpdated, this.requestUpdate, this);
466
+ }
467
+
468
+ override wasShown(): void {
469
+ super.wasShown();
470
+ SDK.TargetManager.TargetManager.instance().addModelListener(SDK.ResourceTreeModel.ResourceTreeModel,
471
+ SDK.ResourceTreeModel.Events.PrimaryPageChanged,
472
+ this.requestUpdate, this);
473
+ SDK.TargetManager.TargetManager.instance().addModelListener(
474
+ SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.BackForwardCacheDetailsUpdated,
475
+ this.requestUpdate, this);
470
476
  this.requestUpdate();
471
477
  }
472
478
 
479
+ override willHide(): void {
480
+ SDK.TargetManager.TargetManager.instance().removeModelListener(SDK.ResourceTreeModel.ResourceTreeModel,
481
+ SDK.ResourceTreeModel.Events.PrimaryPageChanged,
482
+ this.requestUpdate, this);
483
+ SDK.TargetManager.TargetManager.instance().removeModelListener(
484
+ SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.BackForwardCacheDetailsUpdated,
485
+ this.requestUpdate, this);
486
+ super.willHide();
487
+ }
488
+
473
489
  #getMainResourceTreeModel(): SDK.ResourceTreeModel.ResourceTreeModel|null {
474
490
  const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
475
491
  return mainTarget?.model(SDK.ResourceTreeModel.ResourceTreeModel) || null;
@@ -6,7 +6,7 @@ import '../../../ui/legacy/components/data_grid/data_grid.js';
6
6
 
7
7
  import * as Host from '../../../core/host/host.js';
8
8
  import * as i18n from '../../../core/i18n/i18n.js';
9
- import type * as TextUtils from '../../../models/text_utils/text_utils.js';
9
+ import type * as TextUtils from '../../../core/text_utils/text_utils.js';
10
10
  import * as UI from '../../../ui/legacy/legacy.js';
11
11
  import {html, render} from '../../../ui/lit/lit.js';
12
12
 
@@ -149,12 +149,12 @@ export class TrustTokensView extends UI.Widget.VBox {
149
149
  override wasShown(): void {
150
150
  super.wasShown();
151
151
  this.requestUpdate();
152
- this.#updateInterval = setInterval(this.requestUpdate.bind(this), REFRESH_INTERVAL_MS);
152
+ this.#updateInterval = window.setInterval(this.requestUpdate.bind(this), REFRESH_INTERVAL_MS);
153
153
  }
154
154
 
155
155
  override willHide(): void {
156
156
  super.willHide();
157
- clearInterval(this.#updateInterval);
157
+ window.clearInterval(this.#updateInterval);
158
158
  this.#updateInterval = 0;
159
159
  }
160
160
 
@@ -12,8 +12,8 @@ import * as i18n from '../../../core/i18n/i18n.js';
12
12
  import * as Platform from '../../../core/platform/platform.js';
13
13
  import {assertNotNullOrUndefined} from '../../../core/platform/platform.js';
14
14
  import * as SDK from '../../../core/sdk/sdk.js';
15
+ import * as TextUtils from '../../../core/text_utils/text_utils.js';
15
16
  import * as Protocol from '../../../generated/protocol.js';
16
- import * as TextUtils from '../../../models/text_utils/text_utils.js';
17
17
  import * as Buttons from '../../../ui/components/buttons/buttons.js';
18
18
  // eslint-disable-next-line @devtools/es-modules-import
19
19
  import emptyWidgetStyles from '../../../ui/legacy/emptyWidget.css.js';
@@ -56,7 +56,7 @@ const UIStrings = {
56
56
  /**
57
57
  * @description Description in dialog
58
58
  */
59
- descriptionDisabledByDataSaver: 'Speculative loading is disabled because of the operating system\'s Data Saver mode.',
59
+ descriptionDisabledByDataSaver: 'Speculative loading is disabled because of the operating systems Data Saver mode.',
60
60
  /**
61
61
  * @description Header in dialog
62
62
  */
@@ -65,7 +65,7 @@ const UIStrings = {
65
65
  * @description Description in dialog
66
66
  */
67
67
  descriptionDisabledByBatterySaver:
68
- 'Speculative loading is disabled because of the operating system\'s Battery Saver mode.',
68
+ 'Speculative loading is disabled because of the operating systems Battery Saver mode.',
69
69
  /**
70
70
  * @description Header in dialog
71
71
  */
@@ -22,7 +22,7 @@ const UIStrings = {
22
22
  /**
23
23
  * @description Description text for Prefetch status PrefetchFailedMIMENotSupported.
24
24
  */
25
- PrefetchFailedMIMENotSupported: 'The prefetch failed because the response\'s Content-Type header was not supported.',
25
+ PrefetchFailedMIMENotSupported: 'The prefetch failed because the responses Content-Type header was not supported.',
26
26
  /**
27
27
  * @description Description text for Prefetch status PrefetchFailedNetError.
28
28
  */
@@ -293,7 +293,7 @@ const UIStrings = {
293
293
  * Description text for PrerenderFinalStatus::kActivatedDuringMainFrameNavigation.
294
294
  */
295
295
  prerenderFinalStatusActivatedDuringMainFrameNavigation:
296
- 'Prerendered page activated during initiating page\'s main frame navigation.',
296
+ 'Prerendered page activated during initiating pages main frame navigation.',
297
297
  /**
298
298
  * Description text for PrerenderFinalStatus::kCrossSiteRedirectInMainFrameNavigation.
299
299
  */
@@ -35,7 +35,7 @@ const UIStrings = {
35
35
  * @description Message that tells this page was prerendered.
36
36
  */
37
37
  downgradedPrefetchUsed:
38
- 'The initiating page attempted to prerender this page\'s URL. The prerender failed, but the resulting response body was still used as a prefetch.',
38
+ 'The initiating page attempted to prerender this pages URL. The prerender failed, but the resulting response body was still used as a prefetch.',
39
39
  /**
40
40
  * @description Message that tells this page was prefetched.
41
41
  */
@@ -48,16 +48,16 @@ const UIStrings = {
48
48
  * @description Message that tells this page was prefetched.
49
49
  */
50
50
  prefetchFailed:
51
- 'The initiating page attempted to prefetch this page\'s URL, but the prefetch failed, so a full navigation was performed instead.',
51
+ 'The initiating page attempted to prefetch this pages URL, but the prefetch failed, so a full navigation was performed instead.',
52
52
  /**
53
53
  * @description Message that tells this page was prerendered.
54
54
  */
55
55
  prerenderFailed:
56
- 'The initiating page attempted to prerender this page\'s URL, but the prerender failed, so a full navigation was performed instead.',
56
+ 'The initiating page attempted to prerender this pages URL, but the prerender failed, so a full navigation was performed instead.',
57
57
  /**
58
58
  * @description Message that tells this page was not preloaded.
59
59
  */
60
- noPreloads: 'The initiating page did not attempt to speculatively load this page\'s URL.',
60
+ noPreloads: 'The initiating page did not attempt to speculatively load this pages URL.',
61
61
  /**
62
62
  * @description Header for current URL.
63
63
  */
@@ -32,7 +32,7 @@ const UIStrings = {
32
32
  * @description Explanation for how to populate the autofill panel with data. Shown when there is
33
33
  * no data available.
34
34
  */
35
- toStartDebugging: 'To start debugging autofill, use Chrome\'s autofill menu to fill an address form.',
35
+ toStartDebugging: 'To start debugging autofill, use Chromes autofill menu to fill an address form.',
36
36
  /**
37
37
  * @description Column header for column containing form field values
38
38
  */
@@ -39,7 +39,7 @@ const UIStringsNotTranslate = {
39
39
  /**
40
40
  * @description Text for dismissing teaser.
41
41
  */
42
- dontShowAgain: 'Don\'t show again',
42
+ dontShowAgain: 'Dont show again',
43
43
  /**
44
44
  * @description Text for teaser to turn on code suggestions.
45
45
  */
@@ -14,12 +14,12 @@ import * as Platform from '../../core/platform/platform.js';
14
14
  import * as _ProtocolClient from '../../core/protocol_client/protocol_client.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
15
15
  import * as Root from '../../core/root/root.js';
16
16
  import * as SDK from '../../core/sdk/sdk.js';
17
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
17
18
  import type * as Protocol from '../../generated/protocol.js';
18
19
  import * as Bindings from '../../models/bindings/bindings.js';
19
20
  import * as Extensions from '../../models/extensions/extensions.js';
20
21
  import * as HAR from '../../models/har/har.js';
21
22
  import * as Logs from '../../models/logs/logs.js';
22
- import * as TextUtils from '../../models/text_utils/text_utils.js';
23
23
  import * as Workspace from '../../models/workspace/workspace.js';
24
24
  import * as Components from '../../ui/legacy/components/utils/utils.js';
25
25
  import * as UI from '../../ui/legacy/legacy.js';
@@ -3,8 +3,8 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as SDK from '../../core/sdk/sdk.js';
6
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
6
7
  import * as Protocol from '../../generated/protocol.js';
7
- import * as TextUtils from '../../models/text_utils/text_utils.js';
8
8
 
9
9
  import type {ConsoleGroupViewMessage, ConsoleViewMessage} from './ConsoleViewMessage.js';
10
10
 
@@ -5,8 +5,8 @@
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
7
  import * as SDK from '../../core/sdk/sdk.js';
8
+ import type * as TextUtils from '../../core/text_utils/text_utils.js';
8
9
  import * as Protocol from '../../generated/protocol.js';
9
- import type * as TextUtils from '../../models/text_utils/text_utils.js';
10
10
  import * as UI from '../../ui/legacy/legacy.js';
11
11
  import * as Lit from '../../ui/lit/lit.js';
12
12
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
@@ -40,13 +40,13 @@ import * as i18n from '../../core/i18n/i18n.js';
40
40
  import * as Platform from '../../core/platform/platform.js';
41
41
  import * as Root from '../../core/root/root.js';
42
42
  import * as SDK from '../../core/sdk/sdk.js';
43
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
43
44
  import * as Protocol from '../../generated/protocol.js';
44
45
  import * as AiCodeCompletion from '../../models/ai_code_completion/ai_code_completion.js';
45
46
  import * as AiCodeGeneration from '../../models/ai_code_generation/ai_code_generation.js';
46
47
  import * as Bindings from '../../models/bindings/bindings.js';
47
48
  import * as IssuesManager from '../../models/issues_manager/issues_manager.js';
48
49
  import * as Logs from '../../models/logs/logs.js';
49
- import * as TextUtils from '../../models/text_utils/text_utils.js';
50
50
  import * as Workspace from '../../models/workspace/workspace.js';
51
51
  import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
52
52
  import * as Highlighting from '../../ui/components/highlighting/highlighting.js';
@@ -39,12 +39,12 @@ import * as Host from '../../core/host/host.js';
39
39
  import * as i18n from '../../core/i18n/i18n.js';
40
40
  import * as Platform from '../../core/platform/platform.js';
41
41
  import * as SDK from '../../core/sdk/sdk.js';
42
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
42
43
  import * as Protocol from '../../generated/protocol.js';
43
44
  import * as AiAssistanceModel from '../../models/ai_assistance/ai_assistance.js';
44
45
  import * as Bindings from '../../models/bindings/bindings.js';
45
46
  import type * as IssuesManager from '../../models/issues_manager/issues_manager.js';
46
47
  import * as Logs from '../../models/logs/logs.js';
47
- import * as TextUtils from '../../models/text_utils/text_utils.js';
48
48
  import * as Workspace from '../../models/workspace/workspace.js';
49
49
  import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
50
50
  import * as Highlighting from '../../ui/components/highlighting/highlighting.js';
@@ -3,11 +3,11 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as SDK from '../../core/sdk/sdk.js';
6
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
6
7
  import * as AiAssistanceModel from '../../models/ai_assistance/ai_assistance.js';
7
8
  import * as Bindings from '../../models/bindings/bindings.js';
8
9
  import * as Formatter from '../../models/formatter/formatter.js';
9
10
  import * as Logs from '../../models/logs/logs.js';
10
- import * as TextUtils from '../../models/text_utils/text_utils.js';
11
11
  import * as Components from '../../ui/legacy/components/utils/utils.js';
12
12
  import * as UI from '../../ui/legacy/legacy.js';
13
13
 
@@ -4,8 +4,8 @@
4
4
 
5
5
  import type * as Common from '../../core/common/common.js';
6
6
  import * as Platform from '../../core/platform/platform.js';
7
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
7
8
  import type * as Bindings from '../../models/bindings/bindings.js';
8
- import * as TextUtils from '../../models/text_utils/text_utils.js';
9
9
  import * as Workspace from '../../models/workspace/workspace.js';
10
10
 
11
11
  import type {CoverageInfo, CoverageModel} from './CoverageModel.js';
@@ -54,7 +54,15 @@ export class CoverageDecorationManager {
54
54
  update(updatedEntries: CoverageInfo[]): void {
55
55
  for (const entry of updatedEntries) {
56
56
  for (const uiSourceCode of this.uiSourceCodeByContentProvider.get(entry.getContentProvider())) {
57
+ const alreadyDecorated = uiSourceCode.getDecorationData(decoratorType) === this;
57
58
  uiSourceCode.setDecorationData(decoratorType, this);
59
+ // We set the decoration data to `this` (the manager itself), which acts as a singleton.
60
+ // If the file was already decorated with `this`, `setDecorationData` performs an identity
61
+ // check and will skip dispatching the `DecorationChanged` event. Since the manager's internal
62
+ // coverage data has updated, we must manually dispatch the event to force the editor to redraw.
63
+ if (alreadyDecorated) {
64
+ uiSourceCode.dispatchEventToListeners(Workspace.UISourceCode.Events.DecorationChanged, decoratorType);
65
+ }
58
66
  }
59
67
  }
60
68
  }
@@ -5,9 +5,9 @@
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import * as Platform from '../../core/platform/platform.js';
7
7
  import * as SDK from '../../core/sdk/sdk.js';
8
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
8
9
  import type * as Protocol from '../../generated/protocol.js';
9
10
  import type * as Bindings from '../../models/bindings/bindings.js';
10
- import * as TextUtils from '../../models/text_utils/text_utils.js';
11
11
  import * as Workspace from '../../models/workspace/workspace.js';
12
12
 
13
13
  export const enum CoverageType {
@@ -9,9 +9,9 @@ import * as Common from '../../core/common/common.js';
9
9
  import * as i18n from '../../core/i18n/i18n.js';
10
10
  import * as Platform from '../../core/platform/platform.js';
11
11
  import * as SDK from '../../core/sdk/sdk.js';
12
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
12
13
  import type * as Protocol from '../../generated/protocol.js';
13
14
  import * as Geometry from '../../models/geometry/geometry.js';
14
- import * as TextUtils from '../../models/text_utils/text_utils.js';
15
15
  import * as Components from '../../ui/legacy/components/utils/utils.js';
16
16
  import * as UI from '../../ui/legacy/legacy.js';
17
17
  import {Directives, html, type LitTemplate, nothing, render, type TemplateResult} from '../../ui/lit/lit.js';
@@ -9,8 +9,8 @@ import * as Host from '../../core/host/host.js';
9
9
  import * as i18n from '../../core/i18n/i18n.js';
10
10
  import * as Platform from '../../core/platform/platform.js';
11
11
  import * as SDK from '../../core/sdk/sdk.js';
12
+ import type * as TextUtils from '../../core/text_utils/text_utils.js';
12
13
  import type * as Protocol from '../../generated/protocol.js';
13
- import type * as TextUtils from '../../models/text_utils/text_utils.js';
14
14
  import * as UI from '../../ui/legacy/legacy.js';
15
15
  import {html, nothing, render} from '../../ui/lit/lit.js';
16
16
 
@@ -8,7 +8,7 @@ import type * as Common from '../../core/common/common.js';
8
8
  import * as i18n from '../../core/i18n/i18n.js';
9
9
  import * as Platform from '../../core/platform/platform.js';
10
10
  import * as SDK from '../../core/sdk/sdk.js';
11
- import type * as TextUtils from '../../models/text_utils/text_utils.js';
11
+ import type * as TextUtils from '../../core/text_utils/text_utils.js';
12
12
  import * as UI from '../../ui/legacy/legacy.js';
13
13
  import {html, render} from '../../ui/lit/lit.js';
14
14
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
@@ -20,6 +20,14 @@ const UIStrings = {
20
20
  * @description Text for copying, copy should be used as a verb
21
21
  */
22
22
  copy: 'Copy',
23
+ /**
24
+ * @description Text to scroll the displayed content into view
25
+ */
26
+ scrollIntoView: 'Scroll into view',
27
+ /**
28
+ * @description A context menu item in the Accessibility Tree View to switch to DOM tree
29
+ */
30
+ switchToDomTree: 'Switch to DOM tree',
23
31
  } as const;
24
32
  const str_ = i18n.i18n.registerUIStrings('panels/elements/AccessibilityTreeView.ts', UIStrings);
25
33
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -30,6 +38,8 @@ export interface ViewInput {
30
38
  onNodeHighlight: (node: SDK.AccessibilityModel.AccessibilityNode) => void;
31
39
  onNodeClearHighlight: () => void;
32
40
  onCopy: (node: SDK.AccessibilityModel.AccessibilityNode) => void;
41
+ onScrollIntoView: (node: SDK.AccessibilityModel.AccessibilityNode) => void;
42
+ onSwitchToDomTree: () => void;
33
43
  }
34
44
 
35
45
  export interface ViewOutput {
@@ -78,12 +88,20 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
78
88
  };
79
89
  const onItemContextMenu =
80
90
  (event: TreeOutline.TreeOutline.ItemContextMenuEvent<AccessibilityTreeUtils.AXTreeNodeData>): void => {
81
- event.data.originalEvent.preventDefault();
82
- event.data.originalEvent.stopPropagation();
83
- const contextMenu = new UI.ContextMenu.ContextMenu(event.data.originalEvent);
91
+ const contextMenu = event.createContextMenu();
84
92
  const axNode = event.data.node.treeNodeData;
85
93
  contextMenu.clipboardSection().appendItem(i18nString(UIStrings.copy), () => input.onCopy(axNode),
86
94
  {jslogContext: 'copy'});
95
+
96
+ if (axNode.isDOMNode()) {
97
+ contextMenu.viewSection().appendItem(i18nString(UIStrings.scrollIntoView),
98
+ () => input.onScrollIntoView(axNode),
99
+ {jslogContext: 'scroll-into-view'});
100
+ }
101
+
102
+ contextMenu.viewSection().appendItem(i18nString(UIStrings.switchToDomTree), () => input.onSwitchToDomTree(),
103
+ {jslogContext: 'switch-to-dom-tree'});
104
+
87
105
  void contextMenu.show();
88
106
  };
89
107
 
@@ -157,6 +175,21 @@ export class AccessibilityTreeView extends UI.Widget.VBox implements
157
175
  UI.UIUtils.copyTextToClipboard(text);
158
176
  };
159
177
 
178
+ #onScrollIntoView = (axNode: SDK.AccessibilityModel.AccessibilityNode): void => {
179
+ const deferredNode = axNode.deferredDOMNode();
180
+ if (deferredNode) {
181
+ deferredNode.resolve(domNode => {
182
+ if (domNode) {
183
+ void domNode.scrollIntoView();
184
+ }
185
+ });
186
+ }
187
+ };
188
+
189
+ #onSwitchToDomTree = async(): Promise<void> => {
190
+ ElementsPanel.instance().toggleAccessibilityTree();
191
+ };
192
+
160
193
  override async wasShown(): Promise<void> {
161
194
  super.wasShown();
162
195
  this.requestUpdate();
@@ -183,6 +216,8 @@ export class AccessibilityTreeView extends UI.Widget.VBox implements
183
216
  onNodeHighlight: this.#onNodeHighlight,
184
217
  onNodeClearHighlight: this.#onNodeClearHighlight,
185
218
  onCopy: this.#onCopy,
219
+ onScrollIntoView: this.#onScrollIntoView,
220
+ onSwitchToDomTree: this.#onSwitchToDomTree,
186
221
  };
187
222
  this.#view(input, this.#treeOperations, this.contentElement);
188
223
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  import type * as Common from '../../core/common/common.js';
6
6
  import * as SDK from '../../core/sdk/sdk.js';
7
- import * as TextUtils from '../../models/text_utils/text_utils.js';
7
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
8
8
  import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
9
9
  import * as Components from '../../ui/legacy/components/utils/utils.js';
10
10
  import * as UI from '../../ui/legacy/legacy.js';
@@ -30,11 +30,11 @@ const UIStrings = {
30
30
  /**
31
31
  * @description Tooltip text shown in the Elements panel when an element has an error.
32
32
  */
33
- formAriaLabelledByToNonExistingId: 'An aria-labelledby attribute doesn\'t match any element id',
33
+ formAriaLabelledByToNonExistingId: 'An aria-labelledby attribute doesnt match any element id',
34
34
  /**
35
35
  * @description Tooltip text shown in the Elements panel when an element has an error.
36
36
  */
37
- formInputAssignedAutocompleteValueToIdOrNameAttributeError: 'An element doesn\'t have an autocomplete attribute',
37
+ formInputAssignedAutocompleteValueToIdOrNameAttributeError: 'An element doesnt have an autocomplete attribute',
38
38
  /**
39
39
  * @description Tooltip text shown in the Elements panel when an element has an error.
40
40
  */
@@ -42,13 +42,13 @@ import * as i18n from '../../core/i18n/i18n.js';
42
42
  import * as Platform from '../../core/platform/platform.js';
43
43
  import * as Root from '../../core/root/root.js';
44
44
  import * as SDK from '../../core/sdk/sdk.js';
45
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
45
46
  import * as Protocol from '../../generated/protocol.js';
46
47
  import * as AIAssistance from '../../models/ai_assistance/ai_assistance.js';
47
48
  import * as Badges from '../../models/badges/badges.js';
48
49
  import * as Bindings from '../../models/bindings/bindings.js';
49
50
  import type * as Elements from '../../models/elements/elements.js';
50
51
  import type * as IssuesManager from '../../models/issues_manager/issues_manager.js';
51
- import * as TextUtils from '../../models/text_utils/text_utils.js';
52
52
  import * as Workspace from '../../models/workspace/workspace.js';
53
53
  import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
54
54
  import type * as Adorners from '../../ui/components/adorners/adorners.js';
@@ -121,6 +121,10 @@ const UIStrings = {
121
121
  * @description Text to scroll the displayed content into view
122
122
  */
123
123
  scrollIntoView: 'Scroll into view',
124
+ /**
125
+ * @description A context menu item in the Elements panel to switch to Accessibility tree
126
+ */
127
+ switchToAccessibilityTree: 'Switch to accessibility tree',
124
128
  /**
125
129
  * @description A context menu item in the Elements Tree Element of the Elements panel
126
130
  */
@@ -2361,8 +2365,11 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
2361
2365
  }
2362
2366
 
2363
2367
  this.populateExpandRecursively(contextMenu);
2364
- contextMenu.viewSection().appendItem(
2365
- i18nString(UIStrings.collapseChildren), this.collapseChildren.bind(this), {jslogContext: 'collapse-children'});
2368
+ contextMenu.viewSection().appendItem(i18nString(UIStrings.collapseChildren), this.collapseChildren.bind(this),
2369
+ {jslogContext: 'collapse-children'});
2370
+ contextMenu.viewSection().appendItem(i18nString(UIStrings.switchToAccessibilityTree),
2371
+ () => ElementsPanel.instance().toggleAccessibilityTree(),
2372
+ {jslogContext: 'switch-to-accessibility-tree'});
2366
2373
  const deviceModeWrapperAction = new Emulation.DeviceModeWrapper.ActionDelegate();
2367
2374
  contextMenu.viewSection().appendItem(
2368
2375
  i18nString(UIStrings.captureNodeScreenshot),
@@ -4,8 +4,8 @@
4
4
 
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import type * as SDK from '../../core/sdk/sdk.js';
7
+ import type * as TextUtils from '../../core/text_utils/text_utils.js';
7
8
  import * as ComputedStyle from '../../models/computed_style/computed_style.js';
8
- import type * as TextUtils from '../../models/text_utils/text_utils.js';
9
9
  import * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_editor.js';
10
10
  import * as Components from '../../ui/legacy/components/utils/utils.js';
11
11
  import * as UI from '../../ui/legacy/legacy.js';
@@ -40,10 +40,10 @@ import * as Host from '../../core/host/host.js';
40
40
  import * as i18n from '../../core/i18n/i18n.js';
41
41
  import * as Platform from '../../core/platform/platform.js';
42
42
  import * as SDK from '../../core/sdk/sdk.js';
43
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
43
44
  import * as Protocol from '../../generated/protocol.js';
44
45
  import * as Badges from '../../models/badges/badges.js';
45
46
  import * as Bindings from '../../models/bindings/bindings.js';
46
- import * as TextUtils from '../../models/text_utils/text_utils.js';
47
47
  import * as Buttons from '../../ui/components/buttons/buttons.js';
48
48
  import * as Tooltips from '../../ui/components/tooltips/tooltips.js';
49
49
  import {createIcon, type Icon} from '../../ui/kit/kit.js';
@@ -9,10 +9,10 @@ import * as Host from '../../core/host/host.js';
9
9
  import * as i18n from '../../core/i18n/i18n.js';
10
10
  import * as Platform from '../../core/platform/platform.js';
11
11
  import * as SDK from '../../core/sdk/sdk.js';
12
+ import * as TextUtils from '../../core/text_utils/text_utils.js';
12
13
  import type * as Protocol from '../../generated/protocol.js';
13
14
  import * as Badges from '../../models/badges/badges.js';
14
15
  import * as Bindings from '../../models/bindings/bindings.js';
15
- import * as TextUtils from '../../models/text_utils/text_utils.js';
16
16
  import type * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
17
17
  import * as Tooltips from '../../ui/components/tooltips/tooltips.js';
18
18
  import {createIcon, Icon} from '../../ui/kit/kit.js';