chrome-devtools-frontend 1.0.1522585 → 1.0.1525561

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 (357) hide show
  1. package/AUTHORS +1 -0
  2. package/docs/README.md +1 -0
  3. package/docs/policy/README.md +1 -0
  4. package/docs/policy/console-policy.md +144 -0
  5. package/docs/policy/images/console-policy1.png +0 -0
  6. package/docs/policy/images/console-policy2.png +0 -0
  7. package/docs/policy/images/console-policy3.png +0 -0
  8. package/docs/policy/slow-close.md +22 -19
  9. package/docs/ui_engineering.md +22 -0
  10. package/front_end/Tests.js +1 -1
  11. package/front_end/core/common/Color.ts +13 -9
  12. package/front_end/core/common/ColorConverter.ts +9 -7
  13. package/front_end/core/common/Gzip.ts +1 -1
  14. package/front_end/core/common/MapWithDefault.ts +5 -3
  15. package/front_end/core/common/ResourceType.ts +0 -12
  16. package/front_end/core/common/ReturnToPanel.ts +6 -4
  17. package/front_end/core/common/Trie.ts +4 -2
  18. package/front_end/core/host/AidaClient.ts +3 -3
  19. package/front_end/core/host/GdpClient.ts +7 -5
  20. package/front_end/core/host/InspectorFrontendHostAPI.ts +7 -5
  21. package/front_end/core/host/Platform.ts +5 -3
  22. package/front_end/core/host/UserMetrics.ts +6 -4
  23. package/front_end/core/platform/ArrayUtilities.ts +1 -1
  24. package/front_end/core/platform/StringUtilities.ts +34 -31
  25. package/front_end/core/root/Runtime.ts +1 -1
  26. package/front_end/core/sdk/CSSMetadata.ts +6 -4
  27. package/front_end/core/sdk/CSSPropertyParser.ts +17 -13
  28. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +19 -13
  29. package/front_end/core/sdk/ChildTargetManager.ts +35 -0
  30. package/front_end/core/sdk/DOMModel.ts +1 -1
  31. package/front_end/core/sdk/EventBreakpointsModel.ts +4 -2
  32. package/front_end/core/sdk/HttpReasonPhraseStrings.ts +4 -2
  33. package/front_end/core/sdk/NetworkManager.ts +8 -48
  34. package/front_end/core/sdk/NetworkRequest.ts +0 -28
  35. package/front_end/core/sdk/PageResourceLoader.ts +1 -1
  36. package/front_end/core/sdk/PreloadingModel.ts +22 -18
  37. package/front_end/core/sdk/RehydratingConnection.ts +1 -1
  38. package/front_end/core/sdk/RehydratingObject.ts +1 -1
  39. package/front_end/core/sdk/RemoteObject.ts +1 -1
  40. package/front_end/core/sdk/ResourceTreeModel.ts +2 -0
  41. package/front_end/{models/source_map_scopes → core/sdk}/ScopeTreeCache.ts +8 -7
  42. package/front_end/core/sdk/ScreenCaptureModel.ts +24 -20
  43. package/front_end/core/sdk/Target.ts +7 -1
  44. package/front_end/core/sdk/TraceObject.ts +2 -2
  45. package/front_end/core/sdk/sdk.ts +2 -0
  46. package/front_end/entrypoints/formatter_worker/FormatterActions.ts +7 -0
  47. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +15 -12
  48. package/front_end/entrypoints/formatter_worker/Substitute.ts +6 -4
  49. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +24 -16
  50. package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +2 -1
  51. package/front_end/entrypoints/main/MainImpl.ts +6 -4
  52. package/front_end/generated/InspectorBackendCommands.js +2 -2
  53. package/front_end/generated/protocol-mapping.d.ts +3 -2
  54. package/front_end/generated/protocol-proxy-api.d.ts +3 -1
  55. package/front_end/generated/protocol.ts +7 -1
  56. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +55 -14
  57. package/front_end/models/ai_assistance/agents/StylingAgent.ts +83 -222
  58. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +23 -0
  59. package/front_end/models/ai_assistance/performance/AIContext.ts +19 -4
  60. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +4 -2
  61. package/front_end/models/autofill_manager/AutofillManager.ts +4 -2
  62. package/front_end/models/cpu_profile/CPUProfileDataModel.ts +1 -1
  63. package/front_end/models/crux-manager/CrUXManager.ts +1 -1
  64. package/front_end/models/extensions/HostUrlPattern.ts +13 -5
  65. package/front_end/models/formatter/FormatterWorkerPool.ts +1 -1
  66. package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +1 -1
  67. package/front_end/models/issues_manager/CookieIssue.ts +2 -2
  68. package/front_end/models/issues_manager/MarkdownIssueDescription.ts +1 -1
  69. package/front_end/models/issues_manager/SharedDictionaryIssue.ts +20 -0
  70. package/front_end/models/issues_manager/descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
  71. package/front_end/models/issues_manager/descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
  72. package/front_end/models/javascript_metadata/NativeFunctions.js +8 -0
  73. package/front_end/models/network_time_calculator/Calculator.ts +4 -2
  74. package/front_end/models/network_time_calculator/RequestTimeRanges.ts +6 -4
  75. package/front_end/models/source_map_scopes/NamesResolver.ts +8 -8
  76. package/front_end/models/source_map_scopes/source_map_scopes.ts +0 -2
  77. package/front_end/models/text_utils/ContentProvider.ts +6 -4
  78. package/front_end/models/trace/extras/TraceTree.ts +1 -1
  79. package/front_end/models/trace/handlers/FramesHandler.ts +7 -5
  80. package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +13 -7
  81. package/front_end/models/trace/handlers/MetaHandler.ts +16 -14
  82. package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +20 -8
  83. package/front_end/models/trace/handlers/helpers.ts +1 -1
  84. package/front_end/models/trace/handlers/types.ts +23 -19
  85. package/front_end/models/trace/helpers/Timing.ts +4 -2
  86. package/front_end/models/trace/helpers/Trace.ts +8 -4
  87. package/front_end/models/trace/insights/DocumentLatency.ts +1 -1
  88. package/front_end/models/trace/insights/INPBreakdown.ts +13 -2
  89. package/front_end/models/trace/insights/LCPBreakdown.ts +14 -2
  90. package/front_end/models/trace/insights/NetworkDependencyTree.ts +2 -2
  91. package/front_end/models/trace/types/File.ts +12 -8
  92. package/front_end/models/trace/types/Timing.ts +1 -1
  93. package/front_end/models/trace/types/TraceEvents.ts +37 -23
  94. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +1 -1
  95. package/front_end/panels/ai_assistance/components/MarkdownRendererWithCodeBlock.ts +12 -10
  96. package/front_end/panels/application/KeyValueStorageItemsView.ts +31 -33
  97. package/front_end/panels/application/components/InterestGroupAccessGrid.ts +6 -11
  98. package/front_end/panels/application/components/OriginTrialTreeView.ts +7 -5
  99. package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -0
  100. package/front_end/panels/application/components/ReportsGrid.ts +4 -10
  101. package/front_end/panels/application/components/SharedStorageAccessGrid.ts +5 -13
  102. package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +1 -1
  103. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +3 -7
  104. package/front_end/panels/application/preloading/components/PreloadingString.ts +2 -2
  105. package/front_end/panels/application/preloading/components/RuleSetGrid.ts +3 -10
  106. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -2
  107. package/front_end/panels/browser_debugger/browser_debugger-meta.ts +7 -5
  108. package/front_end/panels/changes/ChangesSidebar.ts +105 -96
  109. package/front_end/panels/changes/ChangesView.ts +69 -69
  110. package/front_end/panels/changes/CombinedDiffView.ts +1 -1
  111. package/front_end/panels/changes/changesSidebar.css +3 -0
  112. package/front_end/panels/changes/changesView.css +4 -0
  113. package/front_end/panels/console/ConsoleView.ts +2 -2
  114. package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +22 -35
  115. package/front_end/panels/elements/ComputedStyleWidget.ts +1 -1
  116. package/front_end/panels/elements/ElementStatePaneWidget.ts +12 -0
  117. package/front_end/panels/elements/ElementsTreeElement.ts +9 -5
  118. package/front_end/panels/elements/ElementsTreeOutline.ts +11 -8
  119. package/front_end/panels/elements/PropertyRenderer.ts +19 -15
  120. package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -4
  121. package/front_end/panels/elements/StylesSidebarPane.ts +2 -2
  122. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +4 -2
  123. package/front_end/panels/elements/components/AdornerManager.ts +5 -3
  124. package/front_end/panels/lighthouse/LighthouseController.ts +5 -0
  125. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +43 -46
  126. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +260 -157
  127. package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +28 -21
  128. package/front_end/panels/media/PlayerPropertiesView.ts +1 -1
  129. package/front_end/panels/network/NetworkDataGridNode.ts +2 -44
  130. package/front_end/panels/network/NetworkLogView.ts +6 -4
  131. package/front_end/panels/network/RequestPreviewView.ts +0 -7
  132. package/front_end/panels/network/components/RequestHeadersView.ts +0 -6
  133. package/front_end/panels/network/components/components.ts +0 -2
  134. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +1 -1
  135. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +4 -2
  136. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +12 -19
  137. package/front_end/panels/search/SearchResultsPane.ts +2 -3
  138. package/front_end/panels/security/IPProtectionView.ts +1 -1
  139. package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +4 -0
  140. package/front_end/panels/settings/emulation/utils/StructuredHeaders.ts +45 -37
  141. package/front_end/panels/sources/BreakpointsViewUtils.ts +11 -9
  142. package/front_end/panels/sources/DebuggerPlugin.ts +8 -4
  143. package/front_end/panels/sources/SourcesPanel.ts +1 -1
  144. package/front_end/panels/sources/UISourceCodeFrame.ts +1 -1
  145. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +4 -2
  146. package/front_end/panels/timeline/CountersGraph.ts +12 -5
  147. package/front_end/panels/timeline/EasterEgg.d.ts +5 -3
  148. package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +8 -6
  149. package/front_end/panels/timeline/ModificationsManager.ts +5 -3
  150. package/front_end/panels/timeline/ThreadAppender.ts +7 -5
  151. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +10 -8
  152. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -1
  153. package/front_end/panels/timeline/TimelinePanel.ts +10 -8
  154. package/front_end/panels/timeline/TimelineSelection.ts +4 -2
  155. package/front_end/panels/timeline/TimelineUIUtils.ts +5 -3
  156. package/front_end/panels/timeline/components/BreadcrumbsUI.ts +6 -4
  157. package/front_end/panels/timeline/components/Utils.ts +1 -1
  158. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +5 -3
  159. package/front_end/panels/timeline/utils/Helpers.ts +1 -1
  160. package/front_end/panels/utils/utils.ts +1 -7
  161. package/front_end/services/trace_bounds/TraceBounds.ts +4 -2
  162. package/front_end/services/tracing/PerformanceTracing.ts +1 -1
  163. package/front_end/third_party/chromium/README.chromium +1 -1
  164. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  165. package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
  166. package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
  167. package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
  168. package/front_end/third_party/codemirror.next/package.json +3 -2
  169. package/front_end/third_party/puppeteer/README.chromium +2 -2
  170. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.d.ts +8 -10
  171. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.d.ts.map +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.js +8 -10
  173. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.js.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts +28 -30
  175. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
  176. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js +27 -29
  177. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +34 -38
  179. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
  180. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js +34 -38
  181. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
  182. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.d.ts +8 -1
  183. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.d.ts.map +1 -1
  184. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.js +12 -14
  185. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.js.map +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +92 -108
  187. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  188. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +33 -39
  189. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  190. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +5 -3
  192. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
  193. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
  194. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +1 -1
  195. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
  196. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts +4 -2
  197. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +14 -5
  199. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
  200. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +1 -0
  201. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  202. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +12 -6
  203. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  204. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.d.ts.map +1 -1
  205. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js +24 -2
  206. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js.map +1 -1
  207. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
  208. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts +1 -0
  209. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  210. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js +3 -0
  211. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
  212. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.d.ts +13 -22
  213. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.d.ts.map +1 -1
  214. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.js +13 -22
  215. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.js.map +1 -1
  216. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.d.ts +6 -8
  217. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.d.ts.map +1 -1
  218. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.js +6 -8
  219. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.js.map +1 -1
  220. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
  221. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
  222. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  223. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts +1 -1
  224. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  225. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +6 -3
  226. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
  227. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts +5 -7
  228. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
  229. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js +5 -7
  230. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js.map +1 -1
  231. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  232. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  233. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  234. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  235. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +188 -224
  236. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +140 -166
  237. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.d.ts +8 -10
  238. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.d.ts.map +1 -1
  239. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.js +8 -10
  240. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.js.map +1 -1
  241. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts +28 -30
  242. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
  243. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js +27 -29
  244. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
  245. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +34 -38
  246. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
  247. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js +34 -38
  248. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
  249. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.d.ts +8 -1
  250. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.d.ts.map +1 -1
  251. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.js +12 -14
  252. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.js.map +1 -1
  253. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +92 -108
  254. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  255. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +33 -39
  256. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  257. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
  258. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +5 -3
  259. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
  260. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
  261. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +1 -1
  262. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
  263. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts +4 -2
  264. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  265. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +15 -6
  266. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
  267. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +1 -0
  268. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  269. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +12 -6
  270. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  271. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.d.ts.map +1 -1
  272. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js +24 -2
  273. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js.map +1 -1
  274. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts +1 -0
  275. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  276. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js +3 -0
  277. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
  278. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.d.ts +13 -22
  279. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.d.ts.map +1 -1
  280. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.js +13 -22
  281. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.js.map +1 -1
  282. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.d.ts +6 -8
  283. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.d.ts.map +1 -1
  284. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.js +6 -8
  285. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.js.map +1 -1
  286. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
  287. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
  288. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +1 -1
  289. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  290. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +6 -3
  291. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
  292. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts +5 -7
  293. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
  294. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js +5 -7
  295. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js.map +1 -1
  296. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  297. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  298. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  299. package/front_end/third_party/puppeteer/package/lib/types.d.ts +188 -224
  300. package/front_end/third_party/puppeteer/package/package.json +3 -3
  301. package/front_end/third_party/puppeteer/package/src/api/Dialog.ts +8 -10
  302. package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +27 -29
  303. package/front_end/third_party/puppeteer/package/src/api/Frame.ts +34 -38
  304. package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +17 -14
  305. package/front_end/third_party/puppeteer/package/src/api/Page.ts +92 -108
  306. package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +5 -3
  307. package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +5 -1
  308. package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +28 -3
  309. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +16 -7
  310. package/front_end/third_party/puppeteer/package/src/bidi/core/Browser.ts +28 -2
  311. package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +4 -0
  312. package/front_end/third_party/puppeteer/package/src/cdp/PredefinedNetworkConditions.ts +13 -22
  313. package/front_end/third_party/puppeteer/package/src/common/Device.ts +6 -8
  314. package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
  315. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +6 -3
  316. package/front_end/third_party/puppeteer/package/src/node/PuppeteerNode.ts +5 -7
  317. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  318. package/front_end/ui/components/chrome_link/ChromeLink.ts +4 -2
  319. package/front_end/ui/components/dialogs/Dialog.ts +13 -9
  320. package/front_end/ui/components/docs/linear_memory_inspector/basic.ts +21 -9
  321. package/front_end/ui/components/highlighting/HighlightElement.ts +77 -0
  322. package/front_end/ui/components/highlighting/HighlightManager.ts +58 -1
  323. package/front_end/ui/components/highlighting/highlighting.ts +2 -0
  324. package/front_end/ui/components/markdown_view/MarkdownImagesMap.ts +5 -3
  325. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -3
  326. package/front_end/ui/components/menus/SelectMenu.ts +6 -4
  327. package/front_end/ui/components/survey_link/SurveyLink.ts +4 -2
  328. package/front_end/ui/components/text_editor/config.ts +10 -6
  329. package/front_end/ui/components/text_editor/javascript.ts +8 -4
  330. package/front_end/ui/components/tooltips/Tooltip.ts +22 -5
  331. package/front_end/ui/legacy/ForwardedInputEventHandler.ts +4 -2
  332. package/front_end/ui/legacy/GlassPane.ts +1 -1
  333. package/front_end/ui/legacy/SettingsUI.ts +1 -5
  334. package/front_end/ui/legacy/Treeoutline.ts +12 -33
  335. package/front_end/ui/legacy/UIUtils.ts +19 -1
  336. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +12 -10
  337. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +30 -32
  338. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
  339. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +25 -25
  340. package/front_end/ui/legacy/components/data_grid/dataGrid.css +5 -0
  341. package/front_end/ui/legacy/components/inline_editor/AnimationTimingModel.ts +4 -2
  342. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +4 -2
  343. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +8 -6
  344. package/front_end/ui/legacy/components/perf_ui/PieChart.ts +6 -4
  345. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -3
  346. package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +18 -20
  347. package/front_end/ui/legacy/components/source_frame/XMLView.ts +22 -16
  348. package/front_end/ui/legacy/components/source_frame/xmlView.css +0 -2
  349. package/front_end/ui/legacy/components/utils/Linkifier.ts +6 -4
  350. package/front_end/ui/visual_logging/Debugging.ts +10 -6
  351. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -3
  352. package/inspector_overlay/common.ts +5 -3
  353. package/inspector_overlay/highlight_grid_common.ts +1 -1
  354. package/package.json +1 -1
  355. package/front_end/Images/src/bundle.svg +0 -3
  356. package/front_end/panels/network/components/WebBundleInfoView.css +0 -27
  357. package/front_end/panels/network/components/WebBundleInfoView.ts +0 -95
