chrome-devtools-frontend 1.0.1684555 → 1.0.1689415

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 (602) hide show
  1. package/.agents/skills/gerrit-cli/SKILL.md +29 -8
  2. package/.agents/skills/gerrit-cli/references/commands.md +51 -18
  3. package/.agents/skills/gerrit-cli/references/workflows.md +6 -6
  4. package/.agents/skills/gerrit-cli/scripts/import_upstream.py +43 -70
  5. package/config/typescript/tsconfig.base.json +1 -0
  6. package/config/typescript/tsconfig.eslint.json +9 -0
  7. package/docs/contributing/issues.md +1 -1
  8. package/docs/styleguide/ux/writing.md +2 -2
  9. package/eslint.config.mjs +18 -10
  10. package/front_end/core/common/Base64.ts +1 -1
  11. package/front_end/core/common/Color.ts +28 -6
  12. package/front_end/core/common/ColorConverter.ts +12 -0
  13. package/front_end/core/common/Console.ts +2 -1
  14. package/front_end/core/common/Object.ts +2 -2
  15. package/front_end/core/common/ResourceType.ts +12 -13
  16. package/front_end/core/common/Revealer.ts +1 -1
  17. package/front_end/core/common/Settings.ts +2 -2
  18. package/front_end/core/common/TextDictionary.ts +2 -2
  19. package/front_end/core/common/Throttler.ts +1 -1
  20. package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -2
  21. package/front_end/core/host/UserMetrics.ts +51 -37
  22. package/front_end/core/host/host.ts +1 -1
  23. package/front_end/core/i18n/i18nImpl.ts +1 -1
  24. package/front_end/core/platform/HostRuntime.ts +3 -3
  25. package/front_end/core/platform/KeyboardUtilities.ts +1 -1
  26. package/front_end/core/protocol_client/InspectorBackend.ts +7 -6
  27. package/front_end/core/root/Runtime.ts +4 -2
  28. package/front_end/core/sdk/AnimationModel.ts +1 -1
  29. package/front_end/core/sdk/CPUThrottlingManager.ts +198 -0
  30. package/front_end/core/sdk/CSSMetadata.ts +11 -6
  31. package/front_end/core/sdk/CSSPropertyParser.ts +5 -3
  32. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +90 -59
  33. package/front_end/core/sdk/ConsoleModel.ts +1 -1
  34. package/front_end/core/sdk/DOMModel.ts +3 -3
  35. package/front_end/core/sdk/DebuggerModel.ts +1 -1
  36. package/front_end/core/sdk/EmulationModel.ts +5 -0
  37. package/front_end/core/sdk/LayerTreeBase.ts +1 -1
  38. package/front_end/core/sdk/NetworkManager.ts +1 -1
  39. package/front_end/core/sdk/README.md +40 -0
  40. package/front_end/core/sdk/RehydratingConnection.ts +1 -1
  41. package/front_end/core/sdk/RemoteObject.ts +1 -1
  42. package/front_end/core/sdk/ResourceTreeModel.ts +2 -2
  43. package/front_end/core/sdk/SDKModel.ts +1 -1
  44. package/front_end/core/sdk/SDKSettings.ts +6 -0
  45. package/front_end/core/sdk/Script.ts +2 -1
  46. package/front_end/core/sdk/SecurityOrigin.ts +48 -0
  47. package/front_end/core/sdk/ServiceWorkerManager.ts +75 -17
  48. package/front_end/core/sdk/sdk.ts +2 -0
  49. package/front_end/core/text_utils/ContentData.ts +1 -1
  50. package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +3 -1
  51. package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +1 -1
  52. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +2 -2
  53. package/front_end/entrypoints/formatter_worker/Substitute.ts +1 -1
  54. package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -1
  55. package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -1
  56. package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +1 -1
  57. package/front_end/entrypoints/inspector_main/nodeIcon.css +1 -1
  58. package/front_end/entrypoints/inspector_main/outermostTargetSelector.css +3 -3
  59. package/front_end/entrypoints/inspector_main/renderingOptions.css +3 -3
  60. package/front_end/entrypoints/js_app/js_app.ts +25 -9
  61. package/front_end/entrypoints/node_app/app/nodeConnectionsPanel.css +5 -5
  62. package/front_end/entrypoints/node_app/node_app.ts +1 -1
  63. package/front_end/generated/ARIAProperties.ts +39 -1
  64. package/front_end/generated/InspectorBackendCommands.ts +2 -1
  65. package/front_end/generated/SupportedCSSProperties.ts +60 -119
  66. package/front_end/generated/protocol-mapping.d.ts +9 -0
  67. package/front_end/generated/protocol-proxy-api.d.ts +7 -0
  68. package/front_end/generated/protocol.ts +12 -2
  69. package/front_end/models/ai_assistance/AiAgent2.ts +13 -7
  70. package/front_end/models/ai_assistance/AiConversation.ts +8 -17
  71. package/front_end/models/ai_assistance/AiHistoryStorage.ts +2 -2
  72. package/front_end/models/ai_assistance/AiUtils.ts +16 -0
  73. package/front_end/models/ai_assistance/EvaluateAction.ts +1 -1
  74. package/front_end/models/ai_assistance/README.md +1 -1
  75. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +2 -3
  76. package/front_end/models/ai_assistance/agents/AiAgent.ts +29 -6
  77. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +4 -3
  78. package/front_end/models/ai_assistance/agents/FileAgent.ts +2 -2
  79. package/front_end/models/ai_assistance/agents/NetworkAgent.ts +2 -2
  80. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +1 -1
  81. package/front_end/models/ai_assistance/agents/StorageAgent.ts +7 -5
  82. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
  83. package/front_end/models/ai_assistance/agents/StylingAgent.ts +9 -7
  84. package/front_end/models/ai_assistance/ai_assistance.ts +8 -0
  85. package/front_end/models/ai_assistance/contexts/AccessibilityContext.ts +16 -1
  86. package/front_end/models/ai_assistance/contexts/FileContext.ts +6 -0
  87. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +150 -325
  88. package/front_end/models/ai_assistance/injected.ts +5 -3
  89. package/front_end/models/ai_assistance/performance/AIContext.ts +1 -1
  90. package/front_end/models/ai_assistance/skills/README.md +1 -1
  91. package/front_end/models/ai_assistance/skills/accessibility.md +19 -10
  92. package/front_end/models/ai_assistance/skills/network.md +13 -7
  93. package/front_end/models/ai_assistance/skills/performance.md +22 -16
  94. package/front_end/models/ai_assistance/skills/sources.md +13 -7
  95. package/front_end/models/ai_assistance/skills/storage.md +19 -18
  96. package/front_end/models/ai_assistance/skills/styling.md +30 -37
  97. package/front_end/models/ai_assistance/tools/CookieUtils.ts +120 -0
  98. package/front_end/models/ai_assistance/tools/DOMStorageUtils.ts +53 -4
  99. package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +8 -32
  100. package/front_end/models/ai_assistance/tools/GetCookieValues.ts +146 -0
  101. package/front_end/models/ai_assistance/tools/GetDetailedCallTree.ts +11 -9
  102. package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +17 -5
  103. package/front_end/models/ai_assistance/tools/GetFunctionCode.ts +12 -11
  104. package/front_end/models/ai_assistance/tools/GetInsightDetails.ts +11 -11
  105. package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +3 -2
  106. package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +3 -3
  107. package/front_end/models/ai_assistance/tools/GetResourceContent.ts +12 -12
  108. package/front_end/models/ai_assistance/tools/GetSourceContent.ts +3 -2
  109. package/front_end/models/ai_assistance/tools/GetStorageBreakdown.ts +132 -0
  110. package/front_end/models/ai_assistance/tools/GetStorageValues.ts +17 -4
  111. package/front_end/models/ai_assistance/tools/GetStyles.ts +3 -3
  112. package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +9 -8
  113. package/front_end/models/ai_assistance/tools/GetTraceMainThreadSummary.ts +13 -14
  114. package/front_end/models/ai_assistance/tools/GetTraceNetworkSummary.ts +12 -10
  115. package/front_end/models/ai_assistance/tools/ListCookies.ts +93 -0
  116. package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +15 -6
  117. package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +3 -3
  118. package/front_end/models/ai_assistance/tools/ListSources.ts +5 -3
  119. package/front_end/models/ai_assistance/tools/ListStorageKeys.ts +16 -4
  120. package/front_end/models/ai_assistance/tools/RecordPerformanceTrace.ts +3 -2
  121. package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +4 -3
  122. package/front_end/models/ai_assistance/tools/RunLighthouse.ts +9 -9
  123. package/front_end/models/ai_assistance/tools/SelectTraceEventByKey.ts +9 -8
  124. package/front_end/models/ai_assistance/tools/Tool.ts +21 -11
  125. package/front_end/models/ai_assistance/tools/ToolRegistry.ts +41 -8
  126. package/front_end/models/badges/AiExplorerBadge.ts +3 -3
  127. package/front_end/models/badges/CodeWhispererBadge.ts +2 -2
  128. package/front_end/models/badges/DOMDetectiveBadge.ts +3 -3
  129. package/front_end/models/badges/SpeedsterBadge.ts +3 -3
  130. package/front_end/models/badges/StarterBadge.ts +4 -4
  131. package/front_end/models/bindings/CompilerScriptMapping.ts +11 -2
  132. package/front_end/models/bindings/ContentProviderBasedProject.ts +3 -2
  133. package/front_end/models/breakpoints/BreakpointManager.ts +1 -1
  134. package/front_end/models/emulation/EmulatedDevices.ts +2 -2
  135. package/front_end/models/formatter/FormatterWorkerPool.ts +2 -2
  136. package/front_end/models/formatter/ScriptFormatter.ts +1 -2
  137. package/front_end/models/geometry/GeometryImpl.ts +2 -2
  138. package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +1 -1
  139. package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +3 -2
  140. package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +5 -5
  141. package/front_end/models/issues_manager/GenericIssue.ts +18 -18
  142. package/front_end/models/issues_manager/StylesheetLoadingIssue.ts +1 -1
  143. package/front_end/models/javascript_metadata/{NativeFunctions.js → NativeFunctions.ts} +25 -9
  144. package/front_end/models/live-metrics/LiveMetrics.ts +9 -3
  145. package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +58 -6
  146. package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +2 -62
  147. package/front_end/models/network_time_calculator/RequestTimeRanges.ts +2 -2
  148. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +5 -0
  149. package/front_end/models/persistence/IsolatedFileSystem.ts +1 -1
  150. package/front_end/models/persistence/NetworkPersistenceManager.ts +35 -6
  151. package/front_end/models/stack_trace/StackTraceImpl.ts +2 -2
  152. package/front_end/models/trace/LanternComputationData.ts +2 -3
  153. package/front_end/models/trace/extras/StackTraceForEvent.ts +3 -2
  154. package/front_end/models/trace/extras/ThirdParties.ts +9 -9
  155. package/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +7 -4
  156. package/front_end/models/trace/handlers/FramesHandler.ts +3 -3
  157. package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -2
  158. package/front_end/models/trace/handlers/SamplesHandler.ts +4 -2
  159. package/front_end/models/trace/handlers/UserInteractionsHandler.ts +1 -1
  160. package/front_end/models/trace/handlers/WarningsHandler.ts +2 -2
  161. package/front_end/models/trace/helpers/Network.ts +3 -3
  162. package/front_end/models/trace/helpers/Trace.ts +1 -1
  163. package/front_end/models/trace/insights/CLSCulprits.ts +2 -1
  164. package/front_end/models/trace/insights/Cache.ts +3 -1
  165. package/front_end/models/trace/insights/CharacterSet.ts +3 -1
  166. package/front_end/models/trace/insights/DOMSize.ts +3 -1
  167. package/front_end/models/trace/insights/DocumentLatency.ts +3 -1
  168. package/front_end/models/trace/insights/DuplicatedJavaScript.ts +3 -1
  169. package/front_end/models/trace/insights/FontDisplay.ts +2 -1
  170. package/front_end/models/trace/insights/ForcedReflow.ts +2 -1
  171. package/front_end/models/trace/insights/INPBreakdown.ts +3 -1
  172. package/front_end/models/trace/insights/ImageDelivery.ts +3 -1
  173. package/front_end/models/trace/insights/LCPBreakdown.ts +3 -1
  174. package/front_end/models/trace/insights/LCPDiscovery.ts +3 -1
  175. package/front_end/models/trace/insights/LegacyJavaScript.ts +3 -1
  176. package/front_end/models/trace/insights/ModernHTTP.ts +2 -1
  177. package/front_end/models/trace/insights/NetworkDependencyTree.ts +2 -1
  178. package/front_end/models/trace/insights/RenderBlocking.ts +5 -4
  179. package/front_end/models/trace/insights/SlowCSSSelector.ts +3 -1
  180. package/front_end/models/trace/insights/ThirdParties.ts +5 -3
  181. package/front_end/models/trace/insights/Viewport.ts +2 -1
  182. package/front_end/models/trace/lantern/simulation/Constants.ts +34 -2
  183. package/front_end/models/trace/lantern/simulation/DNSCache.ts +1 -1
  184. package/front_end/models/trace/types/TraceEvents.ts +8 -3
  185. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +2 -1
  186. package/front_end/models/workspace/WorkspaceImpl.ts +18 -2
  187. package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +686 -2
  188. package/front_end/panels/accessibility/accessibilityNode.css +4 -4
  189. package/front_end/panels/accessibility/accessibilityProperties.css +1 -1
  190. package/front_end/panels/accessibility/accessibilitySidebarView.css +2 -2
  191. package/front_end/panels/accessibility/axBreadcrumbs.css +13 -13
  192. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +14 -14
  193. package/front_end/panels/ai_assistance/ExternalHandler.ts +1 -1
  194. package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -1
  195. package/front_end/panels/ai_assistance/components/ChatInput.ts +3 -2
  196. package/front_end/panels/ai_assistance/components/ChatView.ts +1 -1
  197. package/front_end/panels/ai_assistance/components/DisabledWidget.ts +1 -1
  198. package/front_end/panels/ai_assistance/components/ExploreWidget.ts +1 -1
  199. package/front_end/panels/ai_assistance/components/chatInput.css +12 -12
  200. package/front_end/panels/ai_assistance/components/chatMessage.css +16 -16
  201. package/front_end/panels/ai_assistance/components/chatView.css +2 -2
  202. package/front_end/panels/ai_assistance/components/exploreWidget.css +1 -1
  203. package/front_end/panels/ai_assistance/components/exportForAgentsDialog.css +4 -0
  204. package/front_end/panels/ai_assistance/components/walkthroughView.css +6 -6
  205. package/front_end/panels/animation/animationTimeline.css +62 -62
  206. package/front_end/panels/application/ApplicationPanelSidebar.ts +6 -1
  207. package/front_end/panels/application/BackgroundServiceView.ts +290 -252
  208. package/front_end/panels/application/WebMCPView.ts +15 -7
  209. package/front_end/panels/application/appManifestView.css +5 -5
  210. package/front_end/panels/application/backgroundServiceView.css +18 -2
  211. package/front_end/panels/application/components/AdsView.ts +100 -4
  212. package/front_end/panels/application/components/adsView.css +8 -5
  213. package/front_end/panels/application/components/backForwardCacheView.css +5 -5
  214. package/front_end/panels/application/components/bounceTrackingMitigationsView.css +1 -1
  215. package/front_end/panels/application/components/endpointsGrid.css +1 -1
  216. package/front_end/panels/application/components/permissionsPolicySection.css +1 -1
  217. package/front_end/panels/application/components/protocolHandlersView.css +6 -6
  218. package/front_end/panels/application/components/reportsGrid.css +1 -1
  219. package/front_end/panels/application/components/serviceWorkerRouterView.css +4 -4
  220. package/front_end/panels/application/components/trustTokensView.css +7 -7
  221. package/front_end/panels/application/cookieItemsView.css +3 -3
  222. package/front_end/panels/application/deviceBoundSessionsView.css +3 -3
  223. package/front_end/panels/application/frameDetailsReportView.css +11 -11
  224. package/front_end/panels/application/indexedDBViews.css +7 -7
  225. package/front_end/panels/application/originTrialTokenRows.css +2 -2
  226. package/front_end/panels/application/originTrialTreeView.css +3 -3
  227. package/front_end/panels/application/preloading/components/RuleSetDetailsView.css +2 -2
  228. package/front_end/panels/application/preloading/components/preloadingDetailsReportView.css +1 -1
  229. package/front_end/panels/application/preloading/components/preloadingDisabledInfobar.css +2 -2
  230. package/front_end/panels/application/preloading/components/preloadingGrid.css +2 -2
  231. package/front_end/panels/application/preloading/components/usedPreloadingView.css +7 -7
  232. package/front_end/panels/application/preloading/preloadingView.css +1 -1
  233. package/front_end/panels/application/preloading/preloadingViewDropDown.css +3 -3
  234. package/front_end/panels/application/serviceWorkerCacheViews.css +5 -5
  235. package/front_end/panels/application/serviceWorkerUpdateCycleView.css +12 -12
  236. package/front_end/panels/application/serviceWorkersView.css +15 -16
  237. package/front_end/panels/application/storageView.css +5 -5
  238. package/front_end/panels/application/webMCPView.css +9 -9
  239. package/front_end/panels/autofill/autofillView.css +4 -4
  240. package/front_end/panels/browser_debugger/categorizedBreakpointsSidebarPane.css +4 -4
  241. package/front_end/panels/browser_debugger/domBreakpointsSidebarPane.css +5 -3
  242. package/front_end/panels/browser_debugger/xhrBreakpointsSidebarPane.css +4 -4
  243. package/front_end/panels/changes/changesSidebar.css +1 -1
  244. package/front_end/panels/changes/changesView.css +1 -1
  245. package/front_end/panels/changes/combinedDiffView.css +1 -1
  246. package/front_end/panels/common/CPUThrottlingOption.ts +5 -10
  247. package/front_end/panels/common/badgeNotification.css +2 -2
  248. package/front_end/panels/common/domLinkifier.css +1 -1
  249. package/front_end/panels/common/gdpSignUpDialog.css +3 -3
  250. package/front_end/panels/common/geminiRebrandPromoDialog.css +1 -1
  251. package/front_end/panels/console/ConsolePrompt.ts +6 -3
  252. package/front_end/panels/console/ConsoleView.ts +6 -3
  253. package/front_end/panels/console/ConsoleViewMessage.ts +3 -1
  254. package/front_end/panels/console/console-meta.ts +5 -24
  255. package/front_end/panels/console/consoleContextSelector.css +2 -2
  256. package/front_end/panels/console/consolePinPane.css +9 -9
  257. package/front_end/panels/console/consolePrompt.css +5 -5
  258. package/front_end/panels/console/consoleView.css +39 -39
  259. package/front_end/panels/coverage/coverageListView.css +2 -2
  260. package/front_end/panels/css_overview/cssOverviewCompletedView.css +34 -34
  261. package/front_end/panels/css_overview/cssOverviewProcessingView.css +5 -5
  262. package/front_end/panels/css_overview/cssOverviewSidebarPanel.css +1 -1
  263. package/front_end/panels/css_overview/cssOverviewStartView.css +17 -17
  264. package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +209 -62
  265. package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +4 -4
  266. package/front_end/panels/elements/DOMTreeContextMenu.ts +59 -54
  267. package/front_end/panels/elements/ElementsPanel.ts +1 -1
  268. package/front_end/panels/elements/ElementsTreeElement.ts +130 -94
  269. package/front_end/panels/elements/ElementsTreeOutline.ts +1751 -363
  270. package/front_end/panels/elements/ShortcutTreeElement.ts +6 -3
  271. package/front_end/panels/elements/StylePropertiesSection.ts +65 -8
  272. package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -0
  273. package/front_end/panels/elements/StylesSidebarPane.ts +143 -8
  274. package/front_end/panels/elements/classesPaneWidget.css +6 -6
  275. package/front_end/panels/elements/components/stylePropertyEditor.css +7 -7
  276. package/front_end/panels/elements/computedStyleWidget.css +1 -1
  277. package/front_end/panels/elements/elementStatePaneWidget.css +8 -8
  278. package/front_end/panels/elements/elements-meta.ts +14 -0
  279. package/front_end/panels/elements/elementsPanel.css +4 -4
  280. package/front_end/panels/elements/elementsTreeOutline.css +222 -38
  281. package/front_end/panels/elements/layersWidget.css +4 -4
  282. package/front_end/panels/elements/layoutPane.css +18 -18
  283. package/front_end/panels/elements/metricsSidebarPane.css +11 -11
  284. package/front_end/panels/elements/platformFontsWidget.css +5 -5
  285. package/front_end/panels/elements/propertiesWidget.css +2 -2
  286. package/front_end/panels/elements/stylePropertiesTreeOutline.css +20 -20
  287. package/front_end/panels/elements/stylesSidebarPane.css +37 -20
  288. package/front_end/panels/emulation/deviceModeView.css +49 -49
  289. package/front_end/panels/emulation/mediaQueryInspector.css +18 -18
  290. package/front_end/panels/event_listeners/eventListenersView.css +1 -1
  291. package/front_end/panels/explain/components/consoleInsight.css +29 -29
  292. package/front_end/panels/issues/components/elementsPanelLink.css +2 -2
  293. package/front_end/panels/issues/components/hideIssuesMenu.css +1 -1
  294. package/front_end/panels/issues/issuesPane.css +2 -2
  295. package/front_end/panels/issues/issuesTree.css +50 -50
  296. package/front_end/panels/layer_viewer/Layers3DView.ts +9 -10
  297. package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
  298. package/front_end/panels/layer_viewer/layerTreeOutline.css +2 -2
  299. package/front_end/panels/layer_viewer/layers3DView.css +1 -1
  300. package/front_end/panels/layer_viewer/paintProfiler.css +1 -1
  301. package/front_end/panels/lighthouse/LighthouseReportSelector.ts +2 -2
  302. package/front_end/panels/media/playerListView.css +9 -9
  303. package/front_end/panels/media/playerMessagesView.css +8 -8
  304. package/front_end/panels/media/playerPropertiesView.css +6 -6
  305. package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +1 -1
  306. package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +9 -9
  307. package/front_end/panels/network/NetworkDataGridNode.ts +1 -0
  308. package/front_end/panels/network/NetworkPanel.ts +9 -4
  309. package/front_end/panels/network/RequestConditionsDrawer.ts +12 -12
  310. package/front_end/panels/network/RequestPayloadView.ts +78 -26
  311. package/front_end/panels/network/binaryResourceView.css +1 -1
  312. package/front_end/panels/network/components/EditableSpan.css +3 -3
  313. package/front_end/panels/network/components/HeaderSectionRow.css +14 -14
  314. package/front_end/panels/network/components/RequestHeaderSection.css +7 -7
  315. package/front_end/panels/network/components/RequestHeadersView.css +18 -18
  316. package/front_end/panels/network/components/RequestTrustTokensView.css +1 -1
  317. package/front_end/panels/network/network-meta.ts +9 -9
  318. package/front_end/panels/network/networkConfigView.css +11 -11
  319. package/front_end/panels/network/networkLogView.css +35 -35
  320. package/front_end/panels/network/networkManageCustomHeadersView.css +1 -1
  321. package/front_end/panels/network/networkPanel.css +7 -7
  322. package/front_end/panels/network/networkTimingTable.css +13 -13
  323. package/front_end/panels/network/requestConditionsDrawer.css +4 -4
  324. package/front_end/panels/network/requestCookiesView.css +5 -5
  325. package/front_end/panels/network/requestDeviceBoundSessionsView.css +1 -1
  326. package/front_end/panels/network/requestHTMLView.css +1 -1
  327. package/front_end/panels/network/requestHeadersTree.css +19 -19
  328. package/front_end/panels/network/requestInitiatorView.css +1 -1
  329. package/front_end/panels/network/requestInitiatorViewTree.css +3 -3
  330. package/front_end/panels/network/requestPayloadTree.css +5 -5
  331. package/front_end/panels/network/requestPayloadView.css +1 -1
  332. package/front_end/panels/network/resourceChunkView.css +3 -3
  333. package/front_end/panels/network/signedExchangeInfoTree.css +6 -6
  334. package/front_end/panels/profiler/heapProfiler.css +15 -15
  335. package/front_end/panels/profiler/profileLauncherView.css +10 -10
  336. package/front_end/panels/recorder/RecordingView.ts +1 -1
  337. package/front_end/panels/recorder/StepEditor.ts +86 -7
  338. package/front_end/panels/recorder/TimelineSection.ts +2 -1
  339. package/front_end/panels/recorder/createRecordingView.css +17 -17
  340. package/front_end/panels/recorder/extensionView.css +5 -5
  341. package/front_end/panels/recorder/injected/RecordingClient.ts +1 -1
  342. package/front_end/panels/recorder/models/SchemaUtils.ts +2 -2
  343. package/front_end/panels/recorder/models/ScreenshotStorage.ts +1 -1
  344. package/front_end/panels/recorder/recorderPanel.css +7 -7
  345. package/front_end/panels/recorder/recordingListView.css +12 -12
  346. package/front_end/panels/recorder/recordingView.css +47 -47
  347. package/front_end/panels/recorder/stepEditor.css +2 -2
  348. package/front_end/panels/recorder/stepView.css +20 -20
  349. package/front_end/panels/recorder/timelineSection.css +9 -9
  350. package/front_end/panels/screencast/screencastView.css +12 -12
  351. package/front_end/panels/search/searchResultsPane.css +10 -10
  352. package/front_end/panels/search/searchView.css +9 -9
  353. package/front_end/panels/security/SecurityPanel.ts +84 -54
  354. package/front_end/panels/security/mainView.css +26 -26
  355. package/front_end/panels/security/originView.css +15 -15
  356. package/front_end/panels/sensors/locationsSettingsTab.css +6 -6
  357. package/front_end/panels/sensors/sensors.css +28 -28
  358. package/front_end/panels/settings/components/syncSection.css +5 -5
  359. package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +13 -13
  360. package/front_end/panels/settings/emulation/devicesSettingsTab.css +16 -16
  361. package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +2 -2
  362. package/front_end/panels/settings/keybindsSettingsTab.css +2 -2
  363. package/front_end/panels/settings/settingsScreen.css +5 -5
  364. package/front_end/panels/sources/UISourceCodeFrame.ts +1 -1
  365. package/front_end/panels/sources/breakpointEditDialog.css +9 -9
  366. package/front_end/panels/sources/breakpointsView.css +25 -25
  367. package/front_end/panels/sources/callStackSidebarPane.css +10 -10
  368. package/front_end/panels/sources/components/HeadersView.css +6 -6
  369. package/front_end/panels/sources/debuggerPausedMessage.css +4 -4
  370. package/front_end/panels/sources/dialog.css +2 -2
  371. package/front_end/panels/sources/navigatorTree.css +2 -2
  372. package/front_end/panels/sources/navigatorView.css +2 -2
  373. package/front_end/panels/sources/scopeChainSidebarPane.css +1 -1
  374. package/front_end/panels/sources/sourcesNavigator.css +1 -1
  375. package/front_end/panels/sources/sourcesPanel.css +2 -2
  376. package/front_end/panels/sources/sourcesView.css +1 -1
  377. package/front_end/panels/sources/threadsSidebarPane.css +5 -5
  378. package/front_end/panels/sources/watchExpressionsSidebarPane.css +8 -8
  379. package/front_end/panels/timeline/TimelineDetailsView.ts +9 -21
  380. package/front_end/panels/timeline/TimelineFlameChartView.ts +3 -5
  381. package/front_end/panels/timeline/TimelineMiniMap.ts +3 -3
  382. package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -1
  383. package/front_end/panels/timeline/components/breadcrumbsUI.css +3 -3
  384. package/front_end/panels/timeline/components/exportTraceOptions.css +1 -1
  385. package/front_end/panels/timeline/components/fieldSettingsDialog.css +13 -13
  386. package/front_end/panels/timeline/components/ignoreListSetting.css +3 -3
  387. package/front_end/panels/timeline/components/liveMetricsView.css +39 -39
  388. package/front_end/panels/timeline/components/metricCard.css +20 -20
  389. package/front_end/panels/timeline/components/networkRequestDetails.css +9 -9
  390. package/front_end/panels/timeline/components/networkRequestTooltip.css +14 -14
  391. package/front_end/panels/timeline/components/networkTrackWidget.css +2 -2
  392. package/front_end/panels/timeline/components/originMap.css +4 -4
  393. package/front_end/panels/timeline/components/relatedInsightChips.css +1 -1
  394. package/front_end/panels/timeline/components/sidebarAnnotationsTab.css +4 -4
  395. package/front_end/panels/timeline/components/sidebarInsightsTab.css +5 -5
  396. package/front_end/panels/timeline/components/sidebarSingleInsightSet.css +1 -1
  397. package/front_end/panels/timeline/components/timelineSummary.css +4 -4
  398. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +4 -4
  399. package/front_end/panels/timeline/overlays/components/EntriesLinkOverlay.ts +1 -1
  400. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +6 -6
  401. package/front_end/panels/timeline/overlays/components/TimeRangeOverlay.ts +1 -1
  402. package/front_end/panels/timeline/thirdPartyTreeView.css +5 -5
  403. package/front_end/panels/timeline/timeline-meta.ts +0 -6
  404. package/front_end/panels/timeline/timelineDetailsView.css +11 -11
  405. package/front_end/panels/timeline/timelinePanel.css +20 -20
  406. package/front_end/panels/timeline/timelineTreeView.css +8 -8
  407. package/front_end/panels/webauthn/webauthnPane.css +6 -6
  408. package/front_end/panels/whats_new/ReleaseNoteText.ts +2 -2
  409. package/front_end/third_party/chromium/README.chromium +1 -1
  410. package/front_end/third_party/i18n/i18n-impl.ts +1 -1
  411. package/front_end/third_party/puppeteer/README.chromium +2 -2
  412. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +15 -1
  413. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +42 -8
  414. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.d.ts +4 -0
  415. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.d.ts.map +1 -1
  416. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +15 -2
  417. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
  418. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts +14 -1
  419. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
  420. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js +23 -1
  421. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
  422. package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts +1 -1
  423. package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts.map +1 -1
  424. package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js +1 -1
  425. package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js.map +1 -1
  426. package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.d.ts.map +1 -1
  427. package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.js +77 -6
  428. package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.js.map +1 -1
  429. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
  430. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
  431. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js.map +1 -1
  432. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
  433. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
  434. package/front_end/third_party/puppeteer/package/lib/types.d.ts +15 -1
  435. package/front_end/third_party/puppeteer/package/package.json +2 -2
  436. package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +16 -2
  437. package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +36 -1
  438. package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
  439. package/front_end/third_party/puppeteer/package/src/injected/Poller.ts +86 -6
  440. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  441. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  442. package/front_end/third_party/web-vitals/README.chromium +2 -2
  443. package/front_end/third_party/web-vitals/package/README.md +22 -7
  444. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +6 -2
  445. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +2 -2
  446. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +30 -3
  447. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +14 -0
  448. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +19 -13
  449. package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.d.ts +1 -1
  450. package/front_end/third_party/web-vitals/package/dist/modules/lib/doubleRAF.js +1 -1
  451. package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +3 -3
  452. package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.js +3 -1
  453. package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +15 -1
  454. package/front_end/third_party/web-vitals/package/package.json +1 -2
  455. package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +9 -2
  456. package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +36 -5
  457. package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +21 -15
  458. package/front_end/third_party/web-vitals/package/src/lib/doubleRAF.ts +1 -1
  459. package/front_end/third_party/web-vitals/package/src/lib/softNavs.ts +4 -1
  460. package/front_end/third_party/web-vitals/package/src/types/lcp.ts +16 -1
  461. package/front_end/third_party/web-vitals/rebuild.sh +3 -3
  462. package/front_end/ui/comments/CommentAnchorResolver.ts +15 -4
  463. package/front_end/ui/comments/commentsOverlay.css +6 -5
  464. package/front_end/ui/components/adorners/Adorner.ts +1 -1
  465. package/front_end/ui/components/adorners/adorner.css +6 -6
  466. package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
  467. package/front_end/ui/components/buttons/button.css +9 -9
  468. package/front_end/ui/components/buttons/floatingButton.css +2 -2
  469. package/front_end/ui/components/buttons/textButton.css +12 -12
  470. package/front_end/ui/components/dialogs/Dialog.ts +1 -1
  471. package/front_end/ui/components/dialogs/dialog.css +1 -1
  472. package/front_end/ui/components/diff_view/diffView.css +3 -3
  473. package/front_end/ui/components/expandable_list/expandableList.css +9 -9
  474. package/front_end/ui/components/highlighting/HighlightElement.ts +1 -1
  475. package/front_end/ui/components/highlighting/HighlightManager.ts +4 -0
  476. package/front_end/ui/components/icon_button/iconButton.css +2 -2
  477. package/front_end/ui/components/input/checkbox.css +8 -8
  478. package/front_end/ui/components/input/textInput.css +3 -3
  479. package/front_end/ui/components/issue_counter/issueLinkIcon.css +2 -2
  480. package/front_end/ui/components/linkifier/linkifierImpl.css +1 -1
  481. package/front_end/ui/components/markdown_view/MarkdownImagesMap.ts +1 -1
  482. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +1 -1
  483. package/front_end/ui/components/markdown_view/codeBlock.css +2 -2
  484. package/front_end/ui/components/markdown_view/markdownView.css +7 -7
  485. package/front_end/ui/components/menus/menuGroup.css +2 -2
  486. package/front_end/ui/components/menus/menuItem.css +2 -2
  487. package/front_end/ui/components/menus/selectMenu.css +2 -2
  488. package/front_end/ui/components/menus/selectMenuButton.css +4 -4
  489. package/front_end/ui/components/panel_feedback/panelFeedback.css +15 -15
  490. package/front_end/ui/components/panel_feedback/previewToggle.css +2 -2
  491. package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +7 -7
  492. package/front_end/ui/components/report_view/report.css +3 -3
  493. package/front_end/ui/components/report_view/reportSectionDivider.css +1 -1
  494. package/front_end/ui/components/report_view/reportValue.css +1 -1
  495. package/front_end/ui/components/request_link_icon/requestLinkIcon.css +2 -2
  496. package/front_end/ui/components/settings/settingCheckbox.css +6 -6
  497. package/front_end/ui/components/text_editor/TextEditor.ts +3 -1
  498. package/front_end/ui/components/text_editor/config.ts +16 -4
  499. package/front_end/ui/kit/icons/icon.css +4 -4
  500. package/front_end/ui/kit/link/link.css +1 -1
  501. package/front_end/ui/legacy/ActionRegistration.ts +23 -23
  502. package/front_end/ui/legacy/Dialog.ts +1 -1
  503. package/front_end/ui/legacy/DockController.ts +3 -3
  504. package/front_end/ui/legacy/EmptyWidget.ts +13 -34
  505. package/front_end/ui/legacy/FilterBar.ts +4 -4
  506. package/front_end/ui/legacy/Infobar.ts +2 -2
  507. package/front_end/ui/legacy/InspectorDrawerView.ts +6 -6
  508. package/front_end/ui/legacy/InspectorView.ts +19 -26
  509. package/front_end/ui/legacy/ListWidget.ts +7 -7
  510. package/front_end/ui/legacy/PlusButton.ts +1 -3
  511. package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +6 -6
  512. package/front_end/ui/legacy/SearchableView.ts +16 -16
  513. package/front_end/ui/legacy/SoftContextMenu.ts +8 -8
  514. package/front_end/ui/legacy/SoftDropDown.ts +1 -1
  515. package/front_end/ui/legacy/SuggestBox.ts +2 -2
  516. package/front_end/ui/legacy/TabbedPane.ts +10 -10
  517. package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -2
  518. package/front_end/ui/legacy/Toolbar.ts +5 -5
  519. package/front_end/ui/legacy/Treeoutline.ts +1 -1
  520. package/front_end/ui/legacy/UIUtils.ts +80 -20
  521. package/front_end/ui/legacy/ViewManager.ts +1 -1
  522. package/front_end/ui/legacy/ViewRegistration.ts +7 -7
  523. package/front_end/ui/legacy/Widget.ts +5 -5
  524. package/front_end/ui/legacy/checkboxTextLabel.css +3 -3
  525. package/front_end/ui/legacy/components/color_picker/ColorFormatSpec.ts +16 -0
  526. package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +1 -0
  527. package/front_end/ui/legacy/components/color_picker/spectrum.css +90 -90
  528. package/front_end/ui/legacy/components/cookie_table/cookiesTable.css +1 -1
  529. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +26 -28
  530. package/front_end/ui/legacy/components/data_grid/ShowMoreDataGridNode.ts +3 -7
  531. package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +13 -13
  532. package/front_end/ui/legacy/components/inline_editor/colorSwatch.css +7 -7
  533. package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +5 -5
  534. package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +18 -18
  535. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +104 -86
  536. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +8 -6
  537. package/front_end/ui/legacy/components/object_ui/objectPopover.css +4 -4
  538. package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +6 -6
  539. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +28 -11
  540. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +0 -4
  541. package/front_end/ui/legacy/components/perf_ui/chartViewport.css +4 -4
  542. package/front_end/ui/legacy/components/perf_ui/filmStripView.css +6 -6
  543. package/front_end/ui/legacy/components/perf_ui/flameChart.css +7 -7
  544. package/front_end/ui/legacy/components/perf_ui/overviewGrid.css +11 -11
  545. package/front_end/ui/legacy/components/perf_ui/pieChart.css +6 -6
  546. package/front_end/ui/legacy/components/perf_ui/timelineGrid.css +5 -5
  547. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +3 -3
  548. package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +1 -1
  549. package/front_end/ui/legacy/components/source_frame/imageView.css +1 -1
  550. package/front_end/ui/legacy/components/source_frame/jsonView.css +1 -1
  551. package/front_end/ui/legacy/components/source_frame/resourceSourceFrame.css +1 -1
  552. package/front_end/ui/legacy/components/source_frame/xmlTree.css +3 -3
  553. package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
  554. package/front_end/ui/legacy/components/utils/jsUtils.css +10 -10
  555. package/front_end/ui/legacy/dropTarget.css +2 -2
  556. package/front_end/ui/legacy/emptyWidget.css +6 -0
  557. package/front_end/ui/legacy/filter.css +19 -19
  558. package/front_end/ui/legacy/infobar.css +2 -2
  559. package/front_end/ui/legacy/inspectorCommon.css +67 -67
  560. package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +1 -1
  561. package/front_end/ui/legacy/listWidget.css +5 -5
  562. package/front_end/ui/legacy/progressIndicator.css +4 -4
  563. package/front_end/ui/legacy/reportView.css +7 -7
  564. package/front_end/ui/legacy/searchableView.css +5 -5
  565. package/front_end/ui/legacy/smallBubble.css +3 -3
  566. package/front_end/ui/legacy/softContextMenu.css +4 -4
  567. package/front_end/ui/legacy/softDropDownButton.css +1 -1
  568. package/front_end/ui/legacy/splitWidget.css +9 -31
  569. package/front_end/ui/legacy/suggestBox.css +4 -4
  570. package/front_end/ui/legacy/tabbedPane.css +17 -17
  571. package/front_end/ui/legacy/textPrompt.css +2 -2
  572. package/front_end/ui/legacy/toolbar.css +4 -4
  573. package/front_end/ui/legacy/treeoutline.css +14 -14
  574. package/front_end/ui/legacy/viewContainers.css +6 -6
  575. package/front_end/ui/settings/ConsoleSettings.ts +34 -0
  576. package/front_end/ui/visual_logging/KnownContextValues.ts +12 -0
  577. package/inspector_overlay/common.ts +12 -12
  578. package/inspector_overlay/css_grid_label_helpers.ts +16 -17
  579. package/inspector_overlay/drag_resize_handler.ts +2 -2
  580. package/inspector_overlay/highlight_common.ts +11 -13
  581. package/inspector_overlay/highlight_container_query.ts +2 -2
  582. package/inspector_overlay/highlight_flex_common.ts +6 -7
  583. package/inspector_overlay/highlight_grid_common.ts +3 -3
  584. package/inspector_overlay/highlight_isolated_element.ts +12 -3
  585. package/inspector_overlay/highlight_scroll_snap.ts +2 -2
  586. package/inspector_overlay/loadCSS.rollup.js +0 -1
  587. package/inspector_overlay/testing/InspectorOverlayHelpers.ts +13 -13
  588. package/inspector_overlay/tool_green_dev_anchors.ts +3 -3
  589. package/inspector_overlay/tool_highlight.ts +9 -9
  590. package/inspector_overlay/tool_paused.ts +4 -4
  591. package/inspector_overlay/tool_persistent.ts +11 -11
  592. package/inspector_overlay/tool_screenshot.ts +7 -7
  593. package/inspector_overlay/tool_source_order.ts +4 -4
  594. package/inspector_overlay/tool_viewport_size.ts +3 -3
  595. package/inspector_overlay/tool_window_controls.ts +4 -4
  596. package/mcp/mcp.ts +1 -0
  597. package/package.json +2 -2
  598. package/front_end/generated/protocol-tsconfig.json +0 -10
  599. package/front_end/panels/js_timeline/DIR_METADATA +0 -3
  600. package/front_end/panels/js_timeline/js_timeline-meta.ts +0 -193
  601. package/front_end/panels/js_timeline/js_timeline.ts +0 -1
  602. /package/front_end/entrypoints/{formatter_worker/FormatterActions.ts → formatter_actions/formatter_actions.ts} +0 -0
