chrome-devtools-frontend 1.0.1657855 → 1.0.1661063

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 (370) hide show
  1. package/.agents/skills/evaluate-ai-css-completion/SKILL.md +133 -0
  2. package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +76 -0
  3. package/.agents/skills/migrate-chromium-test/SKILL.md +15 -70
  4. package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +37 -18
  5. package/.agents/skills/version-control/SKILL.md +8 -1
  6. package/AUTHORS +1 -0
  7. package/SECURITY.md +3 -0
  8. package/docs/get_the_code.md +6 -0
  9. package/eslint.config.mjs +7 -0
  10. package/extension-api/ExtensionAPI.d.ts +88 -0
  11. package/front_end/Tests.js +6 -6
  12. package/front_end/core/common/Gzip.ts +12 -5
  13. package/front_end/core/host/AidaClient.ts +35 -9
  14. package/front_end/core/host/GdpClient.ts +10 -7
  15. package/front_end/core/host/InspectorFrontendHost.ts +1 -0
  16. package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
  17. package/front_end/core/platform/StringUtilities.ts +55 -4
  18. package/front_end/core/sdk/AccessibilityModel.snapshot.txt +17 -0
  19. package/front_end/core/sdk/AccessibilityModel.ts +132 -2
  20. package/front_end/core/sdk/CPUThrottlingManager.ts +10 -5
  21. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +2 -5
  22. package/front_end/core/sdk/ConsoleModel.ts +5 -5
  23. package/front_end/core/sdk/DOMDebuggerModel.ts +7 -1
  24. package/front_end/core/sdk/DOMModel.ts +33 -18
  25. package/front_end/core/sdk/DebuggerModel.ts +4 -4
  26. package/front_end/core/sdk/EventBreakpointsModel.ts +2 -0
  27. package/front_end/core/sdk/FrameManager.ts +1 -0
  28. package/front_end/core/sdk/IsolateManager.ts +1 -0
  29. package/front_end/core/sdk/NetworkManager.ts +59 -11
  30. package/front_end/core/sdk/NetworkRequest.ts +38 -1
  31. package/front_end/core/sdk/OverlayModel.ts +45 -6
  32. package/front_end/core/sdk/PageResourceLoader.ts +2 -0
  33. package/front_end/core/sdk/ResourceTreeModel.ts +6 -7
  34. package/front_end/core/sdk/ScreenCaptureModel.ts +2 -2
  35. package/front_end/core/sdk/ServerTiming.ts +17 -13
  36. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +4 -2
  37. package/front_end/core/sdk/ServiceWorkerManager.ts +19 -5
  38. package/front_end/core/sdk/SourceMap.ts +5 -5
  39. package/front_end/core/sdk/SourceMapManager.ts +3 -2
  40. package/front_end/core/sdk/TargetManager.ts +14 -1
  41. package/front_end/core/sdk/TraceObject.ts +4 -2
  42. package/front_end/core/sdk/sdk-meta.ts +170 -0
  43. package/front_end/design_system_tokens.css +0 -5
  44. package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +5 -2
  45. package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +26 -4
  46. package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +8 -3
  47. package/front_end/entrypoints/inspector_main/InspectorMain.ts +4 -4
  48. package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +2 -2
  49. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +36 -37
  50. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +15 -33
  51. package/front_end/entrypoints/js_app/js_app.ts +6 -5
  52. package/front_end/entrypoints/main/GlobalAiButton.ts +4 -4
  53. package/front_end/entrypoints/main/MainImpl.ts +20 -22
  54. package/front_end/entrypoints/main/main-meta.ts +42 -42
  55. package/front_end/entrypoints/node_app/node_app.ts +3 -2
  56. package/front_end/entrypoints/worker_app/WorkerMain.ts +1 -1
  57. package/front_end/foundation/Universe.ts +44 -1
  58. package/front_end/generated/InspectorBackendCommands.ts +2 -2
  59. package/front_end/generated/SupportedCSSProperties.js +19 -12
  60. package/front_end/generated/protocol.ts +3 -1
  61. package/front_end/models/ai_assistance/AiConversation.ts +19 -17
  62. package/front_end/models/ai_assistance/AiHistoryStorage.ts +37 -14
  63. package/front_end/models/ai_assistance/AiUtils.ts +38 -42
  64. package/front_end/models/ai_assistance/agents/AiAgent.ts +5 -1
  65. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +3 -2
  66. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +2 -1
  67. package/front_end/models/ai_assistance/agents/StorageAgent.ts +7 -5
  68. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +270 -286
  69. package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +20 -0
  70. package/front_end/models/ai_assistance/performance/AICallTree.ts +3 -1
  71. package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +3 -2
  72. package/front_end/models/autofill_manager/AutofillManager.ts +3 -1
  73. package/front_end/models/bindings/CompilerScriptMapping.ts +7 -7
  74. package/front_end/models/bindings/ContentProviderBasedProject.ts +4 -4
  75. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +5 -5
  76. package/front_end/models/bindings/DefaultScriptMapping.ts +3 -3
  77. package/front_end/models/bindings/NetworkProject.ts +5 -10
  78. package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +2 -1
  79. package/front_end/models/bindings/ResourceMapping.ts +3 -4
  80. package/front_end/models/bindings/ResourceScriptMapping.ts +2 -3
  81. package/front_end/models/bindings/ResourceUtils.ts +1 -1
  82. package/front_end/models/bindings/SASSSourceMapping.ts +11 -9
  83. package/front_end/models/bindings/StylesSourceMapping.ts +3 -3
  84. package/front_end/models/bindings/TempFile.ts +8 -3
  85. package/front_end/models/emulation/EmulatedDevices.ts +389 -8
  86. package/front_end/models/extensions/ExtensionAPI.ts +116 -52
  87. package/front_end/models/extensions/LanguageExtensionEndpoint.ts +13 -12
  88. package/front_end/models/formatter/ScriptFormatter.ts +8 -11
  89. package/front_end/models/issues_manager/BounceTrackingIssue.ts +1 -1
  90. package/front_end/models/issues_manager/ClientHintIssue.ts +1 -1
  91. package/front_end/models/issues_manager/ConnectionAllowlistIssue.ts +1 -1
  92. package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +7 -7
  93. package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +2 -2
  94. package/front_end/models/issues_manager/CookieIssue.ts +27 -16
  95. package/front_end/models/issues_manager/CorsIssue.ts +3 -3
  96. package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +2 -2
  97. package/front_end/models/issues_manager/DeprecationIssue.ts +3 -3
  98. package/front_end/models/issues_manager/EmailVerificationRequestIssue.ts +1 -1
  99. package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +1 -1
  100. package/front_end/models/issues_manager/FederatedAuthUserInfoRequestIssue.ts +1 -1
  101. package/front_end/models/issues_manager/GenericIssue.ts +7 -7
  102. package/front_end/models/issues_manager/HeavyAdIssue.ts +3 -3
  103. package/front_end/models/issues_manager/Issue.ts +11 -12
  104. package/front_end/models/issues_manager/IssueAggregator.ts +0 -9
  105. package/front_end/models/issues_manager/IssueResolver.ts +2 -2
  106. package/front_end/models/issues_manager/IssuesManager.ts +136 -137
  107. package/front_end/models/issues_manager/MixedContentIssue.ts +1 -1
  108. package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +3 -3
  109. package/front_end/models/issues_manager/QuirksModeIssue.ts +1 -1
  110. package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +2 -2
  111. package/front_end/models/issues_manager/SelectivePermissionsInterventionIssue.ts +2 -2
  112. package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +2 -2
  113. package/front_end/models/issues_manager/SharedDictionaryIssue.ts +1 -1
  114. package/front_end/models/issues_manager/UnencodedDigestIssue.ts +3 -3
  115. package/front_end/models/issues_manager/issues_manager.ts +0 -2
  116. package/front_end/models/javascript_metadata/NativeFunctions.js +5 -1
  117. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +5 -0
  118. package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +13 -10
  119. package/front_end/models/stack_trace/StackTraceModel.ts +3 -3
  120. package/front_end/models/text_utils/ContentData.ts +27 -0
  121. package/front_end/models/trace/helpers/SamplesIntegrator.ts +21 -5
  122. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +29 -14
  123. package/front_end/models/web_mcp/WebMCPModel.ts +24 -6
  124. package/front_end/models/workspace/IgnoreListManager.ts +6 -6
  125. package/front_end/models/workspace/UISourceCode.ts +3 -3
  126. package/front_end/models/workspace/WorkspaceImpl.ts +10 -1
  127. package/front_end/models/workspace_diff/WorkspaceDiff.ts +10 -4
  128. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +25 -22
  129. package/front_end/panels/ai_assistance/ExportConversation.ts +3 -4
  130. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +3 -3
  131. package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
  132. package/front_end/panels/ai_assistance/components/ChatMessage.ts +9 -1
  133. package/front_end/panels/ai_assistance/components/DisabledWidget.ts +2 -2
  134. package/front_end/panels/animation/AnimationTimeline.ts +17 -19
  135. package/front_end/panels/animation/AnimationUI.ts +5 -5
  136. package/front_end/panels/animation/animation-meta.ts +2 -2
  137. package/front_end/panels/application/ApplicationPanelSidebar.ts +4 -3
  138. package/front_end/panels/application/DeviceBoundSessionsView.ts +2 -6
  139. package/front_end/panels/application/FrameDetailsView.ts +1 -1
  140. package/front_end/panels/application/IndexedDBViews.ts +220 -266
  141. package/front_end/panels/application/OpenedWindowDetailsView.ts +1 -1
  142. package/front_end/panels/application/ResourcesPanel.ts +9 -2
  143. package/front_end/panels/application/ServiceWorkersView.ts +252 -211
  144. package/front_end/panels/application/StorageView.ts +97 -33
  145. package/front_end/panels/application/WebMCPView.ts +53 -44
  146. package/front_end/panels/application/components/AdsView.ts +201 -30
  147. package/front_end/panels/application/components/adsView.css +25 -0
  148. package/front_end/panels/application/indexedDBViews.css +38 -9
  149. package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -2
  150. package/front_end/panels/application/preloading/helper/PreloadingForward.ts +2 -1
  151. package/front_end/panels/application/storageView.css +26 -9
  152. package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +5 -1
  153. package/front_end/panels/browser_debugger/browser_debugger-meta.ts +8 -6
  154. package/front_end/panels/common/DOMLinkifier.ts +1 -1
  155. package/front_end/panels/common/ExtensionServer.ts +119 -14
  156. package/front_end/panels/console/ConsoleContextSelector.ts +1 -1
  157. package/front_end/panels/console/ConsolePinPane.ts +2 -2
  158. package/front_end/panels/console/ConsolePrompt.ts +2 -2
  159. package/front_end/panels/console/ConsoleView.ts +3 -2
  160. package/front_end/panels/console/PromptBuilder.ts +2 -1
  161. package/front_end/panels/console/SymbolizedErrorWidget.ts +2 -1
  162. package/front_end/panels/console_counters/WarningErrorCounter.ts +2 -2
  163. package/front_end/panels/coverage/CoverageListView.ts +28 -28
  164. package/front_end/panels/coverage/CoverageModel.ts +2 -1
  165. package/front_end/panels/coverage/CoverageView.ts +22 -22
  166. package/front_end/panels/coverage/coverage-meta.ts +5 -5
  167. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +36 -36
  168. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +1 -1
  169. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +2 -2
  170. package/front_end/panels/css_overview/CSSOverviewStartView.ts +6 -6
  171. package/front_end/panels/css_overview/CSSOverviewUnusedDeclarations.ts +6 -6
  172. package/front_end/panels/css_overview/css_overview-meta.ts +2 -2
  173. package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +1 -1
  174. package/front_end/panels/elements/AccessibilityTreeUtils.ts +8 -102
  175. package/front_end/panels/elements/AccessibilityTreeView.ts +163 -70
  176. package/front_end/panels/elements/ElementsPanel.ts +17 -11
  177. package/front_end/panels/elements/ElementsTreeElement.ts +4 -1
  178. package/front_end/panels/elements/ElementsTreeOutline.ts +4 -4
  179. package/front_end/panels/elements/LayoutPane.ts +1 -1
  180. package/front_end/panels/elements/MetricsSidebarPane.ts +100 -34
  181. package/front_end/panels/elements/StylePropertiesSection.ts +2 -2
  182. package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -2
  183. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  184. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +7 -18
  185. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +2 -2
  186. package/front_end/panels/elements/components/QueryContainer.ts +1 -1
  187. package/front_end/panels/emulation/DeviceModeView.ts +52 -70
  188. package/front_end/panels/issues/AffectedDirectivesView.ts +1 -1
  189. package/front_end/panels/issues/AffectedResourcesView.ts +2 -1
  190. package/front_end/panels/issues/IssueView.ts +0 -2
  191. package/front_end/panels/issues/IssuesPane.ts +1 -8
  192. package/front_end/panels/js_timeline/js_timeline-meta.ts +3 -2
  193. package/front_end/panels/layer_viewer/LayerViewHost.ts +1 -1
  194. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +3 -3
  195. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +5 -5
  196. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +4 -4
  197. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +2 -2
  198. package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +6 -6
  199. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +3 -3
  200. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +8 -9
  201. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplayUtils.ts +2 -2
  202. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -1
  203. package/front_end/panels/linear_memory_inspector/linear_memory_inspector-meta.ts +2 -2
  204. package/front_end/panels/network/NetworkDataGridNode.ts +124 -36
  205. package/front_end/panels/network/NetworkLogView.ts +9 -1
  206. package/front_end/panels/network/NetworkLogViewColumns.ts +18 -0
  207. package/front_end/panels/network/NetworkPanel.ts +2 -1
  208. package/front_end/panels/network/RequestPayloadView.ts +68 -20
  209. package/front_end/panels/network/RequestPreviewView.ts +7 -1
  210. package/front_end/panels/network/RequestTimingView.ts +95 -127
  211. package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -1
  212. package/front_end/panels/network/forward/UIFilter.ts +1 -0
  213. package/front_end/panels/network/requestPayloadView.css +10 -0
  214. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +12 -12
  215. package/front_end/panels/performance_monitor/performance_monitor-meta.ts +7 -7
  216. package/front_end/panels/profiler/HeapDetachedElementsView.ts +2 -2
  217. package/front_end/panels/profiler/HeapProfileView.ts +563 -51
  218. package/front_end/panels/profiler/HeapSnapshotView.ts +14 -9
  219. package/front_end/panels/profiler/ProfilesPanel.ts +13 -7
  220. package/front_end/panels/profiler/WritableProfileHeader.ts +152 -0
  221. package/front_end/panels/profiler/profiler.ts +2 -2
  222. package/front_end/panels/recorder/{components/ControlButton.ts → ControlButton.ts} +9 -10
  223. package/front_end/panels/recorder/{components/CreateRecordingView.ts → CreateRecordingView.ts} +59 -58
  224. package/front_end/panels/recorder/ExtensionView.ts +123 -0
  225. package/front_end/panels/recorder/RecorderController.ts +102 -92
  226. package/front_end/panels/recorder/{components/RecordingListView.ts → RecordingListView.ts} +22 -23
  227. package/front_end/panels/recorder/{components/RecordingView.ts → RecordingView.ts} +99 -96
  228. package/front_end/panels/recorder/{components/ReplaySection.ts → ReplaySection.ts} +20 -20
  229. package/front_end/panels/recorder/{components/SelectorPicker.ts → SelectorPicker.ts} +13 -13
  230. package/front_end/panels/recorder/{components/StepEditor.ts → StepEditor.ts} +367 -336
  231. package/front_end/panels/recorder/{components/StepView.ts → StepView.ts} +48 -49
  232. package/front_end/panels/recorder/{components/TimelineSection.ts → TimelineSection.ts} +2 -2
  233. package/front_end/panels/recorder/models/RecorderSettings.ts +2 -2
  234. package/front_end/panels/recorder/recorder-meta.ts +7 -7
  235. package/front_end/panels/recorder/recorder.ts +23 -1
  236. package/front_end/panels/recorder/{components/recordingView.css → recordingView.css} +1 -1
  237. package/front_end/panels/recorder/util/util.ts +113 -0
  238. package/front_end/panels/screencast/ScreencastApp.ts +1 -1
  239. package/front_end/panels/screencast/ScreencastView.ts +12 -12
  240. package/front_end/panels/search/SearchResultsPane.ts +4 -4
  241. package/front_end/panels/search/SearchView.ts +20 -20
  242. package/front_end/panels/security/SecurityModel.ts +7 -7
  243. package/front_end/panels/security/SecurityPanel.ts +99 -107
  244. package/front_end/panels/security/SecurityPanelSidebar.ts +7 -7
  245. package/front_end/panels/security/security-meta.ts +2 -2
  246. package/front_end/panels/sensors/LocationsSettingsTab.ts +19 -19
  247. package/front_end/panels/sensors/SensorsView.ts +27 -27
  248. package/front_end/panels/sensors/sensors-meta.ts +13 -167
  249. package/front_end/panels/settings/AISettingsTab.ts +98 -56
  250. package/front_end/panels/settings/EditFileSystemView.ts +2 -2
  251. package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +20 -20
  252. package/front_end/panels/settings/KeybindsSettingsTab.ts +20 -21
  253. package/front_end/panels/settings/SettingsScreen.ts +11 -11
  254. package/front_end/panels/settings/WorkspaceSettingsTab.ts +5 -5
  255. package/front_end/panels/settings/components/SyncSection.ts +12 -12
  256. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +13 -13
  257. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +31 -31
  258. package/front_end/panels/settings/emulation/emulation-meta.ts +1 -1
  259. package/front_end/panels/settings/settings-meta.ts +14 -14
  260. package/front_end/panels/sources/InplaceFormatterEditorAction.ts +2 -2
  261. package/front_end/panels/sources/NavigatorView.ts +7 -6
  262. package/front_end/panels/sources/ScopeChainSidebarPane.ts +83 -37
  263. package/front_end/panels/sources/SourcesNavigator.ts +22 -21
  264. package/front_end/panels/sources/SourcesView.ts +10 -1
  265. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
  266. package/front_end/panels/sources/scopeChainSidebarPane.css +12 -4
  267. package/front_end/panels/sources/sources-meta.ts +4 -4
  268. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +5 -2
  269. package/front_end/panels/timeline/IsolateSelector.ts +10 -8
  270. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +2 -1
  271. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +2 -1
  272. package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
  273. package/front_end/panels/timeline/TimelinePanel.ts +20 -8
  274. package/front_end/panels/timeline/TimelineUIUtils.ts +149 -131
  275. package/front_end/panels/timeline/components/NetworkRequestDetails.ts +4 -2
  276. package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +4 -2
  277. package/front_end/panels/timeline/components/insights/ImageRef.ts +2 -1
  278. package/front_end/panels/timeline/timeline-meta.ts +3 -2
  279. package/front_end/panels/utils/utils.ts +7 -3
  280. package/front_end/panels/web_audio/WebAudioView.ts +17 -18
  281. package/front_end/panels/web_audio/web_audio-meta.ts +3 -3
  282. package/front_end/panels/whats_new/ReleaseNoteView.ts +1 -1
  283. package/front_end/panels/whats_new/whats_new-meta.ts +11 -11
  284. package/front_end/third_party/chromium/README.chromium +1 -1
  285. package/front_end/third_party/lit/lib/async-directive.d.ts +2 -1
  286. package/front_end/third_party/lit/lib/async-directive.js +1 -1
  287. package/front_end/third_party/lit/lib/async-directive.js.map +1 -1
  288. package/front_end/third_party/lit/lib/decorators.d.ts +2 -1
  289. package/front_end/third_party/lit/lib/decorators.js.map +1 -1
  290. package/front_end/third_party/lit/lib/directive.d.ts +2 -1
  291. package/front_end/third_party/lit/lib/directive.js.map +1 -1
  292. package/front_end/third_party/lit/lib/directives.d.ts +2 -1
  293. package/front_end/third_party/lit/lib/directives.js +8 -8
  294. package/front_end/third_party/lit/lib/directives.js.map +1 -1
  295. package/front_end/third_party/lit/lib/lit.d.ts +2 -1
  296. package/front_end/third_party/lit/lib/lit.js +1 -1
  297. package/front_end/third_party/lit/lib/lit.js.map +1 -1
  298. package/front_end/third_party/lit/lib/static-html.d.ts +2 -1
  299. package/front_end/third_party/lit/lib/static-html.js +1 -1
  300. package/front_end/third_party/lit/lib/static-html.js.map +1 -1
  301. package/front_end/third_party/lit/package.json +2 -2
  302. package/front_end/third_party/lit/rebuild.sh +1 -1
  303. package/front_end/third_party/lit/src/async-directive.ts +5 -0
  304. package/front_end/ui/components/dialogs/Dialog.ts +1 -1
  305. package/front_end/ui/components/dialogs/ShortcutDialog.ts +1 -1
  306. package/front_end/ui/components/diff_view/DiffView.ts +2 -2
  307. package/front_end/ui/components/issue_counter/IssueCounter.ts +3 -3
  308. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +5 -5
  309. package/front_end/ui/components/lists/List.ts +2 -2
  310. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
  311. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +5 -5
  312. package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
  313. package/front_end/ui/components/snackbars/Snackbar.ts +1 -1
  314. package/front_end/ui/components/survey_link/SurveyLink.ts +3 -3
  315. package/front_end/ui/components/text_editor/config.ts +2 -2
  316. package/front_end/ui/components/tree_outline/TreeOutline.ts +34 -1
  317. package/front_end/ui/legacy/ReportView.ts +5 -0
  318. package/front_end/ui/legacy/Treeoutline.ts +6 -0
  319. package/front_end/ui/legacy/View.ts +1 -1
  320. package/front_end/ui/legacy/Widget.ts +14 -15
  321. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +2 -0
  322. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +8 -3
  323. package/front_end/ui/legacy/components/data_grid/data_grid.ts +1 -0
  324. package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +1 -1
  325. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +106 -38
  326. package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +7 -1
  327. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -1
  328. package/front_end/ui/legacy/components/utils/ImagePreview.ts +4 -2
  329. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +10 -1
  330. package/front_end/ui/legacy/inspectorCommon.css +5 -0
  331. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  332. package/mcp/mcp.ts +2 -0
  333. package/package.json +4 -4
  334. package/front_end/models/issues_manager/AttributionReportingIssue.ts +0 -247
  335. package/front_end/models/issues_manager/descriptions/arInsecureContext.md +0 -7
  336. package/front_end/models/issues_manager/descriptions/arInvalidInfoHeader.md +0 -5
  337. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsSourceHeader.md +0 -5
  338. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsTriggerHeader.md +0 -5
  339. package/front_end/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +0 -5
  340. package/front_end/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +0 -5
  341. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +0 -5
  342. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +0 -6
  343. package/front_end/models/issues_manager/descriptions/arNoRegisterOsSourceHeader.md +0 -5
  344. package/front_end/models/issues_manager/descriptions/arNoRegisterOsTriggerHeader.md +0 -5
  345. package/front_end/models/issues_manager/descriptions/arNoRegisterSourceHeader.md +0 -5
  346. package/front_end/models/issues_manager/descriptions/arNoRegisterTriggerHeader.md +0 -5
  347. package/front_end/models/issues_manager/descriptions/arNoWebOrOsSupport.md +0 -4
  348. package/front_end/models/issues_manager/descriptions/arOsSourceIgnored.md +0 -18
  349. package/front_end/models/issues_manager/descriptions/arOsTriggerIgnored.md +0 -19
  350. package/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +0 -8
  351. package/front_end/models/issues_manager/descriptions/arSourceAndTriggerHeaders.md +0 -9
  352. package/front_end/models/issues_manager/descriptions/arSourceIgnored.md +0 -13
  353. package/front_end/models/issues_manager/descriptions/arTriggerIgnored.md +0 -12
  354. package/front_end/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +0 -10
  355. package/front_end/models/issues_manager/descriptions/arWebAndOsHeaders.md +0 -11
  356. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +0 -182
  357. package/front_end/panels/profiler/ProfileView.ts +0 -611
  358. package/front_end/panels/recorder/components/ExtensionView.ts +0 -132
  359. package/front_end/panels/recorder/components/components.ts +0 -25
  360. package/front_end/panels/recorder/components/util.ts +0 -116
  361. /package/front_end/panels/recorder/{components/controlButton.css → controlButton.css} +0 -0
  362. /package/front_end/panels/recorder/{components/createRecordingView.css → createRecordingView.css} +0 -0
  363. /package/front_end/panels/recorder/{components/extensionView.css → extensionView.css} +0 -0
  364. /package/front_end/panels/recorder/{components/recordingListView.css → recordingListView.css} +0 -0
  365. /package/front_end/panels/recorder/{components/replaySection.css → replaySection.css} +0 -0
  366. /package/front_end/panels/recorder/{components/selectorPicker.css → selectorPicker.css} +0 -0
  367. /package/front_end/panels/recorder/{components/startView.css → startView.css} +0 -0
  368. /package/front_end/panels/recorder/{components/stepEditor.css → stepEditor.css} +0 -0
  369. /package/front_end/panels/recorder/{components/stepView.css → stepView.css} +0 -0
  370. /package/front_end/panels/recorder/{components/timelineSection.css → timelineSection.css} +0 -0