@@ -1,21 +1,24 @@
1
1
  Title: StylingAgent describeElement should describe an element with no children, siblings, or parent
2
2
  Content:
3
+ * Element's uid is 99.
3
4
  * Its selector is `div#myElement`
4
5
  === end content
5
6
 
6
7
  Title: StylingAgent describeElement should describe an element with child element and text nodes
7
8
  Content:
9
+ * Element's uid is 99.
8
10
  * Its selector is `div#parentElement`
9
- * It has 2 child element nodes: `span.child1`, `span.child2`
11
+ * It has 2 child element nodes: `span.child1` (uid=undefined), `span.child2` (uid=undefined)
10
12
  * It only has 1 child text node
11
13
  === end content
12
14
 
13
15
  Title: StylingAgent describeElement should describe an element with siblings and a parent
14
16
  Content:
17
+ * Element's uid is 99.
15
18
  * Its selector is `div#parentElement`
16
- * It has a next sibling and it is an element node
19
+ * It has a next sibling and it is an element (uid=undefined) node
17
20
  * It has a previous sibling and it is a non element node
18
- * Its parent's selector is `div#grandparentElement`
21
+ * Its parent's selector is `div#grandparentElement` (uid=undefined)
19
22
  * Its parent is a non element node
20
23
  * Its parent has only 1 child element node