@@ -5,12 +5,18 @@ allowed-tools:
5
5
  - listNetworkRequests
6
6
  - getNetworkRequestDetails
7
7
  ---
8
- You are the most advanced network request debugging assistant integrated into Chrome DevTools.
9
- Provide a comprehensive analysis of network requests, focusing on areas crucial for a software engineer. Your analysis should include:
10
- * Briefly explain the purpose of the request based on the URL, method, and any relevant headers or payload.
11
- * Analyze timing information to identify potential bottlenecks or areas for optimization.
12
- * Highlight potential issues indicated by the status code.
8
+ You are an expert network request debugging assistant.
9
+
10
+ # Tools & Workflow
11
+
12
+ 1. **Discover Requests (`listNetworkRequests`)**:
13
+ - Call `listNetworkRequests` to discover recorded network requests matching the active origin.
14
+ - Inspect the returned list for URLs, status codes, durations, transfer sizes, and unique request `id` values.
15
+
16
+ 2. **Inspect Request Details (`getNetworkRequestDetails`)**:
17
+ - Call `getNetworkRequestDetails` with the specific request `id` to obtain full headers, timing phases (DNS, initial connection, SSL, TTFB, content download), status text, and response body.
13
18
 
14
19
  # Considerations
15
- * If the response payload or request payload contains sensitive data, redact or generalize it in your analysis to ensure privacy.
16
- * Tailor your explanations and suggestions to the specific context of the request and the technologies involved (if discernible from the provided details).
20
+
21
+ * **Privacy**: If the request or response payload contains sensitive personal data, authorization tokens, or API secrets, redact or generalize it in your response.
22
+ * **Origin Lock**: Only requests belonging to the conversation's established origin can be inspected.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: performance
3
- description: Web performance analysis, trace inspection, and trace recording.
3
+ description: Web performance analysis, Core Web Vitals (LCP, INP, CLS), trace inspection, and trace recording.
4
4
  allowed-tools:
5
5
  - recordPerformanceTrace
6
6
  - getTraceEventByKey
@@ -13,24 +13,30 @@ allowed-tools:
13
13
  - getInsightDetails
14
14
  ---
15
15
  You are an expert web performance assistant integrated into Chrome DevTools.
16
- Your primary goal is to provide actionable advice to web developers about their web page by using the Chrome Performance Panel and analyzing a trace. You may need to diagnose problems yourself, or you may be given direction for what to focus on by the user.
16
+ Your goal is to provide actionable advice about web page performance by analyzing a trace.
17
17
 
18
- You will be provided an initial summary of a trace: metrics, critical network requests, bottom-up main thread activity, and a brief overview of available insights.
18
+ # Investigation Workflow
19
19
 
20
- # Critical Investigation Rules
20
+ 1. **Insight Inspection (`getInsightDetails`)**:
21
+ - When asked about performance bottlenecks or Core Web Vitals (LCP, INP, CLS), never reply using only the initial summary.
22
+ - Always call `getInsightDetails` with the relevant `insightSetId` and `insightName` (e.g. `LCPBreakdown`, `LCPDiscovery`, `RenderBlocking`, `CLSCulprits`, `INPBreakdown`, `ThirdParties`) to obtain full diagnostics, subpart timing breakdowns, and candidate elements.
23
+ - For LCP investigations, inspect both `LCPBreakdown` and `LCPDiscovery` (TTFB, load delay, load duration, render delay).
21
24
 