@@ -69,14 +69,14 @@ export class ServerTiming {
69
69
  this.description = description;
70
70
  }
71
71
 
72
- static parseHeaders(headers: NameValue[]): ServerTiming[]|null {
72
+ static parseHeaders(headers: NameValue[], devToolsConsole: Common.Console.Console): ServerTiming[]|null {
73
73
  const rawServerTimingHeaders = headers.filter(item => item.name.toLowerCase() === 'server-timing');
74
74
  if (!rawServerTimingHeaders.length) {
75
75
  return null;
76
76
  }
77
77
 
78
78
  const serverTimings = rawServerTimingHeaders.reduce<ServerTiming[]>((timings, header) => {
79
- const timing = this.createFromHeaderValue(header.value);
79
+ const timing = this.createFromHeaderValue(header.value, devToolsConsole);
80
80
  timings.push(...timing.map(function(entry) {
81
81
  return new ServerTiming(entry.name, entry.dur ?? null, entry.desc ?? '');
82
82
  }));
@@ -85,7 +85,9 @@ export class ServerTiming {
85
85
  return serverTimings;
86
86
  }
87
87
 
88
- static createFromHeaderValue(valueString: string): ServerTimingMetric[] {
88
+ static createFromHeaderValue(valueString: string,
89
+ devToolsConsole: Common.Console.Console = new Common.Console.Console()):
90
+ ServerTimingMetric[] {
89
91
  function trimLeadingWhiteSpace(): void {
90
92
  valueString = valueString.replace(/^\s*/, '');
91
93
  }
@@ -158,7 +160,7 @@ export class ServerTiming {
158
160
  const entry: ServerTimingMetric = {name};
159
161
 
160
162
  if (valueString.charAt(0) === '=') {
161
- this.showWarning(i18nString(UIStrings.deprecatedSyntaxFoundPleaseUse, {PH1: name}));
163
+ this.#showWarning(i18nString(UIStrings.deprecatedSyntaxFoundPleaseUse, {PH1: name}), devToolsConsole);
162
164
  }
163
165
 
164
166
  while (consumeDelimiter(';')) {
@@ -168,7 +170,7 @@ export class ServerTiming {
168
170
  }
169
171
 
170
172
  paramName = paramName.toLowerCase();
171
- const parseParameter = this.getParserForParameter(paramName);
173
+ const parseParameter = this.#getParserForParameter(paramName, devToolsConsole);
172
174
  let paramValue: (string|null)|null = null;
173
175
  if (consumeDelimiter('=')) {
174
176
  // always parse the value, even if we don't recognize the parameter #name
@@ -179,19 +181,19 @@ export class ServerTiming {
179
181
  if (parseParameter) {
180
182
  // paramName is valid
181
183
  if (entry.hasOwnProperty(paramName)) {
182
- this.showWarning(i18nString(UIStrings.duplicateParameterSIgnored, {PH1: paramName}));
184
+ this.#showWarning(i18nString(UIStrings.duplicateParameterSIgnored, {PH1: paramName}), devToolsConsole);
183
185
  continue;
184
186
  }
185
187
 
186
188
  if (paramValue === null) {
187
- this.showWarning(i18nString(UIStrings.noValueFoundForParameterS, {PH1: paramName}));
189
+ this.#showWarning(i18nString(UIStrings.noValueFoundForParameterS, {PH1: paramName}), devToolsConsole);
188
190
  }
189
191
 
190
192
  parseParameter.call(this, entry, paramValue);
191
193
  } else {
192
194
  // paramName is not valid
193
195
  // TODO(paulirish): consider showing other included params, like `start`: https://github.com/w3c/server-timing/issues/43
194
- this.showWarning(i18nString(UIStrings.unrecognizedParameterS, {PH1: paramName}));
196
+ this.#showWarning(i18nString(UIStrings.unrecognizedParameterS, {PH1: paramName}), devToolsConsole);
195
197
  }
196
198
  }
197
199
 
@@ -219,12 +221,13 @@ export class ServerTiming {
219
221
  }
220
222
 
221
223
  if (valueString.length) {
222
- this.showWarning(i18nString(UIStrings.extraneousTrailingCharacters));
224
+ this.#showWarning(i18nString(UIStrings.extraneousTrailingCharacters), devToolsConsole);
223
225
  }
224
226
  return result;
225
227
  }
226
228
 
227
- static getParserForParameter(paramName: string): ((arg0: ServerTimingMetric, arg1: string|null) => void)|null {
229
+ static #getParserForParameter(paramName: string, devToolsConsole: Common.Console.Console):
230
+ ((arg0: ServerTimingMetric, arg1: string|null) => void)|null {
228
231
  switch (paramName) {
229
232
  case 'dur': {
230
233
  function durParser(entry: ServerTimingMetric, paramValue: string|null): void {
@@ -232,7 +235,8 @@ export class ServerTiming {
232
235
  if (paramValue !== null) {
233
236
  const duration = parseFloat(paramValue);
234
237
  if (isNaN(duration)) {
235
- ServerTiming.showWarning(i18nString(UIStrings.unableToParseSValueS, {PH1: paramName, PH2: paramValue}));
238
+ ServerTiming.#showWarning(i18nString(UIStrings.unableToParseSValueS, {PH1: paramName, PH2: paramValue}),
239
+ devToolsConsole);
236
240
  return;
237
241
  }
238
242
  entry.dur = duration;
@@ -254,7 +258,7 @@ export class ServerTiming {
254
258
  }
255
259
  }
256
260
 
257
- static showWarning(msg: string): void {
258
- Common.Console.Console.instance().warn(`ServerTiming: ${msg}`);
261
+ static #showWarning(msg: string, devToolsConsole: Common.Console.Console): void {
262
+ devToolsConsole.warn(`ServerTiming: ${msg}`);
259
263
  }
260
264
  }
@@ -28,6 +28,7 @@ export class ServiceWorkerCacheModel extends SDKModel<EventTypes> implements Pro
28
28
  readonly cacheAgent: ProtocolProxyApi.CacheStorageApi;
29
29
  readonly #storageAgent: ProtocolProxyApi.StorageApi;
30
30
  readonly #storageBucketModel: StorageBucketsModel;
31
+ readonly #console: Common.Console.Console;
31
32
 
32
33
  readonly #caches = new Map<string, Cache>();
33
34
  readonly #storageKeysTracked = new Set<string>();
@@ -48,6 +49,7 @@ export class ServiceWorkerCacheModel extends SDKModel<EventTypes> implements Pro
48
49
  this.cacheAgent = target.cacheStorageAgent();
49
50
  this.#storageAgent = target.storageAgent();
50
51
  this.#storageBucketModel = (target.model(StorageBucketsModel) as StorageBucketsModel);
52
+ this.#console = target.targetManager().getConsole();
51
53
  }
52
54
 
53
55
  enable(): void {
@@ -101,8 +103,8 @@ export class ServiceWorkerCacheModel extends SDKModel<EventTypes> implements Pro
101
103
  async deleteCacheEntry(cache: Cache, request: string): Promise<void> {
102
104
  const response = await this.cacheAgent.invoke_deleteEntry({cacheId: cache.cacheId, request});
103
105
  if (response.getError()) {
104
- Common.Console.Console.instance().error(i18nString(
105
- UIStrings.serviceworkercacheagentError, {PH1: cache.toString(), PH2: String(response.getError())}));
106
+ this.#console.error(i18nString(UIStrings.serviceworkercacheagentError,
107
+ {PH1: cache.toString(), PH2: String(response.getError())}));
106
108
  return;
107
109
  }
108
110
  }
@@ -8,6 +8,7 @@ import * as Common from '../common/common.js';
8
8
  import * as i18n from '../i18n/i18n.js';
9
9
  import type * as Platform from '../platform/platform.js';
10
10
 
11
+ import {MultitargetNetworkManager} from './NetworkManager.js';
11
12
  import {Events as RuntimeModelEvents, type ExecutionContext, RuntimeModel} from './RuntimeModel.js';
12
13
  import {SDKModel} from './SDKModel.js';
13
14
  import {Capability, type Target, Type} from './Target.js';
@@ -70,23 +71,36 @@ export class ServiceWorkerManager extends SDKModel<EventTypes> {
70
71
  readonly #registrations = new Map<string, ServiceWorkerRegistration>();
71
72
  #enabled = false;
72
73
  readonly #forceUpdateSetting: Common.Settings.Setting<boolean>;
74
+ readonly #networkManager: MultitargetNetworkManager;
73
75
 
74
76
  constructor(target: Target) {
75
77
  super(target);
78
+ this.#networkManager = target.targetManager().getNetworkManager();
76
79
  target.registerServiceWorkerDispatcher(new ServiceWorkerDispatcher(this));
77
80
  this.#agent = target.serviceWorkerAgent();
78
81
  void this.enable();
79
- this.#forceUpdateSetting = this.target()
80
- .targetManager()
81
- .context.get(Common.Settings.Settings)
82
- .createSetting('service-worker-update-on-reload', false);
82
+ this.#forceUpdateSetting = target.targetManager().settings.createSetting('service-worker-update-on-reload', false);
83
83
  if (this.#forceUpdateSetting.get()) {
84
84
  this.forceUpdateSettingChanged();
85
85
  }
86
86
  this.#forceUpdateSetting.addChangeListener(this.forceUpdateSettingChanged, this);
87
+ this.#networkManager.addEventListener(
88
+ MultitargetNetworkManager.Events.CONDITIONS_CHANGED,
89
+ this.forceUpdateSettingChanged,
90
+ this,
91
+ );
87
92
  new ServiceWorkerContextNamer(target, this);
88
93
  }
89
94
 
95
+ override dispose(): void {
96
+ this.#networkManager.removeEventListener(
97
+ MultitargetNetworkManager.Events.CONDITIONS_CHANGED,
98
+ this.forceUpdateSettingChanged,
99
+ this,
100
+ );
101
+ super.dispose();
102
+ }
103
+
90
104
  async enable(): Promise<void> {
91
105
  if (this.#enabled) {
92
106
  return;
@@ -237,7 +251,7 @@ export class ServiceWorkerManager extends SDKModel<EventTypes> {
237
251
  }
238
252
 
239
253
  private forceUpdateSettingChanged(): void {
240
- const forceUpdateOnPageLoad = this.#forceUpdateSetting.get();
254
+ const forceUpdateOnPageLoad = this.#forceUpdateSetting.get() && !this.#networkManager.isOffline();
241
255
  void this.#agent.invoke_setForceUpdateOnPageLoad({forceUpdateOnPageLoad});
242
256
  }
243
257
  }
@@ -138,25 +138,25 @@ export class SourceMap {
138
138
  readonly #debugId?: DebugId;
139
139
 
140
140
  #scopesFallbackPromise?: Promise<void>;
141
+ readonly #console: Common.Console.Console;
141
142
 
142
143
  /**
143
144
  * Implements Source Map V3 model. See https://github.com/google/closure-compiler/wiki/Source-Maps
144
145
  * for format description.
145
146
  */
146
- constructor(
147
- compiledURL: Platform.DevToolsPath.UrlString, sourceMappingURL: Platform.DevToolsPath.UrlString,
148
- payload: SourceMapV3, script?: Script) {
147
+ constructor(compiledURL: Platform.DevToolsPath.UrlString, sourceMappingURL: Platform.DevToolsPath.UrlString,
148
+ payload: SourceMapV3, console: Common.Console.Console, script?: Script) {
149
149
  this.#json = payload;
150
150
  this.#script = script;
151
151
  this.#compiledURL = compiledURL;
152
152
  this.#sourceMappingURL = sourceMappingURL;
153
153
  this.#baseURL = (Common.ParsedURL.schemeIs(sourceMappingURL, 'data:')) ? compiledURL : sourceMappingURL;
154
154
  this.#debugId = 'debugId' in payload ? (payload.debugId as DebugId | undefined) : undefined;
155
+ this.#console = console;
155
156
 
156
157
  if ('sections' in this.#json) {
157
158
  if (this.#json.sections.find(section => 'url' in section)) {
158
- Common.Console.Console.instance().warn(
159
- `SourceMap "${sourceMappingURL}" contains unsupported "URL" field in one of its sections.`);
159
+ this.#console.warn(`SourceMap "${sourceMappingURL}" contains unsupported "URL" field in one of its sections.`);
160
160
  }
161
161
  }
162
162
  this.eachSection(this.parseSources.bind(this));
@@ -28,8 +28,9 @@ export class SourceMapManager<T extends FrameAssociated> extends Common.ObjectWr
28
28
  super();
29
29
 
30
30
  this.#target = target;
31
- this.#factory =
32
- factory ?? ((compiledURL, sourceMappingURL, payload) => new SourceMap(compiledURL, sourceMappingURL, payload));
31
+ this.#factory = factory ??
32
+ ((compiledURL, sourceMappingURL, payload) =>
33
+ new SourceMap(compiledURL, sourceMappingURL, payload, this.#target.targetManager().getConsole()));
33
34
  }
34
35
 
35
36
  setEnabled(isEnabled: boolean): void {
@@ -12,6 +12,7 @@ import * as Root from '../root/root.js';
12
12
 
13
13
  import {FrameManager} from './FrameManager.js';
14
14
  import {MultitargetNetworkManager} from './NetworkManager.js';
15
+ import {PageResourceLoader} from './PageResourceLoader.js';
15
16
  import {type RegistrationInfo, SDKModel, type SDKModelConstructor} from './SDKModel.js';
16
17
  import {Target, Type as TargetType} from './Target.js';
17
18
 
@@ -36,6 +37,7 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
36
37
  // TODO(crbug.com/493763857): Remove fallback once all unit tests use TestUniverse.
37
38
  getConsole(): Common.Console.Console {
38
39
  if ('has' in this.context && typeof this.context.has === 'function' && !this.context.has(Common.Console.Console)) {
40
+ // eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
39
41
  return Common.Console.Console.instance();
40
42
  }
41
43
  return this.context.get(Common.Console.Console);
@@ -44,6 +46,7 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
44
46
  // TODO(crbug.com/493763857): Remove fallback once all unit tests use TestUniverse.
45
47
  getFrameManager(): FrameManager {
46
48
  if ('has' in this.context && typeof this.context.has === 'function' && !this.context.has(FrameManager)) {
49
+ // eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
47
50
  return FrameManager.instance();
48
51
  }
49
52
  return this.context.get(FrameManager);
@@ -53,11 +56,21 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
53
56
  getNetworkManager(): MultitargetNetworkManager {
54
57
  if ('has' in this.context && typeof this.context.has === 'function' &&
55
58
  !this.context.has(MultitargetNetworkManager)) {
59
+ // eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
56
60
  return MultitargetNetworkManager.instance();
57
61
  }
58
62
  return this.context.get(MultitargetNetworkManager);
59
63
  }
60
64
 
65
+ // TODO(crbug.com/493763857): Remove fallback once all unit tests use TestUniverse.
66
+ getPageResourceLoader(): PageResourceLoader {
67
+ if ('has' in this.context && typeof this.context.has === 'function' && !this.context.has(PageResourceLoader)) {
68
+ // eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
69
+ return PageResourceLoader.instance();
70
+ }
71
+ return this.context.get(PageResourceLoader);
72
+ }
73
+
61
74
  /* eslint-disable @typescript-eslint/no-explicit-any */
62
75
  #modelListeners: Platform.MapUtilities.Multimap<string|symbol|number, {
63
76
  modelClass: SDKModelConstructor,
@@ -135,7 +148,7 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
135
148
  async #waitForPromiseWithTimeout(promise: Promise<void>, timeoutMessage: string): Promise<void> {
136
149
  const {promise: timeoutPromise, resolve: timeoutResolve} = Promise.withResolvers<void>();
137
150
  const timeoutId = globalThis.setTimeout(() => {
138
- Common.Console.Console.instance().warn(timeoutMessage);
151
+ this.getConsole().warn(timeoutMessage);
139
152
  timeoutResolve();
140
153
  }, 2000);
141
154
  await Promise.race([promise, timeoutPromise]);
@@ -10,6 +10,7 @@ import type {NetworkRequest} from './NetworkRequest.js';
10
10
  import type {RehydratingResource} from './RehydratingObject.js';
11
11
  import {ResourceTreeModel} from './ResourceTreeModel.js';
12
12
  import type {SourceMapV3} from './SourceMap.js';
13
+ import type {TargetManager} from './TargetManager.js';
13
14
 
14
15
  interface TraceObjectWithNoMetadata {
15
16
  readonly traceEvents: TraceObject['traceEvents'];
@@ -57,13 +58,14 @@ export class RevealableNetworkRequest {
57
58
  }
58
59
 
59
60
  // Only Trace.Types.Events.SyntheticNetworkRequest are passed in, but we can't depend on that type from SDK
60
- static create(event: unknown): RevealableNetworkRequest|null {
61
+ static create(targetManager: TargetManager, event: unknown): RevealableNetworkRequest|null {
61
62
  const syntheticNetworkRequest = event;
62
63
  // @ts-expect-error We don't have type checking here to confirm these events have .args.data.url.
63
64
  const url = syntheticNetworkRequest.args.data.url as Platform.DevToolsPath.UrlString;
64
65
  const urlWithoutHash = Common.ParsedURL.ParsedURL.urlWithoutHash(url) as Platform.DevToolsPath.UrlString;
65
66
 
66
- const resource = ResourceTreeModel.resourceForURL(url) ?? ResourceTreeModel.resourceForURL(urlWithoutHash);
67
+ const resource = ResourceTreeModel.resourceForURL(targetManager, url) ??
68
+ ResourceTreeModel.resourceForURL(targetManager, urlWithoutHash);
67
69
  const sdkNetworkRequest = resource?.request;
68
70
  return sdkNetworkRequest ? new RevealableNetworkRequest(sdkNetworkRequest) : null;
69
71
  }
@@ -166,6 +166,71 @@ const UIStrings = {
166
166
  * @description A drop-down menu option to do not emulate css media type
167
167
  */
168
168
  noEmulation: 'No emulation',
169
+ /**
170
+ * @description Text for the CPU Pressure type to simulate on a device.
171
+ */
172
+ cpuPressure: 'CPU Pressure',
173
+ /**
174
+ * @description Title of an option in Sensors tab cpu pressure emulation drop-down. Turns off emulation of cpu pressure state.
175
+ */
176
+ noPressureEmulation: 'No override',
177
+ /**
178
+ * @description An option that appears in a drop-down that represents the nominal state.
179
+ */
180
+ nominal: 'Nominal',
181
+ /**
182
+ * @description An option that appears in a drop-down that represents the fair state.
183
+ */
184
+ fair: 'Fair',
185
+ /**
186
+ * @description An option that appears in a drop-down that represents the serious state.
187
+ */
188
+ serious: 'Serious',
189
+ /**
190
+ * @description An option that appears in a drop-down that represents the critical state.
191
+ */
192
+ critical: 'Critical',
193
+ /**
194
+ * @description Text for the touch type to simulate on a device. Refers to touch input as opposed to
195
+ * mouse input.
196
+ */
197
+ touch: 'Touch',
198
+ /**
199
+ * @description Text in Sensors View of the Device Toolbar. Means that touch input will be forced
200
+ *on, even if the device type e.g. desktop computer does not normally have touch input.
201
+ */
202
+ forceEnabled: 'Force enabled',
203
+ /**
204
+ * @description Text in Sensors View of the Device Toolbar. Refers to device-based touch input,
205
+ *which means the input type will be 'touch' only if the device normally has touch input e.g. a
206
+ *phone or tablet.
207
+ */
208
+ devicebased: 'Device-based',
209
+ /**
210
+ * @description Title of a section option in Sensors tab for idle emulation. This is a command, to
211
+ *emulate the state of the 'Idle Detector'.
212
+ */
213
+ emulateIdleDetectorState: 'Emulate Idle Detector state',
214
+ /**
215
+ * @description Title of an option in Sensors tab idle emulation drop-down. Turns off emulation of idle state.
216
+ */
217
+ noIdleEmulation: 'No idle emulation',
218
+ /**
219
+ * @description Title of an option in Sensors tab idle emulation drop-down.
220
+ */
221
+ userActiveScreenUnlocked: 'User active, screen unlocked',
222
+ /**
223
+ * @description Title of an option in Sensors tab idle emulation drop-down.
224
+ */
225
+ userActiveScreenLocked: 'User active, screen locked',
226
+ /**
227
+ * @description Title of an option in Sensors tab idle emulation drop-down.
228
+ */
229
+ userIdleScreenUnlocked: 'User idle, screen unlocked',
230
+ /**
231
+ * @description Title of an option in Sensors tab idle emulation drop-down.
232
+ */
233
+ userIdleScreenLocked: 'User idle, screen locked',
169
234
  /**
170
235
  * @description Title of a setting under the Rendering category that can be invoked through the Command Menu
171
236
  */
@@ -419,6 +484,13 @@ const UIStrings = {
419
484
  * @description Title of a setting under the Elements category in Settings.
420
485
  */
421
486
  apca: 'Advanced Perceptual Contrast Algorithm (APCA) replacing previous contrast ratio and AA/AAA guidelines',
487
+ /**
488
+ * @description Title of a setting under the Appearance category in Settings. When the webpage is
489
+ * paused by devtools, an overlay is shown on top of the page to indicate that it is paused. The
490
+ * overlay is a pause/unpause button and some text, which appears on top of the paused page. This
491
+ * setting turns off this overlay.
492
+ */
493
+ disablePaused: 'Disable paused state overlay',
422
494
  } as const;
423
495
  const str_ = i18n.i18n.registerUIStrings('core/sdk/sdk-meta.ts', UIStrings);
424
496
  const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
@@ -785,6 +857,95 @@ Common.Settings.registerSettingExtension({
785
857
  title: i18nLazyString(UIStrings.emulateCssMediaType),
786
858
  });
787
859
 
860
+ Common.Settings.registerSettingExtension({
861
+ title: i18nLazyString(UIStrings.cpuPressure),
862
+ reloadRequired: true,
863
+ settingName: 'emulation.cpu-pressure',
864
+ settingType: Common.Settings.SettingType.ENUM,
865
+ defaultValue: 'none',
866
+ options: [
867
+ {
868
+ value: 'none',
869
+ title: i18nLazyString(UIStrings.noPressureEmulation),
870
+ text: i18nLazyString(UIStrings.noPressureEmulation),
871
+ },
872
+ {
873
+ value: 'nominal',
874
+ title: i18nLazyString(UIStrings.nominal),
875
+ text: i18nLazyString(UIStrings.nominal),
876
+ },
877
+ {
878
+ value: 'fair',
879
+ title: i18nLazyString(UIStrings.fair),
880
+ text: i18nLazyString(UIStrings.fair),
881
+ },
882
+ {
883
+ value: 'serious',
884
+ title: i18nLazyString(UIStrings.serious),
885
+ text: i18nLazyString(UIStrings.serious),
886
+ },
887
+ {
888
+ value: 'critical',
889
+ title: i18nLazyString(UIStrings.critical),
890
+ text: i18nLazyString(UIStrings.critical),
891
+ },
892
+ ],
893
+ });
894
+
895
+ Common.Settings.registerSettingExtension({
896
+ title: i18nLazyString(UIStrings.touch),
897
+ reloadRequired: true,
898
+ settingName: 'emulation.touch',
899
+ settingType: Common.Settings.SettingType.ENUM,
900
+ defaultValue: 'none',
901
+ options: [
902
+ {
903
+ value: 'none',
904
+ title: i18nLazyString(UIStrings.devicebased),
905
+ text: i18nLazyString(UIStrings.devicebased),
906
+ },
907
+ {
908
+ value: 'force',
909
+ title: i18nLazyString(UIStrings.forceEnabled),
910
+ text: i18nLazyString(UIStrings.forceEnabled),
911
+ },
912
+ ],
913
+ });
914
+
915
+ Common.Settings.registerSettingExtension({
916
+ title: i18nLazyString(UIStrings.emulateIdleDetectorState),
917
+ settingName: 'emulation.idle-detection',
918
+ settingType: Common.Settings.SettingType.ENUM,
919
+ defaultValue: 'none',
920
+ options: [
921
+ {
922
+ value: 'none',
923
+ title: i18nLazyString(UIStrings.noIdleEmulation),
924
+ text: i18nLazyString(UIStrings.noIdleEmulation),
925
+ },
926
+ {
927
+ value: '{\"isUserActive\":true,\"isScreenUnlocked\":true}',
928
+ title: i18nLazyString(UIStrings.userActiveScreenUnlocked),
929
+ text: i18nLazyString(UIStrings.userActiveScreenUnlocked),
930
+ },
931
+ {
932
+ value: '{\"isUserActive\":true,\"isScreenUnlocked\":false}',
933
+ title: i18nLazyString(UIStrings.userActiveScreenLocked),
934
+ text: i18nLazyString(UIStrings.userActiveScreenLocked),
935
+ },
936
+ {
937
+ value: '{\"isUserActive\":false,\"isScreenUnlocked\":true}',
938
+ title: i18nLazyString(UIStrings.userIdleScreenUnlocked),
939
+ text: i18nLazyString(UIStrings.userIdleScreenUnlocked),
940
+ },
941
+ {
942
+ value: '{\"isUserActive\":false,\"isScreenUnlocked\":false}',
943
+ title: i18nLazyString(UIStrings.userIdleScreenLocked),
944
+ text: i18nLazyString(UIStrings.userIdleScreenLocked),
945
+ },
946
+ ],
947
+ });
948
+
788
949
  Common.Settings.registerSettingExtension({
789
950
  category: Common.Settings.SettingCategory.RENDERING,
790
951
  settingName: 'emulated-css-media-feature-prefers-color-scheme',
@@ -1277,3 +1438,12 @@ Common.Settings.registerSettingExtension({
1277
1438
  settingType: Common.Settings.SettingType.BOOLEAN,
1278
1439
  defaultValue: false,
1279
1440
  });
1441
+
1442
+ Common.Settings.registerSettingExtension({
1443
+ category: Common.Settings.SettingCategory.APPEARANCE,
1444
+ storageType: Common.Settings.SettingStorageType.SYNCED,
1445
+ title: i18nLazyString(UIStrings.disablePaused),
1446
+ settingName: 'disable-paused-state-overlay',
1447
+ settingType: Common.Settings.SettingType.BOOLEAN,
1448
+ defaultValue: false,
1449
+ });
@@ -644,11 +644,6 @@
644
644
  --source-code-font-family: ahem;
645
645
  }
646
646
 
647
- &.platform-screenshot-e2e-test {
648
- --default-font-family: roboto;
649
- --monospace-font-family: roboto;
650
- --source-code-font-family: roboto;
651
- }
652
647
 
653
648
  --ref-typeface-weight-regular: 400;
654
649
  --ref-typeface-weight-medium: 500;
@@ -29,8 +29,11 @@ export class FormattedContentBuilder {
29
29
  addToken(token: string, offset: number): void {
30
30
  // Skip the regex check if `addSoftSpace` will be a no-op.
31
31
  if (this.#enforceSpaceBetweenWords && !this.#hardSpaces && !this.#softSpace) {
32
- const lastCharOfLastToken = this.#formattedContent.at(-1)?.at(-1) ?? '';
33
- if (this.#canBeIdentifierOrNumber.test(lastCharOfLastToken) && this.#canBeIdentifierOrNumber.test(token)) {
32
+ const lastToken = this.#formattedContent.at(-1) ?? '';
33
+ const lastCharOfLastToken = lastToken.at(-1) ?? '';
34
+ if ((this.#canBeIdentifierOrNumber.test(lastCharOfLastToken) ||
35
+ ['`', '}', ')', ']', '\'', '"', '/'].includes(lastCharOfLastToken)) &&
36
+ this.#canBeIdentifierOrNumber.test(token)) {
34
37
  this.addSoftSpace();
35
38
  }
36
39
  }
@@ -107,10 +107,16 @@ export class HTMLFormatter {
107
107
  }
108
108
 
109
109
  #formatToken(element: FormatterElement, token: Token): void {
110
- if (Platform.StringUtilities.isWhitespace(token.value)) {
110
+ const isBodyToken =
111
+ Boolean(element.openTag && !element.openTag.selfClosingTag && element.closeTag &&
112
+ element.openTag.endOffset <= token.startOffset && token.startOffset < element.closeTag.startOffset);
113
+ if (Platform.StringUtilities.isWhitespace(token.value) &&
114
+ (!isBodyToken || element.children.length > 0 ||
115
+ (!element.hasContent && !element.hasComments && /[\r\n]/.test(token.value)))) {
111
116
  return;
112
117
  }
113
- if (hasTokenInSet(token.type, 'comment') || hasTokenInSet(token.type, 'meta')) {
118
+ if ((hasTokenInSet(token.type, 'comment') || hasTokenInSet(token.type, 'meta')) &&
119
+ (!isBodyToken || element.children.length > 0)) {
114
120
  this.#builder.addNewLine();
115
121
  this.#builder.addToken(token.value.trim(), token.startOffset);
116
122
  this.#builder.addNewLine();
@@ -121,8 +127,6 @@ export class HTMLFormatter {
121
127
  return;
122
128
  }
123
129
 
124
- const isBodyToken =
125
- element.openTag.endOffset <= token.startOffset && token.startOffset < element.closeTag.startOffset;
126
130
  if (isBodyToken && element.name === 'style') {
127
131
  this.#builder.addNewLine();
128
132
  this.#builder.increaseNestingLevel();
@@ -149,7 +153,15 @@ export class HTMLFormatter {
149
153
  this.#builder.addSoftSpace();
150
154
  }
151
155
 
156
+ // When adding tag brackets and tag names (<, </, /, div, >), disable word space enforcement so
157
+ // that FormattedContentBuilder does not insert unwanted spaces (e.g. splitting </title> into </ title>).
158
+ const restore = !isBodyToken && !hasTokenInSet(token.type, 'attribute') ?
159
+ this.#builder.setEnforceSpaceBetweenWords(false) :
160
+ false;
152
161
  this.#builder.addToken(token.value, token.startOffset);
162
+ if (!isBodyToken && !hasTokenInSet(token.type, 'attribute')) {
163
+ this.#builder.setEnforceSpaceBetweenWords(restore);
164
+ }
153
165
  }
154
166
  }
155
167
 
@@ -260,6 +272,14 @@ export class HTMLModel {
260
272
  this.#updateDOM(token);
261
273
 
262
274
  const element = this.#stack[this.#stack.length - 1];
275
+ if (element && (hasTokenInSet(token.type, 'comment') || hasTokenInSet(token.type, 'meta'))) {
276
+ element.hasComments = true;
277
+ }
278
+ if (element && !Platform.StringUtilities.isWhitespace(token.value) && !hasTokenInSet(token.type, 'tag') &&
279
+ !hasTokenInSet(token.type, 'attribute') && !hasTokenInSet(token.type, 'bracket') &&
280
+ !hasTokenInSet(token.type, 'comment') && !hasTokenInSet(token.type, 'meta')) {
281
+ element.hasContent = true;
282
+ }
263
283
  if (element && (element.name === 'script' || element.name === 'style') &&
264
284
  element.openTag?.endOffset === lastOffset) {
265
285
  return AbortTokenization;
@@ -585,6 +605,8 @@ class FormatterElement {
585
605
  parent: FormatterElement|null = null;
586
606
  openTag: Tag|null = null;
587
607
  closeTag: Tag|null = null;
608
+ hasComments = false;
609
+ hasContent = false;
588
610
 
589
611
  constructor(name: string) {
590
612
  this.name = name;
@@ -82,11 +82,12 @@ export class JavaScriptFormatter {
82
82
  const format = this.#formatToken(node.parent, token);
83
83
  this.#push(token, format);
84
84
  }
85
+ if (node.parent?.type === 'TemplateLiteral' && node.type !== 'TemplateElement' && node.type !== 'TemplateLiteral') {
86
+ this.#builder.setEnforceSpaceBetweenWords(true);
87
+ }
85
88
  }
86
89
 
87
90
  #afterVisit(node: Acorn.ESTree.Node): void {
88
- // ${expressions} within a template literal need space enforced.
89
- const restore = this.#builder.setEnforceSpaceBetweenWords(node.type !== 'TemplateElement');
90
91
  let token;
91
92
  while ((token = this.#tokenizer.peekToken()) && token.start < node.end) {
92
93
  const token = (this.#tokenizer.nextToken() as TokenOrComment);
@@ -94,7 +95,11 @@ export class JavaScriptFormatter {
94
95
  this.#push(token, format);
95
96
  }
96
97
  this.#push(null, this.#finishNode(node));
97
- this.#builder.setEnforceSpaceBetweenWords(restore || node.type === 'TemplateLiteral');
98
+ if (node.parent?.type === 'TemplateLiteral' && node.type !== 'TemplateElement' && node.type !== 'TemplateLiteral') {
99
+ this.#builder.setEnforceSpaceBetweenWords(false);
100
+ } else if (node.type === 'TemplateLiteral' && node.parent?.type !== 'TemplateLiteral') {
101
+ this.#builder.setEnforceSpaceBetweenWords(true);
102
+ }
98
103
  }
99
104
 
100
105
  #inForLoopHeader(node: Acorn.ESTree.Node): boolean {
@@ -39,7 +39,7 @@ const UIStrings = {
39
39
  */
40
40
  javascriptIsDisabled: 'JavaScript is disabled',
41
41
  /**
42
- * @description A message that prompts the user to open devtools for a specific environment (Node.js)
42
+ * @description Tooltip for the Node.js indicator prompting the user to open dedicated DevTools for Node.js.
43
43
  */
44
44
  openDedicatedTools: 'Open dedicated DevTools for `Node.js`',
45
45
  } as const;
@@ -107,7 +107,7 @@ export class InspectorMainImpl implements Common.Runnable.Runnable {
107
107
 
108
108
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(
109
109
  Host.InspectorFrontendHostAPI.Events.ReloadInspectedPage, ({data: hard}) => {
110
- SDK.ResourceTreeModel.ResourceTreeModel.reloadAllPages(hard);
110
+ SDK.ResourceTreeModel.ResourceTreeModel.reloadAllPages(SDK.TargetManager.TargetManager.instance(), hard);
111
111
  });
112
112
  }
113
113
  }
@@ -118,10 +118,10 @@ export class ReloadActionDelegate implements UI.ActionRegistration.ActionDelegat
118
118
  handleAction(_context: UI.Context.Context, actionId: string): boolean {
119
119
  switch (actionId) {
120
120
  case 'inspector-main.reload':
121
- SDK.ResourceTreeModel.ResourceTreeModel.reloadAllPages(false);
121
+ SDK.ResourceTreeModel.ResourceTreeModel.reloadAllPages(SDK.TargetManager.TargetManager.instance(), false);
122
122
  return true;
123
123
  case 'inspector-main.hard-reload':
124
- SDK.ResourceTreeModel.ResourceTreeModel.reloadAllPages(true);
124
+ SDK.ResourceTreeModel.ResourceTreeModel.reloadAllPages(SDK.TargetManager.TargetManager.instance(), true);
125
125
  return true;
126
126
  }
127
127
  return false;