21
24
  * Its parent has only 1 child text node
@@ -52,6 +55,40 @@ Content:
52
55
  }
53
56
  ],
54
57
  "function_declarations": [
58
+ {
59
+ "name": "getStyles",
60
+ "description": "Get computed and source styles for one or multiple elements on the inspected page for multiple elements at once by uid.\n\n**CRITICAL** Use selectors to refer to elements in the text output. Do not use uids.\n**CRITICAL** Always provide the explanation argument to explain what and why you query.",
61
+ "parameters": {
62
+ "type": 6,
63
+ "description": "",
64
+ "nullable": false,
65
+ "properties": {
66
+ "explanation": {
67
+ "type": 1,
68
+ "description": "Explain why you want to get styles",
69
+ "nullable": false
70
+ },
71
+ "elements": {
72
+ "type": 5,
73
+ "description": "A list of element uids to get data for",
74
+ "items": {
75
+ "type": 1,
76
+ "description": "An element uid."
77
+ },
78
+ "nullable": false
79
+ },
80
+ "styleProperties": {
81
+ "type": 5,
82
+ "description": "One or more CSS style property names to fetch.",
83
+ "nullable": false,
84
+ "items": {
85
+ "type": 1,
86
+ "description": "A CSS style property name to retrieve. For example, 'background-color'."
87
+ }
88
+ }
89
+ }
90
+ }
91
+ },
55
92
  {
56
93
  "name": "executeJavaScript",
57
94
  "description": "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.",
@@ -62,7 +99,7 @@ Content:
62
99
  "properties": {
63
100
  "code": {
64
101
  "type": 1,
65
- "description": "JavaScript code snippet to run on the inspected page. Make sure the code is formatted for readability.\n\n# Instructions\n\n* 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`.\n* 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.\n* Use `window.getComputedStyle` to gather **computed** styles and make sure that you take the distinction between authored styles and computed styles into account.\n* **CRITICAL** Only get styles that might be relevant to the user request.\n* **CRITICAL** Call `window.getComputedStyle` only once per element and store results into a local variable. Never try to return all the styles of the element in `data`.\n* **CRITICAL** Never assume a selector for the elements unless you verified your knowledge.\n* **CRITICAL** Consider that `data` variable from the previous function calls are not available in a new function call.\n\nFor example, the code to return basic styles:\n\n```\nconst styles = window.getComputedStyle($0);\nconst data = {\n display: styles['display'],\n visibility: styles['visibility'],\n position: styles['position'],\n left: styles['right'],\n top: styles['top'],\n width: styles['width'],\n height: styles['height'],\n zIndex: styles['z-index']\n};\n```\n\nFor example, the code to change element styles:\n\n```\nawait setElementStyles($0, {\n color: 'blue',\n});\n```\n\nFor example, the code to get current and parent styles at once:\n\n```\nconst styles = window.getComputedStyle($0);\nconst parentStyles = window.getComputedStyle($0.parentElement);\nconst data = {\n currentElementStyles: {\n display: styles['display'],\n visibility: styles['visibility'],\n position: styles['position'],\n left: styles['right'],\n top: styles['top'],\n width: styles['width'],\n height: styles['height'],\n zIndex: styles['z-index'],\n },\n parentElementStyles: {\n display: parentStyles['display'],\n visibility: parentStyles['visibility'],\n position: parentStyles['position'],\n left: parentStyles['right'],\n top: parentStyles['top'],\n width: parentStyles['width'],\n height: parentStyles['height'],\n zIndex: parentStyles['z-index'],\n },\n};\n```\n\nFor example, the code to get check siblings and overlapping elements:\n\n```\nconst computedStyles = window.getComputedStyle($0);\nconst parentComputedStyles = window.getComputedStyle($0.parentElement);\nconst data = {\n numberOfChildren: $0.children.length,\n numberOfSiblings: $0.parentElement.children.length,\n hasPreviousSibling: !!$0.previousElementSibling,\n hasNextSibling: !!$0.nextElementSibling,\n elementStyles: {\n display: computedStyles['display'],\n visibility: computedStyles['visibility'],\n position: computedStyles['position'],\n clipPath: computedStyles['clip-path'],\n zIndex: computedStyles['z-index']\n },\n parentStyles: {\n display: parentComputedStyles['display'],\n visibility: parentComputedStyles['visibility'],\n position: parentComputedStyles['position'],\n clipPath: parentComputedStyles['clip-path'],\n zIndex: parentComputedStyles['z-index']\n },\n overlappingElements: Array.from(document.querySelectorAll('*'))\n .filter(el => {\n const rect = el.getBoundingClientRect();\n const popupRect = $0.getBoundingClientRect();\n return (\n el !== $0 &&\n rect.left < popupRect.right &&\n rect.right > popupRect.left &&\n rect.top < popupRect.bottom &&\n rect.bottom > popupRect.top\n );\n })\n .map(el => ({\n tagName: el.tagName,\n id: el.id,\n className: el.className,\n zIndex: window.getComputedStyle(el)['z-index']\n }))\n};\n```\n"
102
+ "description": "JavaScript code snippet to run on the inspected page. Make sure the code is formatted for readability.\n\n# Instructions\n\n* 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`.\n* 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.\n* **CRITICAL** Only get styles that might be relevant to the user request.\n* **CRITICAL** Never assume a selector for the elements unless you verified your knowledge.\n* **CRITICAL** Consider that `data` variable from the previous function calls are not available in a new function call.\n\nFor example, the code to change element styles:\n\n```\nawait setElementStyles($0, {\n color: 'blue',\n});\n```\n\nFor example, the code to get overlapping elements:\n\n```\nconst data = {\n overlappingElements: Array.from(document.querySelectorAll('*'))\n .filter(el => {\n const rect = el.getBoundingClientRect();\n const popupRect = $0.getBoundingClientRect();\n return (\n el !== $0 &&\n rect.left < popupRect.right &&\n rect.right > popupRect.left &&\n rect.top < popupRect.bottom &&\n rect.bottom > popupRect.top\n );\n })\n .map(el => ({\n tagName: el.tagName,\n id: el.id,\n className: el.className,\n zIndex: window.getComputedStyle(el)['z-index']\n }))\n};\n```\n"
66
103
  },
67
104
  "thought": {
68
105
  "type": 1,
@@ -153,7 +190,7 @@ Content:
153
190
  "details": [
154
191
  {
155
192
  "title": "Data used",
156
- "text": "* Its selector is `undefined`"
193
+ "text": "* Element's uid is 99.\n* Its selector is `undefined`"
157
194
  }
158
195
  ]
159
196
  },
@@ -174,7 +211,7 @@ Content:
174
211
  {
175
212
  "parts": [
176
213
  {
177
- "text": "# Inspected element\n\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
214
+ "text": "# Inspected element\n\n* Element's uid is 99.\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
178
215
  }
179
216
  ],
180
217
  "role": 1
@@ -194,13 +231,13 @@ Title: StylingAgent run correctly handles historical_contexts in AIDA requests
194
231
  Content:
195
232
  [
196
233
  {
197
- "text": "# Inspected element\n\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
234
+ "text": "# Inspected element\n\n* Element's uid is 99.\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
198
235
  },
199
236
  [
200
237
  {
201
238
  "parts": [
202
239
  {
203
- "text": "# Inspected element\n\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
240
+ "text": "# Inspected element\n\n* Element's uid is 99.\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
204
241
  }
205
242
  ],
206
243
  "role": 1
@@ -237,7 +274,7 @@ Content:
237
274
  "details": [
238
275
  {
239
276
  "title": "Data used",
240
- "text": "* Its selector is `undefined`"
277
+ "text": "* Element's uid is 99.\n* Its selector is `undefined`"
241
278
  }
242
279
  ]
243
280
  },
@@ -266,7 +303,7 @@ Content:
266
303
  "details": [
267
304
  {
268
305
  "title": "Data used",
269
- "text": "* Its selector is `undefined`"
306
+ "text": "* Element's uid is 99.\n* Its selector is `undefined`"
270
307
  }
271
308
  ]
272
309
  },
@@ -298,7 +335,7 @@ Content:
298
335
  "details": [
299
336
  {
300
337
  "title": "Data used",
301
- "text": "* Its selector is `undefined`"
338
+ "text": "* Element's uid is 99.\n* Its selector is `undefined`"
302
339
  }
303
340
  ]
304
341
  },
@@ -327,7 +364,7 @@ Content:
327
364
  "details": [
328
365
  {
329
366
  "title": "Data used",
330
- "text": "* Its selector is `undefined`"
367
+ "text": "* Element's uid is 99.\n* Its selector is `undefined`"
331
368
  }
332
369
  ]
333
370
  },
@@ -354,7 +391,7 @@ Content:
354
391
  "details": [
355
392
  {
356
393
  "title": "Data used",
357
- "text": "* Its selector is `undefined`"
394
+ "text": "* Element's uid is 99.\n* Its selector is `undefined`"
358
395
  }
359
396
  ]
360
397
  },
@@ -388,7 +425,7 @@ Content:
388
425
  {
389
426
  "parts": [
390
427
  {
391
- "text": "# Inspected element\n\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
428
+ "text": "# Inspected element\n\n* Element's uid is 99.\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test"
392
429
  }
393
430
  ],
394
431
  "role": 1
@@ -492,6 +529,7 @@ Title: StylingAgent enhanceQuery does not add multimodal input evaluation prompt
492
529
  Content:
493
530
  # Inspected element
494
531
 
532
+ * Element's uid is 99.
495
533
  * Its selector is `div#myElement`
496
534
 
497
535
  # User request
@@ -503,6 +541,7 @@ Title: StylingAgent enhanceQuery does not add multimodal input evaluation prompt
503
541
  Content:
504
542
  # Inspected element
505
543
 
544
+ * Element's uid is 99.
506
545
  * Its selector is `div#myElement`
507
546
 
508
547
  # User request
@@ -528,6 +567,7 @@ In case query is related to the image, ALWAYS first use image evaluation to get
528
567
 
529
568
  # Inspected element
530
569
 
570
+ * Element's uid is 99.
531
571
  * Its selector is `div#myElement`
532
572
 
533
573
  # User request
@@ -551,6 +591,7 @@ In case query is related to the image, ALWAYS first use image evaluation to get
551
591
 
552
592
  # Inspected element
553
593
 
594
+ * Element's uid is 99.
554
595
  * Its selector is `div#myElement`
555
596
 
556
597
  # User request
@@ -7,6 +7,7 @@ import * as i18n from '../../../core/i18n/i18n.js';
7
7
  import * as Platform from '../../../core/platform/platform.js';
8
8
  import * as Root from '../../../core/root/root.js';
9
9
  import * as SDK from '../../../core/sdk/sdk.js';
10
+ import type * as Protocol from '../../../generated/protocol.js';
10
11
  import {ChangeManager} from '../ChangeManager.js';
11
12
  import {debugLog} from '../debug.js';
12
13
  import {EvaluateAction, formatError, SideEffectError} from '../EvaluateAction.js';
@@ -228,10 +229,6 @@ export class NodeContext extends ConversationContext<SDK.DOMModel.DOMNode> {
228
229
  }
229
230
  }
230
231
 
231
- type Relation = 'currentElement'|'parentElement';
232
-
233
- const enableDedicatedStyleFunctions = false;
234
-
235
232
  /**
236
233
  * One agent instance handles one conversation. Create a new agent
237
234
  * instance for a new conversation.
@@ -289,107 +286,57 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
289
286
  this,
290
287
  );
291
288
 
292
- if (enableDedicatedStyleFunctions) {
293
- this.declareFunction<{
294
- relations: Relation[],
295
- properties: string[],
296
- thought: string,
297
- }>('getComputedStyles', {
298
- description:
299
- 'Call this function to get the computed styles for the current or the parent element. Use executeJavaScript for more complex queries.',
300
- parameters: {
301
- type: Host.AidaClient.ParametersTypes.OBJECT,
302
- description: '',
303
- nullable: false,
304
- properties: {
305
- thought: {
306
- type: Host.AidaClient.ParametersTypes.STRING,
307
- description: 'Explain why you want to get computed styles',
308
- },
309
- relations: {
310
- type: Host.AidaClient.ParametersTypes.ARRAY,
311
- description: 'A list of relations describing which elements to query.',
312
- items: {
313
- type: Host.AidaClient.ParametersTypes.STRING,
314
- description: 'Which element to query. Either \'currentElement\' or \'parentElement\'',
315
- }
316
- },
317
- properties: {
318
- type: Host.AidaClient.ParametersTypes.ARRAY,
319
- description: 'One or more style property names to fetch',
320
- nullable: false,
321
- items: {
322
- type: Host.AidaClient.ParametersTypes.STRING,
323
- description: 'A computed style property name to retrieve. For example, \'background-color\'.'
324
- }
325
- },
326
- }
327
- },
328
- displayInfoFromArgs: params => {
329
- return {
330
- title: 'Reading computed styles',
331
- thought: params.thought,
332
- action: `getComputedStyles(${JSON.stringify(params.relations)}, ${JSON.stringify(params.properties)})`,
333
- };
334
- },
335
- handler: async (
336
- params,
337
- options,
338
- ) => {
339
- return await this.getComputedStyles(params.relations, params.properties, options);
340
- },
341
- });
342
-
343
- this.declareFunction<{
344
- relations: Relation[],
345
- properties: string[],
346
- thought: string,
347
- }>('getAuthoredStyles', {
348
- description: 'Call this function to get the styles as specified by the page author.',
349
- parameters: {
350
- type: Host.AidaClient.ParametersTypes.OBJECT,
351
- description: '',
352
- nullable: false,
353
- properties: {
354
- thought: {
289
+ this.declareFunction<{
290
+ elements: string[],
291
+ styleProperties: string[],
292
+ explanation: string,
293
+ }>('getStyles', {
294
+ description:
295
+ `Get computed and source styles for one or multiple elements on the inspected page for multiple elements at once by uid.
296
+
297
+ **CRITICAL** Use selectors to refer to elements in the text output. Do not use uids.
298
+ **CRITICAL** Always provide the explanation argument to explain what and why you query.`,
299
+ parameters: {
300
+ type: Host.AidaClient.ParametersTypes.OBJECT,
301
+ description: '',
302
+ nullable: false,
303
+ properties: {
304
+ explanation: {
305
+ type: Host.AidaClient.ParametersTypes.STRING,
306
+ description: 'Explain why you want to get styles',
307
+ nullable: false,
308
+ },
309
+ elements: {
310
+ type: Host.AidaClient.ParametersTypes.ARRAY,
311
+ description: 'A list of element uids to get data for',
312
+ items: {type: Host.AidaClient.ParametersTypes.STRING, description: `An element uid.`},
313
+ nullable: false,
314
+ },
315
+ styleProperties: {
316
+ type: Host.AidaClient.ParametersTypes.ARRAY,
317
+ description: 'One or more CSS style property names to fetch.',
318
+ nullable: false,
319
+ items: {
355
320
  type: Host.AidaClient.ParametersTypes.STRING,
356
- description: 'Explain why you want to get computed styles',
357
- },
358
- relations: {
359
- type: Host.AidaClient.ParametersTypes.ARRAY,
360
- description:
361
- 'A list of relations describing which elements to query. Possible values: \'currentElement\', \'parentElement\'',
362
- items: {
363
- type: Host.AidaClient.ParametersTypes.STRING,
364
- description: 'Which element to query. Either \'currentElement\' or \'parentElement\'',
365
- }
366
- },
367
- properties: {
368
- type: Host.AidaClient.ParametersTypes.ARRAY,
369
- description: 'One or more style property names to fetch',
370
- nullable: false,
371
- items: {
372
- type: Host.AidaClient.ParametersTypes.STRING,
373
- description: 'A computed style property name to retrieve. For example, \'background-color\'.'
374
- }
375
- },
376
- }
377
- },
378
- displayInfoFromArgs: params => {
379
- return {
380
- title: 'Reading authored styles',
381
- thought: params.thought,
382
- action: `getAuthoredStyles(${JSON.stringify(params.relations)}, ${JSON.stringify(params.properties)})`,
383
- };
384
- },
385
- handler: async (
386
- params,
387
- options,
388
- ) => {
389
- return await this.getAuthoredStyles(params.relations, params.properties, options);
390
- },
391
- });
392
- }
321
+ description: 'A CSS style property name to retrieve. For example, \'background-color\'.'
322
+ }
323
+ },
324
+ }
325
+ },
326
+ displayInfoFromArgs: params => {
327
+ return {
328
+ title: 'Reading computed and source styles',
329
+ thought: params.explanation,
330
+ action: `getStyles(${JSON.stringify(params.elements)}, ${JSON.stringify(params.styleProperties)})`,
331
+ };
332
+ },
333
+ handler: async (
334
+ params,
335
+ options,
336
+ ) => {
337
+ return await this.getStyles(params.elements, params.styleProperties, options);
338
+ },
339
+ });
393
340
 
394
341
  this.declareFunction<{
395
342
  title: string,
@@ -413,28 +360,10 @@ Call this function to gather additional information or modify the page state. Ca
413
360
 
414
361
  * 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\`.
415
362
  * 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.
416
- * Use \`window.getComputedStyle\` to gather **computed** styles and make sure that you take the distinction between authored styles and computed styles into account.
417
363
  * **CRITICAL** Only get styles that might be relevant to the user request.
418
- * **CRITICAL** Call \`window.getComputedStyle\` only once per element and store results into a local variable. Never try to return all the styles of the element in \`data\`.
419
364
  * **CRITICAL** Never assume a selector for the elements unless you verified your knowledge.
420
365
  * **CRITICAL** Consider that \`data\` variable from the previous function calls are not available in a new function call.
421
366
 
422
- For example, the code to return basic styles:
423
-
424
- \`\`\`
425
- const styles = window.getComputedStyle($0);
426
- const data = {
427
- display: styles['display'],
428
- visibility: styles['visibility'],
429
- position: styles['position'],
430
- left: styles['right'],
431
- top: styles['top'],
432
- width: styles['width'],
433
- height: styles['height'],
434
- zIndex: styles['z-index']
435
- };
436
- \`\`\`
437
-
438
367
  For example, the code to change element styles:
439
368
 
440
369
  \`\`\`
@@ -443,59 +372,10 @@ await setElementStyles($0, {
443
372
  });
444
373
  \`\`\`
445
374
 
446
- For example, the code to get current and parent styles at once:
447
-
448
- \`\`\`
449
- const styles = window.getComputedStyle($0);
450
- const parentStyles = window.getComputedStyle($0.parentElement);
451
- const data = {
452
- currentElementStyles: {
453
- display: styles['display'],
454
- visibility: styles['visibility'],
455
- position: styles['position'],
456
- left: styles['right'],
457
- top: styles['top'],
458
- width: styles['width'],
459
- height: styles['height'],
460
- zIndex: styles['z-index'],
461
- },
462
- parentElementStyles: {
463
- display: parentStyles['display'],
464
- visibility: parentStyles['visibility'],
465
- position: parentStyles['position'],
466
- left: parentStyles['right'],
467
- top: parentStyles['top'],
468
- width: parentStyles['width'],
469
- height: parentStyles['height'],
470
- zIndex: parentStyles['z-index'],
471
- },
472
- };
473
- \`\`\`
474
-
475
- For example, the code to get check siblings and overlapping elements:
375
+ For example, the code to get overlapping elements:
476
376
 
477
377
  \`\`\`
478
- const computedStyles = window.getComputedStyle($0);
479
- const parentComputedStyles = window.getComputedStyle($0.parentElement);
480
378
  const data = {
481
- numberOfChildren: $0.children.length,
482
- numberOfSiblings: $0.parentElement.children.length,
483
- hasPreviousSibling: !!$0.previousElementSibling,
484
- hasNextSibling: !!$0.nextElementSibling,
485
- elementStyles: {
486
- display: computedStyles['display'],
487
- visibility: computedStyles['visibility'],
488
- position: computedStyles['position'],
489
- clipPath: computedStyles['clip-path'],
490
- zIndex: computedStyles['z-index']
491
- },
492
- parentStyles: {
493
- display: parentComputedStyles['display'],
494
- visibility: parentComputedStyles['visibility'],
495
- position: parentComputedStyles['position'],
496
- clipPath: parentComputedStyles['clip-path'],
497
- zIndex: parentComputedStyles['z-index']
498
- },
499
379
  overlappingElements: Array.from(document.querySelectorAll('*'))
500
380
  .filter(el => {
501
381
  const rect = el.getBoundingClientRect();
@@ -611,7 +491,8 @@ const data = {
611
491
  }
612
492
 
613
493
  static async describeElement(element: SDK.DOMModel.DOMNode): Promise<string> {
614
- let output = `* Its selector is \`${element.simpleSelector()}\``;
494
+ let output = `* Element's uid is ${element.backendNodeId()}.
495
+ * Its selector is \`${element.simpleSelector()}\``;
615
496
  const childNodes = await element.getChildNodesPromise();
616
497
  if (childNodes) {
617
498
  const textChildNodes = childNodes.filter(childNode => childNode.nodeType() === Node.TEXT_NODE);
@@ -625,7 +506,7 @@ const data = {
625
506
  break;
626
507
  default:
627
508
  output += `\n* It has ${elementChildNodes.length} child element nodes: ${
628
- elementChildNodes.map(node => `\`${node.simpleSelector()}\``).join(', ')}`;
509
+ elementChildNodes.map(node => `\`${node.simpleSelector()}\` (uid=${node.backendNodeId()})`).join(', ')}`;
629
510
  }
630
511
 
631
512
  switch (textChildNodes.length) {
@@ -641,14 +522,16 @@ const data = {
641
522
  }
642
523
 
643
524
  if (element.nextSibling) {
644
- const elementOrNodeElementNodeText =
645
- element.nextSibling.nodeType() === Node.ELEMENT_NODE ? 'an element' : 'a non element';
525
+ const elementOrNodeElementNodeText = element.nextSibling.nodeType() === Node.ELEMENT_NODE ?
526
+ `an element (uid=${element.nextSibling.backendNodeId()})` :
527
+ 'a non element';
646
528
  output += `\n* It has a next sibling and it is ${elementOrNodeElementNodeText} node`;
647
529
  }
648
530
 
649
531
  if (element.previousSibling) {
650
- const elementOrNodeElementNodeText =
651
- element.previousSibling.nodeType() === Node.ELEMENT_NODE ? 'an element' : 'a non element';
532
+ const elementOrNodeElementNodeText = element.previousSibling.nodeType() === Node.ELEMENT_NODE ?
533
+ `an element (uid=${element.previousSibling.backendNodeId()})` :
534
+ 'a non element';
652
535
  output += `\n* It has a previous sibling and it is ${elementOrNodeElementNodeText} node`;
653
536
  }
654
537
 
@@ -659,7 +542,7 @@ const data = {
659
542
  const parentNode = element.parentNode;
660
543
  if (parentNode) {
661
544
  const parentChildrenNodes = await parentNode.getChildNodesPromise();
662
- output += `\n* Its parent's selector is \`${parentNode.simpleSelector()}\``;
545
+ output += `\n* Its parent's selector is \`${parentNode.simpleSelector()}\` (uid=${parentNode.backendNodeId()})`;
663
546
  const elementOrNodeElementNodeText = parentNode.nodeType() === Node.ELEMENT_NODE ? 'an element' : 'a non element';
664
547
  output += `\n* Its parent is ${elementOrNodeElementNodeText} node`;
665
548
  if (parentNode.isShadowRoot()) {
@@ -676,7 +559,8 @@ const data = {
676
559
  break;
677
560
  default:
678
561
  output += `\n* Its parent has ${childElementNodes.length} child element nodes: ${
679
- childElementNodes.map(node => `\`${node.simpleSelector()}\``).join(', ')}`;
562
+ childElementNodes.map(node => `\`${node.simpleSelector()}\` (uid=${node.backendNodeId()})`)
563
+ .join(', ')}`;
680
564
  break;
681
565
  }
682
566
 
@@ -702,58 +586,35 @@ const data = {
702
586
  return this.context?.getItem() ?? null;
703
587
  }
704
588
 
705
- async getComputedStyles(relations: Relation[], properties: string[], _options?: {
589
+ async getStyles(elements: string[], properties: string[], _options?: {
706
590
  signal?: AbortSignal,
707
591
  approved?: boolean,
708
592
  }): Promise<FunctionCallHandlerResult<unknown>> {
709
- const result: Record<string, Record<string, string|undefined>|undefined> = {};
710
- for (const relation of relations) {
711
- result[relation] = {};
712
- debugLog(`Action to execute: ${relation}`);
713
- let selectedNode = this.#getSelectedNode();
593
+ const result:
594
+ Record<string, {computed: Record<string, string|undefined>, authored: Record<string, string|undefined>}> = {};
595
+ for (const uid of elements) {
596
+ result[uid] = {computed: {}, authored: {}};
597
+ debugLog(`Action to execute: uid=${uid}`);
598
+ const selectedNode = this.#getSelectedNode();
714
599
  if (!selectedNode) {
715
600
  return {error: 'Error: Could not find the currently selected element.'};
716
601
  }
717
- if (relation === 'parentElement') {
718
- selectedNode = selectedNode.parentNode;
719
- }
720
- if (!selectedNode) {
721
- return {error: 'Error: Could not find the parent element.'};
602
+ const node = new SDK.DOMModel.DeferredDOMNode(
603
+ selectedNode.domModel().target(), Number(uid) as unknown as Protocol.DOM.BackendNodeId);
604
+ const resolved = await node.resolvePromise();
605
+ if (!resolved) {
606
+ return {error: 'Error: Could not find the element with uid=' + uid};
722
607
  }
723
- const styles = await selectedNode.domModel().cssModel().getComputedStyle(selectedNode.id);
608
+ const styles = await resolved.domModel().cssModel().getComputedStyle(resolved.id);
724
609
  if (!styles) {
725
610
  return {error: 'Error: Could not get computed styles.'};
726
611
  }
727
- for (const prop of properties) {
728
- result[relation][prop] = styles.get(prop);
729
- }
730
- }
731
- return {
732
- result: JSON.stringify(result, null, 2),
733
- };
734
- }
735
-
736
- async getAuthoredStyles(relations: Relation[], properties: string[], _options?: {
737
- signal?: AbortSignal,
738
- approved?: boolean,
739
- }): Promise<FunctionCallHandlerResult<unknown>> {
740
- const result: Record<string, Record<string, string|undefined>|undefined> = {};
741
- for (const relation of relations) {
742
- result[relation] = {};
743
- debugLog(`Action to execute: ${relation}`);
744
- let selectedNode = this.#getSelectedNode();
745
- if (!selectedNode) {
746
- return {error: 'Error: Could not find the currently selected element.'};
747
- }
748
- if (relation === 'parentElement') {
749
- selectedNode = selectedNode.parentNode;
750
- }
751
- if (!selectedNode) {
752
- return {error: 'Error: Could not find the parent element.'};
753
- }
754
- const matchedStyles = await selectedNode.domModel().cssModel().getMatchedStyles(selectedNode.id);
612
+ const matchedStyles = await resolved.domModel().cssModel().getMatchedStyles(resolved.id);
755
613
  if (!matchedStyles) {
756
- return {error: 'Error: Could not get computed styles.'};
614
+ return {error: 'Error: Could not get authored styles.'};
615
+ }
616
+ for (const prop of properties) {
617
+ result[uid].computed[prop] = styles.get(prop);
757
618
  }
758
619
  for (const style of matchedStyles.nodeStyles()) {
759
620
  for (const property of style.allProperties()) {
@@ -762,7 +623,7 @@ const data = {
762
623
  }
763
624
  const state = matchedStyles.propertyState(property);
764
625
  if (state === SDK.CSSMatchedStyles.PropertyState.ACTIVE) {
765
- result[relation][property.name] = property.value;
626
+ result[uid].authored[property.name] = property.value;
766
627
  }
767
628
  }
768
629
  }
@@ -731,6 +731,29 @@ Available insights:
731
731
  example question: Which third parties are having the largest impact on my page performance?
732
732
  === end content
733
733
 
734
+ Title: PerformanceTraceFormatter formatTraceSummary includes INP insight when there is no navigation
735
+ Content:
736
+ URL: https://b2607f8b04800100000289cb1c0a82ba72253000000000000000001.proxy.googlers.com/long-interaction/index.html?x=35
737
+ Bounds: {min: 337943614456, max: 337947260898}
738
+ CPU throttling: none
739
+ Network throttling: none
740
+ Metrics (lab / observed):
741
+ - INP: 139 ms, event: (eventKey: s-3347, ts: 337944870984)
742
+ - CLS: 0.00
743
+ Metrics (field / real users): n/a – no data for this page in CrUX
744
+ Available insights:
745
+ - insight name: INPBreakdown
746
+ description: Start investigating with the longest subpart. [Delays can be minimized](https://web.dev/articles/optimize-inp#optimize_interactions). To reduce processing duration, [optimize the main-thread costs](https://web.dev/articles/optimize-long-tasks), often JS.
747
+ relevant trace bounds: {min: 337944870984, max: 337945010222}
748
+ example question: Suggest fixes for my longest interaction
749
+ example question: Why is a large INP score problematic?
750
+ example question: What's the biggest contributor to my longest interaction?
751
+ - insight name: ThirdParties
752
+ description: 3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://web.dev/articles/optimizing-content-efficiency-loading-third-party-javascript/) to prioritize your page's content.
753
+ relevant trace bounds: {min: 337944792445, max: 337944809570}
754
+ example question: Which third parties are having the largest impact on my page performance?
755
+ === end content
756
+
734
757
  Title: PerformanceTraceFormatter formatNetworkRequests formats network requests that have redirects
735
758
  Content:
736
759
  ## Network request: http://localhost:3000/redirect3