22
- * **Mandatory Insight Lookup**: When the user asks about performance insights, LCP/INP/CLS, or performance bottlenecks, you MUST NOT answer using only the initial high-level summary. Always call `getInsightDetails` with the relevant `insightSetId` and `insightName` (e.g., `LCPBreakdown`, `LCPDiscovery`, `RenderBlocking`, `CLSCulprits`, `INPBreakdown`, `ThirdParties`) to obtain full diagnostics, subpart timing breakdowns, and candidate elements BEFORE commenting on any specific issue.
23
- * **No Shortcutting**: Even if the initial facts contain specific metric numbers, insight descriptions, or function names, you are NOT allowed to reply using only that initial summary. You MUST call relevant functions (`getInsightDetails`, `getTraceMainThreadSummary`, `getDetailedCallTree`, `getTraceEventByKey`) to thoroughly inspect and verify the data before providing recommendations.
24
- * **Investigating LCP**: When asked about LCP or contributing factors to page load, always call `getInsightDetails` for both `LCPBreakdown` and `LCPDiscovery` to examine subparts (TTFB, load delay, load duration, render delay) and inspect the candidate DOM element.
25
- * **Investigating Main Thread Activity**: You MUST call `getTraceMainThreadSummary` with specific section labels (e.g. `nav-to-lcp`, `lcp-ttfb`, `lcp-render-delay`, `trace-bounds`, or insight names) to uncover root causes on the main thread before suggesting solutions. Look for aggregated cost across small frequent tasks, not just single long tasks.
26
- * **Investigating Long Tasks and Code**: Use `getDetailedCallTree` with an `eventKey` to retrieve bottom-up execution trees for expensive main thread tasks, and use `getFunctionCode` or `getResourceContent` with script URLs to inspect the source code and identify root causes.
27
- * **Revealing Events**: If the user asks to see, locate, or show a specific event in the UI, use `selectTraceEventByKey` to reveal and select it in the Flamechart.
28
- * **Recording Traces**: Use `recordPerformanceTrace` when requested by the user or when a fresh live measurement is required.
25
+ 2. **Main Thread & Network Inspection (`getTraceMainThreadSummary` & `getTraceNetworkSummary`)**:
26
+ - Call `getTraceMainThreadSummary` with specific period labels (e.g. `nav-to-lcp`, `lcp-ttfb`, `lcp-render-delay`, `trace-bounds`, or insight names) to uncover main thread bottlenecks. Look for aggregated cost across small frequent tasks, not just single long tasks.
27
+ - Use `getTraceNetworkSummary` with time bounds to inspect network requests during specific phases.
29
28
 
30
- # Guidelines & Response Format
29
+ 3. **Call Tree, Event & Source Inspection**:
30
+ - Use `getDetailedCallTree` to retrieve bottom-up execution trees for expensive main thread tasks.
31
+ - Use `getTraceEventByKey` to inspect timing and payload data for individual events.
32
+ - Use `getFunctionCode` or `getResourceContent` to inspect the source code and identify root causes.
31
33
 
32
- - Base your analysis and advice solely on the empirical data retrieved through function calls. Never guess or present options without verifying them first.
33
- - Structure your response using clear markdown headings and concise bullet points.
34
+ 4. **UI Selection & Trace Recording**:
35
+ - Use `selectTraceEventByKey` to reveal and select an event in the Performance Flamechart if requested.
36
+ - Use `recordPerformanceTrace` when the user requests a fresh live trace measurement.
37
+
38
+ # Considerations
39
+
40
+ - Base all advice on empirical data retrieved through function calls. Never guess.
34
41
  - Ensure all time units in your response are in milliseconds (ms), rounded to the nearest whole number.
35
- - Never output raw microsecond bounds (e.g., `{min: ...}`) or raw `eventKey` strings (e.g., `eventKey: r-123`) in running text.
36
- - Be direct and to the point. Focus on delivering actionable advice efficiently.
42
+ - Never output raw microsecond bounds (e.g., `{min: ...}`) or raw `eventKey` strings in running text.
@@ -5,12 +5,18 @@ allowed-tools:
5
5
  - listSources
6
6
  - getSourceContent
7
7
  ---
8
- You are the most advanced source code analysis and debugging assistant integrated into Chrome DevTools.
9
- Provide a comprehensive analysis of source files, focusing on areas crucial for a software engineer. Your analysis should include:
10
- * Briefly explain the purpose and architecture of the file or script.
11
- * Analyze code blocks to identify potential bugs, logic issues, or areas for optimization.
12
- * Walk through execution flow if requested, pointing to key lines or functions.
8
+ You are an expert source code analysis and debugging assistant.
9
+
10
+ # Tools & Workflow
11
+
12
+ 1. **Discover Files (`listSources`)**:
13
+ - Call `listSources` to retrieve all deployed and authored source files (including source-mapped files) in the workspace matching the active origin.
14
+ - Inspect the returned list for file names and unique numeric `id` values.
15
+
16
+ 2. **Inspect File Content (`getSourceContent`)**:
17
+ - Call `getSourceContent` with the numeric `id` to retrieve the full, line-numbered source code.
13
18
 
14
19
  # Considerations
15
- * Never leak sensitive user data or API keys found in source code files. Redact or generalize them in your analysis.
16
- * Provide clean code snippets and direct line references where helpful.
20
+
21
+ * Provide clean code snippets with direct line references where helpful.
22
+ * Redact sensitive personal data, secrets, or API keys found in source files.
@@ -1,32 +1,33 @@
1
1
  ---
2
2
  name: storage
3
- description: inspect, understand, and audit the state stored in browser storage (LocalStorage, SessionStorage).
3
+ description: Inspect, understand, and audit the state stored in browser storage (LocalStorage, SessionStorage) and cookies.
4
4
  allowed-tools:
5
5
  - listPageOrigins
6
6
  - listStorageKeys
7
7
  - getStorageValues
8
+ - listCookies
9
+ - getCookieValues
10
+ - getStorageBreakdown
8
11
  ---
9
- You are a Senior Software Engineer specializing in state audit and storage analysis within Chrome DevTools. Your mission is to help developers debug storage-related issues faster by analyzing the evidence in LocalStorage and SessionStorage.
12
+ You are an expert browser storage and state debugging assistant.
10
13
 
11
- You have access to the site's storage using tools.
12
-
13
- # Goals
14
+ # Tools & Workflow
14
15
 
15
- 1. **Explain Purpose**: Identify what specific storage entries are for.
16
- 2. **Understand Application State**: Help users inspect, understand, and audit the state stored in browser storage, and how it relates to application behavior or issues (such as state mismatch/drift or security misconfigurations).
17
- 3. **Top-Level Page First**: Your primary goal is to assist the user in understanding and debugging the storage of the **top-level page**. This context is the most critical for debugging and should be your default starting point for any analysis.
16
+ 1. **Storage Quota & Breakdown (`getStorageBreakdown`)**:
17
+ - Call `getStorageBreakdown` to retrieve total usage and quota breakdown across all storage mechanisms (service workers, IndexedDB, CacheStorage, LocalStorage, SessionStorage, cookies) for the top-level page.
18
18
 
19
- # Tools & Workflow
19
+ 2. **Discover Origins, Keys, and Cookies (`listPageOrigins`, `listStorageKeys`, `listCookies`)**:
20
+ - Call `listPageOrigins` to discover all active frame origins loaded by the page.
21
+ - Use `listStorageKeys` for a given storage type ('localStorage' or 'sessionStorage') and origin to list keys.
22
+ - Pass origins to `listCookies` to list cookie names (defaults to top-level page origin if omitted).
20
23
 
21
- - **Top-Level Context**: Generally, questions refer to the primary page target ("my page", "this page", etc.). If the user selects a general category or a specific selection, answers should refer to that particular selection, but follow-up questions may switch to the primary page target.
22
- - **Address Specific Selections**: The user can select individual storage items in the DevTools UI (provided in the '# Active Context' section of the prompt). If the query is about a selected item, focus your response on that specific item.
23
- - **Discovery & General Category**: When investigating storage across the page, start by calling `listPageOrigins` to discover all active frame origins loaded by the page. Then pass the origins to `listStorageKeys` to discover available keys and storage partitions.
24
- - **Value Inspection**: Use `getStorageValues` to inspect specific keys when key names alone are insufficient.
25
- - **Expand Scope When Necessary**: For general questions or those implying a wider scope (e.g., "Check all storages"), proactively use your tools to explore relevant storage contexts across active page origins.
24
+ 3. **Inspect Values (`getStorageValues`, `getCookieValues`)**:
25
+ - Call `getStorageValues` with specific keys and origins to retrieve storage values.
26
+ - Call `getCookieValues` with specific cookie names and origins to retrieve values and security metadata (SameSite, Secure, Partitioned).
26
27
 
27
28
  # Considerations
28
29
 
29
- - **Strictly Read-Only**: You cannot write, clear, delete, or edit storage.
30
- - **DevTools UI Fallback**: If the user asks you to modify state, politely decline and provide exact step-by-step visual navigation directions on how they can perform the edit manually in the DevTools Application panel. Do NOT supply Console scripts.
31
- - **Raw Evidence**: Treat storage data as raw evidence. Do not make assumptions about values without reading them first.
32
- - **Dynamic State**: Always re-request values if you suspect they might have changed, rather than relying on past tool outputs.
30
+ - **Read-Only**: You cannot write, clear, delete, or edit storage or cookies.
31
+ - **HttpOnly Protection**: `HttpOnly` cookies are excluded from discovery and retrieval for security reasons.
32
+ - **DevTools UI Fallback**: If the user asks to modify or delete storage/cookies, provide step-by-step navigation instructions for the DevTools Application panel. Do NOT output Console modification scripts.
33
+ - **Dynamic State**: Re-query storage or cookies if state may have changed during page interactions.
@@ -5,44 +5,37 @@ allowed-tools:
5
5
  - executeJavaScript
6
6
  - getStyles
7
7
  ---
8
- You are the most advanced CSS/DOM/HTML debugging assistant integrated into Chrome DevTools.
9
- You always suggest considering the best web development practices and the newest platform features such as view transitions.
10
- The user selected a DOM element in the browser's DevTools and sends a query about the page or the selected DOM element.
11
- First, examine the provided context, then use the getStyles and executeJavaScript functions to gather additional context and resolve the user request.
8
+ You are an expert CSS, styling, and layout debugging assistant.
9
+ The user selected a DOM element in DevTools and asks a query about the element or page styles.
12
10
 
13
- # Considerations
11
+ # Tools & Workflow
12
+
13
+ 1. **Inspect CSS Properties (`getStyles`)**:
14
+ - Use `getStyles` to query computed and authored CSS properties for one or more element backend node IDs.
15
+ - You MUST provide a specific list of CSS property names (e.g. `['display', 'position', 'flex-direction', 'z-index']`). Do not use generic values like "all" or "*".
16
+ - Always consider the CSS cascade, inheritance, and stacking contexts.
14
17
 
15
- * Meticulously investigate all potential causes for the observed behavior before moving on. Gather comprehensive information about the element's parent, siblings, children, and any overlapping elements, paying close attention to properties that are likely relevant to the query.
16
- * Be aware of the different node types (element, text, comment, document fragment, etc.) and their properties. You will always be provided with information about node types of parent, siblings and children of the selected element.
17
- * Avoid making assumptions without sufficient evidence, and always seek further clarification if needed.
18
- * Always explore multiple possible explanations for the observed behavior before settling on a conclusion.
19
- * When presenting solutions, clearly distinguish between the primary cause and contributing factors.
20
- * Please answer only if you are sure about the answer. Otherwise, explain why you're not able to answer.
21
- * When answering, always consider MULTIPLE possible solutions.
22
- * When answering, remember to consider CSS concepts such as the CSS cascade, explicit and implicit stacking contexts and various CSS layout types.
23
- * Use the functions available to you to investigate and fulfill the user request.
24
- * After applying a fix, please ask the user to confirm if the fix worked or not.
25
- * ALWAYS OUTPUT a list of follow-up queries at the end of your text response. The format is SUGGESTIONS: ["suggestion1", "suggestion2", "suggestion3"]. Make sure that the array and the `SUGGESTIONS: ` text is in the same line. You're also capable of executing the fix for the issue user mentioned. Reflect this in your suggestions.
26
- * Use the precision of Strunk & White, the brevity of Hemingway, and the simple clarity of Vonnegut. Don't add repeated information, and keep the whole answer short.
27
- * **CRITICAL** NEVER output text before a function call. Always do a function call first.
28
- * **CRITICAL** When answering questions about positioning or layout, ALWAYS inspect `position`, `display` and all other related properties. You MUST provide a specific list of CSS property names when calling getStyles. Do not use generic values like "all" or "*".
29
- * **CRITICAL** When writing JavaScript via the `executeJavaScript` tool:
30
- - To return data, define a top-level `data` variable and populate it with a JSON-serializable object.
31
- - If you modify styles on an element, ALWAYS call the pre-defined global `async setElementStyles(el: Element, styles: object)` function. This function is an internal mechanism and should never be presented to the user.
32
- - Never assume a selector for the elements unless you verified your knowledge.
33
- - Consider that `data` variables from previous function calls are not available in a new function call.
34
- * **CRITICAL** You are a CSS/DOM/HTML debugging assistant. NEVER provide answers to questions of unrelated topics such as legal advice, financial advice, personal opinions, medical advice, religion, race, politics, sexuality, gender, or any other non web-development topics. Answer "Sorry, I can't answer that. I'm best at questions about debugging web pages." to such questions.
18
+ 2. **Inspect Geometry, DOM Traversal, or Modify Styles (`executeJavaScript`)**:
19
+ - Use `executeJavaScript` when you need to inspect computed geometry, bounding boxes, traverse related DOM nodes (`$0.parentElement`, `$0.children`), or modify styles on `$0`.
20
+ - Geometry & layout inspection example:
21
+ ```javascript
22
+ const rect = $0.getBoundingClientRect();
23
+ const data = {
24
+ rect: {width: rect.width, height: rect.height, top: rect.top, left: rect.left},
25
+ computedDisplay: window.getComputedStyle($0).display,
26
+ parentDisplay: $0.parentElement ? window.getComputedStyle($0.parentElement).display : null,
27
+ };
28
+ ```
29
+ - Style modification example (ALWAYS use `setElementStyles`):
30
+ ```javascript
31
+ await setElementStyles($0, {
32
+ display: 'flex',
33
+ justifyContent: 'center',
34
+ });
35
+ ```
36
+ - `setElementStyles` is an internal mechanism for you; do not mention `setElementStyles` directly to the user.
35
37
 
36
- ## Response Structure
38
+ # Considerations
37
39
 
38
- If the user asks a question that requires an investigation of a problem, use this structure:
39
- - If available, point out the root cause(s) of the problem.
40
- - Example: "**Root Cause**: The page is slow because of [reason]."
41
- - Example: "**Root Causes**:"
42
- - [Reason 1]
43
- - [Reason 2]
44
- - if applicable, list actionable solution suggestion(s) in order of impact:
45
- - Example: "**Suggestion**: [Suggestion 1]
46
- - Example: "**Suggestions**:"
47
- - [Suggestion 1]
48
- - [Suggestion 2]
40
+ * Meticulously investigate all potential causes for the observed behavior before concluding. Inspect parents, siblings, children, and overlapping elements where relevant.
41
+ * After applying a style fix, ask the user to verify if the visual change resolved their issue.
@@ -0,0 +1,120 @@
1
+ // Copyright 2026 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import * as Common from '../../../core/common/common.js';
6
+ import * as SDK from '../../../core/sdk/sdk.js';
7
+ import type * as Protocol from '../../../generated/protocol.js';
8
+ import {areOriginsEquivalent, extractContextOrigin, isOpaqueOrigin} from '../AiOrigins.js';
9
+
10
+ import {MAX_TARGET_ORIGINS} from './DOMStorageUtils.js';
11
+ import type {OriginLockCapability} from './Tool.js';
12
+
13
+ export interface CookieDetails {
14
+ name: string;
15
+ value: string;
16
+ domain: string;
17
+ path: string;
18
+ /** Expiration time in milliseconds since UNIX epoch, or undefined for session cookies. */
19
+ expires?: number;
20
+ size: number;
21
+ secure: boolean;
22
+ sameSite?: Protocol.Network.CookieSameSite;
23
+ partitioned: boolean;
24
+ priority?: Protocol.Network.CookiePriority;
25
+ sourcePort?: number;
26
+ sourceScheme?: Protocol.Network.CookieSourceScheme;
27
+ }
28
+
29
+ /**
30
+ * Resolves and validates target origins against origin-lock constraints and primary page target.
31
+ * If `requestedOrigins` is omitted or empty, defaults to the established context origin.
32
+ */
33
+ export function resolveAllowedTargetOrigins(
34
+ requestedOrigins: string[]|undefined,
35
+ context: OriginLockCapability,
36
+ targetManager: SDK.TargetManager.TargetManager,
37
+ ): {targetOrigins: string[], primaryPageTarget: SDK.Target.Target}|{
38
+ error: string,
39
+ }
40
+ {
41
+ const allowedOrigin = context.getEstablishedOrigin();
42
+ if (!allowedOrigin || isOpaqueOrigin(allowedOrigin) || isOpaqueOrigin(extractContextOrigin(allowedOrigin))) {
43
+ return {error: 'No origin available or not allowed.'};
44
+ }
45
+
46
+ const primaryPageTarget = targetManager.primaryPageTarget();
47
+ if (!primaryPageTarget) {
48
+ return {error: 'Primary page target not found.'};
49
+ }
50
+
51
+ const pageOrigin = Common.ParsedURL.ParsedURL.extractOrigin(primaryPageTarget.inspectedURL());
52
+ if (!pageOrigin || !areOriginsEquivalent(pageOrigin, allowedOrigin)) {
53
+ return {error: 'Page origin does not match allowed origin.'};
54
+ }
55
+
56
+ const rawOrigins =
57
+ (Array.isArray(requestedOrigins) && requestedOrigins.length > 0) ? requestedOrigins : [allowedOrigin];
58
+ const validOrigins = rawOrigins.map(origin => extractContextOrigin(origin))
59
+ .filter(origin => areOriginsEquivalent(origin, allowedOrigin));
60
+ const targetOrigins = Array.from(new Set(validOrigins)).slice(0, MAX_TARGET_ORIGINS);
61
+ if (targetOrigins.length === 0) {
62
+ return {error: 'No valid origins found.'};
63
+ }
64
+
65
+ return {targetOrigins, primaryPageTarget};
66
+ }
67
+
68
+ export type GetCookiesForOriginResult = {
69
+ cookies: SDK.Cookie.Cookie[],
70
+ }|{
71
+ error: string,
72
+ };
73
+
74
+ /**
75
+ * Finds the resource tree frame matching the target origin within the primary page's outermost target tree.
76
+ */
77
+ export function findFrameForOrigin(
78
+ origin: string,
79
+ targetManager: SDK.TargetManager.TargetManager,
80
+ primaryPageTarget: SDK.Target.Target,
81
+ ): SDK.ResourceTreeModel.ResourceTreeFrame|null {
82
+ const targetOrigin = extractContextOrigin(origin);
83
+ for (const frame of SDK.ResourceTreeModel.ResourceTreeModel.frames(targetManager)) {
84
+ if (frame.resourceTreeModel().target().outermostTarget() !== primaryPageTarget) {
85
+ continue;
86
+ }
87
+ if (frame.securityOrigin && areOriginsEquivalent(frame.securityOrigin, targetOrigin)) {
88
+ return frame;
89
+ }
90
+ }
91
+ return null;
92
+ }
93
+
94
+ /**
95
+ * Retrieves all cookies accessible to the target origin, strictly excluding HttpOnly cookies.
96
+ * Locates the matching frame within the primary page target tree, queries its CookieModel,
97
+ * and filters cookies by security origin.
98
+ */
99
+ export async function getCookiesForOrigin(
100
+ origin: string,
101
+ targetManager: SDK.TargetManager.TargetManager,
102
+ primaryPageTarget: SDK.Target.Target,
103
+ ): Promise<GetCookiesForOriginResult> {
104
+ const frame = findFrameForOrigin(origin, targetManager, primaryPageTarget);
105
+ if (!frame) {
106
+ return {error: `Frame not found or origin disallowed for ${origin}`};
107
+ }
108
+
109
+ const target = frame.resourceTreeModel().target();
110
+ const cookieModel = target.model(SDK.CookieModel.CookieModel);
111
+ if (!cookieModel) {
112
+ return {error: `Cookie model not found for ${origin}`};
113
+ }
114
+
115
+ const allCookies = await cookieModel.getCookiesForDomain(origin, true).catch(() => null);
116
+ if (!allCookies) {
117
+ return {error: `Failed to fetch cookies for ${origin}`};
118
+ }
119
+ return {cookies: allCookies.filter(cookie => !cookie.httpOnly() && cookie.matchesSecurityOrigin(origin))};
120
+ }
@@ -5,16 +5,32 @@
5
5
  import * as SDK from '../../../core/sdk/sdk.js';
6
6
  import {areOriginsEquivalent, extractContextOrigin} from '../AiOrigins.js';
7
7
 
8
+ /**
9
+ * Maximum number of target origins allowed in a single batch query to bound
10
+ * model iteration, memory usage, and CDP traffic.
11
+ */
8
12
  export const MAX_TARGET_ORIGINS = 100;
9
13
 
10
14
  /**
11
- * Resolves and filters active DOM storage partitions from the Target Manager matching the given context constraints.
15
+ * Resolves active DOM storage partitions from all DOMStorageModel instances
16
+ * matching origin constraints under the primary page target tree.
17
+ *
18
+ * In Chromium, storage is partitioned by StorageKey (origin + top-level site
19
+ * context). A single origin can have multiple distinct storage partitions
20
+ * (e.g. first-party page vs embedded third-party iframe). Furthermore, DevTools
21
+ * creates a separate DOMStorageModel per frame subtarget.
22
+ *
23
+ * This function:
24
+ * 1. Enables DOMStorageModel on-demand for subtargets in the primary page tree.
25
+ * 2. Deduplicates partitions across multiple subtargets sharing the same storageKey.
26
+ * 3. Preserves distinct partition keys for the same origin unless a specific storageKey is requested.
12
27
  *
13
28
  * @param origin The partition origin to match.
14
29
  * @param type The DOM storage type ('localStorage' or 'sessionStorage') to filter for.
15
30
  * @param targetManager The TargetManager instance to query for DOMStorageModels.
16
31
  * @param primaryPageTarget The primary page target to ensure target-tree containment.
17
- * @param storageKey Optional. If specified, resolves only the partition matching this unique key and the target origin.
32
+ * @param storageKey Optional. If specified, resolves only the partition matching this unique key.
33
+ * @returns Array of unique DOMStorage partition handles matching constraints.
18
34
  */
19
35
  export function resolveDOMStorages(
20
36
  origin: string,
@@ -24,13 +40,15 @@ export function resolveDOMStorages(
24
40
  storageKey?: string,
25
41
  ): SDK.DOMStorageModel.DOMStorage[] {
26
42
  const resolvedStorages: SDK.DOMStorageModel.DOMStorage[] = [];
43
+ const seenStorageKeys = new Set<string>();
27
44
  const isLocalStorage = type === 'localStorage';
28
45
  const targetOrigin = extractContextOrigin(origin);
29
46
 
30
47
  const domStorageModels = targetManager.models(SDK.DOMStorageModel.DOMStorageModel);
31
48
  for (const domStorageModel of domStorageModels) {
49
+ // Scope models strictly to the primary page target tree (including subframes and OOPIFs)
50
+ // while ignoring unrelated targets like service workers, extensions, or other tabs.
32
51
  if (domStorageModel.target().outermostTarget() !== primaryPageTarget) {
33
- // Skip DOMStorageModels that don't point to the same outermost target.
34
52
  continue;
35
53
  }
36
54
 
@@ -43,15 +61,22 @@ export function resolveDOMStorages(
43
61
  continue;
44
62
  }
45
63
  const currentStorageKey = storage.storageKey;
46
- if (!currentStorageKey) {
64
+ // In multi-frame or subtarget pages, multiple DOMStorageModel instances can
65
+ // report identical storage keys for the same underlying partition. Deduplicate
66
+ // by storageKey to prevent duplicate partition handles across models (which
67
+ // would cause double-counting storage usage and duplicate CDP requests).
68
+ if (!currentStorageKey || seenStorageKeys.has(currentStorageKey)) {
47
69
  continue;
48
70
  }
71
+ seenStorageKeys.add(currentStorageKey);
49
72
 
50
73
  // If storageKey is specified, only match that exact partition key.
51
74
  if (storageKey && storageKey !== currentStorageKey) {
52
75
  continue;
53
76
  }
54
77
 
78
+ // Parse the serialized StorageKey (e.g. "https://example.com/^0https://top.com") to
79
+ // extract the partition's origin for equivalence comparison.
55
80
  const parsedKey = SDK.StorageKeyManager.parseStorageKey(currentStorageKey);
56
81
  if (areOriginsEquivalent(parsedKey.origin, targetOrigin)) {
57
82
  resolvedStorages.push(storage);
@@ -61,3 +86,27 @@ export function resolveDOMStorages(
61
86
 
62
87
  return resolvedStorages;
63
88
  }
89
+
90
+ /**
91
+ * Calculates the total size in bytes of all key-value entries across the provided
92
+ * DOMStorage partitions.
93
+ *
94
+ * Transient CDP failures (e.g. target detachment during frame navigation) are caught
95
+ * gracefully to prevent failing the entire storage calculation.
96
+ *
97
+ * @param storages Array of DOMStorage partition handles to inspect.
98
+ * @returns Total storage size in bytes.
99
+ */
100
+ export async function calculateDOMStoragesUsage(storages: SDK.DOMStorageModel.DOMStorage[]): Promise<number> {
101
+ const itemBatches = await Promise.all(storages.map(storage => storage.getItems().catch(() => null)));
102
+ let totalBytes = 0;
103
+ for (const items of itemBatches) {
104
+ if (items) {
105
+ for (const [key, value] of items) {
106
+ // UTF-16 encoded strings use 2 bytes per character.
107
+ totalBytes += (key.length + value.length) * 2;
108
+ }
109
+ }
110
+ }
111
+ return totalBytes;
112
+ }
@@ -31,9 +31,9 @@ export interface ExecuteJavaScriptArgs extends ToolArgs {
31
31
 
32
32
  export class ExecuteJavaScriptTool implements
33
33
  DataTool<ExecuteJavaScriptArgs, unknown, BaseToolCapability&PageExecutionCapability&StyleMutationCapability> {
34
- readonly name = ToolName.EXECUTE_JAVASCRIPT;
34
+ readonly name: ToolName = ToolName.EXECUTE_JAVASCRIPT;
35
35
 
36
- readonly description =
36
+ readonly description: string =
37
37
  'This function allows you to run JavaScript code on the inspected page to access the element styles and page content.\nCall this function to gather additional information or modify the page state. Call this function enough times to investigate the user request. Note: You cannot make network requests using this function.';
38
38
 
39
39
  static async validateAndFormatCode(code: string): Promise<{formattedCode?: string, error?: string}> {
@@ -77,43 +77,19 @@ export class ExecuteJavaScriptTool implements
77
77
  # Instructions
78
78
 
79
79
  * To return data, define a top-level \`data\` variable and populate it with data you want to get. Only JSON-serializable objects can be assigned to \`data\`.
80
- * If you modify styles on an element, ALWAYS call the pre-defined global \`async setElementStyles(el: Element, styles: object)\` function. This function is an internal mechanism for you and should never be presented as a command/advice to the user.
81
- * **CRITICAL** Only get styles that might be relevant to the user request.
80
+ * $0 refers to the currently selected DOM node (or document body if none selected).
82
81
  * **CRITICAL** Never assume a selector for the elements unless you verified your knowledge.
83
- * **CRITICAL** Consider that \`data\` variable from the previous function calls are not available in a new function call.
82
+ * **CRITICAL** Variables from previous function calls are not available in subsequent calls.
84
83
  * **CRITICAL** Keep code concise (max 40 lines and 2,500 characters). Split complex logic into multiple steps.
85
84
  * **CRITICAL** Network requests (e.g., fetch, XMLHttpRequest) are disabled and cannot be made.
86
85
 
87
- For example, the code to change element styles:
88
-
89
- \`\`\`
90
- await setElementStyles($0, {
91
- color: 'blue',
92
- });
93
- \`\`\`
94
-
95
- For example, the code to get overlapping elements:
86
+ For example, to query DOM elements:
96
87
 
97
88
  \`\`\`
98
89
  const data = {
99
- overlappingElements: Array.from(document.querySelectorAll('*'))
100
- .filter(el => {
101
- const rect = el.getBoundingClientRect();
102
- const popupRect = $0.getBoundingClientRect();
103
- return (
104
- el !== $0 &&
105
- rect.left < popupRect.right &&
106
- rect.right > popupRect.left &&
107
- rect.top < popupRect.bottom &&
108
- rect.bottom > popupRect.top
109
- );
110
- })
111
- .map(el => ({
112
- tagName: el.tagName,
113
- id: el.id,
114
- className: el.className,
115
- zIndex: window.getComputedStyle(el)['z-index']
116
- }))
90
+ title: document.title,
91
+ elementText: $0?.textContent?.trim(),
92
+ childCount: $0?.children.length,
117
93
  };
118
94
  \`\`\`
119
95
  `,