chrome-devtools-frontend 1.0.1522585 → 1.0.1524741

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 (341) 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/ui_engineering.md +22 -0
  9. package/front_end/Tests.js +1 -1
  10. package/front_end/core/common/Color.ts +13 -9
  11. package/front_end/core/common/ColorConverter.ts +9 -7
  12. package/front_end/core/common/Gzip.ts +1 -1
  13. package/front_end/core/common/MapWithDefault.ts +5 -3
  14. package/front_end/core/common/ResourceType.ts +0 -12
  15. package/front_end/core/common/ReturnToPanel.ts +6 -4
  16. package/front_end/core/common/Trie.ts +4 -2
  17. package/front_end/core/host/AidaClient.ts +3 -3
  18. package/front_end/core/host/GdpClient.ts +7 -5
  19. package/front_end/core/host/InspectorFrontendHostAPI.ts +7 -5
  20. package/front_end/core/host/Platform.ts +5 -3
  21. package/front_end/core/host/UserMetrics.ts +6 -4
  22. package/front_end/core/platform/ArrayUtilities.ts +1 -1
  23. package/front_end/core/platform/StringUtilities.ts +34 -31
  24. package/front_end/core/root/Runtime.ts +1 -1
  25. package/front_end/core/sdk/CSSMetadata.ts +6 -4
  26. package/front_end/core/sdk/CSSPropertyParser.ts +17 -13
  27. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +19 -13
  28. package/front_end/core/sdk/ChildTargetManager.ts +35 -0
  29. package/front_end/core/sdk/DOMModel.ts +1 -1
  30. package/front_end/core/sdk/EventBreakpointsModel.ts +4 -2
  31. package/front_end/core/sdk/HttpReasonPhraseStrings.ts +4 -2
  32. package/front_end/core/sdk/NetworkManager.ts +8 -48
  33. package/front_end/core/sdk/NetworkRequest.ts +0 -28
  34. package/front_end/core/sdk/PageResourceLoader.ts +1 -1
  35. package/front_end/core/sdk/PreloadingModel.ts +22 -18
  36. package/front_end/core/sdk/RehydratingConnection.ts +1 -1
  37. package/front_end/core/sdk/RehydratingObject.ts +1 -1
  38. package/front_end/core/sdk/RemoteObject.ts +1 -1
  39. package/front_end/core/sdk/ResourceTreeModel.ts +2 -0
  40. package/front_end/core/sdk/ScreenCaptureModel.ts +24 -20
  41. package/front_end/core/sdk/Target.ts +7 -1
  42. package/front_end/core/sdk/TraceObject.ts +2 -2
  43. package/front_end/entrypoints/formatter_worker/Substitute.ts +6 -4
  44. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +24 -16
  45. package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +2 -1
  46. package/front_end/entrypoints/main/MainImpl.ts +6 -4
  47. package/front_end/generated/InspectorBackendCommands.js +2 -2
  48. package/front_end/generated/protocol-mapping.d.ts +3 -2
  49. package/front_end/generated/protocol-proxy-api.d.ts +3 -1
  50. package/front_end/generated/protocol.ts +7 -1
  51. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +55 -14
  52. package/front_end/models/ai_assistance/agents/StylingAgent.ts +83 -222
  53. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +23 -0
  54. package/front_end/models/ai_assistance/performance/AIContext.ts +19 -4
  55. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +4 -2
  56. package/front_end/models/autofill_manager/AutofillManager.ts +4 -2
  57. package/front_end/models/cpu_profile/CPUProfileDataModel.ts +1 -1
  58. package/front_end/models/crux-manager/CrUXManager.ts +1 -1
  59. package/front_end/models/extensions/HostUrlPattern.ts +13 -5
  60. package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +1 -1
  61. package/front_end/models/issues_manager/CookieIssue.ts +2 -2
  62. package/front_end/models/issues_manager/MarkdownIssueDescription.ts +1 -1
  63. package/front_end/models/issues_manager/SharedDictionaryIssue.ts +20 -0
  64. package/front_end/models/issues_manager/descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
  65. package/front_end/models/issues_manager/descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
  66. package/front_end/models/javascript_metadata/NativeFunctions.js +8 -0
  67. package/front_end/models/network_time_calculator/Calculator.ts +4 -2
  68. package/front_end/models/network_time_calculator/RequestTimeRanges.ts +6 -4
  69. package/front_end/models/source_map_scopes/NamesResolver.ts +7 -5
  70. package/front_end/models/text_utils/ContentProvider.ts +6 -4
  71. package/front_end/models/trace/extras/TraceTree.ts +1 -1
  72. package/front_end/models/trace/handlers/FramesHandler.ts +7 -5
  73. package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +13 -7
  74. package/front_end/models/trace/handlers/MetaHandler.ts +16 -14
  75. package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +20 -8
  76. package/front_end/models/trace/handlers/helpers.ts +1 -1
  77. package/front_end/models/trace/handlers/types.ts +23 -19
  78. package/front_end/models/trace/helpers/Timing.ts +4 -2
  79. package/front_end/models/trace/helpers/Trace.ts +8 -4
  80. package/front_end/models/trace/insights/DocumentLatency.ts +1 -1
  81. package/front_end/models/trace/insights/INPBreakdown.ts +13 -2
  82. package/front_end/models/trace/insights/LCPBreakdown.ts +14 -2
  83. package/front_end/models/trace/insights/NetworkDependencyTree.ts +2 -2
  84. package/front_end/models/trace/types/File.ts +12 -8
  85. package/front_end/models/trace/types/Timing.ts +1 -1
  86. package/front_end/models/trace/types/TraceEvents.ts +37 -23
  87. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +1 -1
  88. package/front_end/panels/ai_assistance/components/MarkdownRendererWithCodeBlock.ts +12 -10
  89. package/front_end/panels/application/KeyValueStorageItemsView.ts +31 -33
  90. package/front_end/panels/application/components/InterestGroupAccessGrid.ts +6 -11
  91. package/front_end/panels/application/components/OriginTrialTreeView.ts +7 -5
  92. package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -0
  93. package/front_end/panels/application/components/ReportsGrid.ts +4 -10
  94. package/front_end/panels/application/components/SharedStorageAccessGrid.ts +5 -13
  95. package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +1 -1
  96. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +3 -7
  97. package/front_end/panels/application/preloading/components/PreloadingString.ts +2 -2
  98. package/front_end/panels/application/preloading/components/RuleSetGrid.ts +3 -10
  99. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -2
  100. package/front_end/panels/browser_debugger/browser_debugger-meta.ts +7 -5
  101. package/front_end/panels/changes/ChangesSidebar.ts +97 -95
  102. package/front_end/panels/changes/changesSidebar.css +3 -0
  103. package/front_end/panels/console/ConsoleView.ts +2 -2
  104. package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +22 -35
  105. package/front_end/panels/elements/ComputedStyleWidget.ts +1 -1
  106. package/front_end/panels/elements/ElementStatePaneWidget.ts +12 -0
  107. package/front_end/panels/elements/ElementsTreeElement.ts +9 -5
  108. package/front_end/panels/elements/ElementsTreeOutline.ts +11 -8
  109. package/front_end/panels/elements/PropertyRenderer.ts +19 -15
  110. package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -4
  111. package/front_end/panels/elements/StylesSidebarPane.ts +2 -2
  112. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +4 -2
  113. package/front_end/panels/elements/components/AdornerManager.ts +5 -3
  114. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +6 -4
  115. package/front_end/panels/media/PlayerPropertiesView.ts +1 -1
  116. package/front_end/panels/network/NetworkDataGridNode.ts +2 -44
  117. package/front_end/panels/network/NetworkLogView.ts +6 -4
  118. package/front_end/panels/network/RequestPreviewView.ts +0 -7
  119. package/front_end/panels/network/components/RequestHeadersView.ts +0 -6
  120. package/front_end/panels/network/components/components.ts +0 -2
  121. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +1 -1
  122. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +4 -2
  123. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +12 -19
  124. package/front_end/panels/search/SearchResultsPane.ts +2 -3
  125. package/front_end/panels/security/IPProtectionView.ts +1 -1
  126. package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +4 -0
  127. package/front_end/panels/settings/emulation/utils/StructuredHeaders.ts +45 -37
  128. package/front_end/panels/sources/BreakpointsViewUtils.ts +11 -9
  129. package/front_end/panels/sources/DebuggerPlugin.ts +8 -4
  130. package/front_end/panels/sources/SourcesPanel.ts +1 -1
  131. package/front_end/panels/sources/UISourceCodeFrame.ts +1 -1
  132. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +4 -2
  133. package/front_end/panels/timeline/CountersGraph.ts +12 -5
  134. package/front_end/panels/timeline/EasterEgg.d.ts +5 -3
  135. package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +8 -6
  136. package/front_end/panels/timeline/ModificationsManager.ts +5 -3
  137. package/front_end/panels/timeline/ThreadAppender.ts +7 -5
  138. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +10 -8
  139. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -1
  140. package/front_end/panels/timeline/TimelinePanel.ts +10 -8
  141. package/front_end/panels/timeline/TimelineSelection.ts +4 -2
  142. package/front_end/panels/timeline/TimelineUIUtils.ts +5 -3
  143. package/front_end/panels/timeline/components/BreadcrumbsUI.ts +6 -4
  144. package/front_end/panels/timeline/components/Utils.ts +1 -1
  145. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +5 -3
  146. package/front_end/panels/timeline/utils/Helpers.ts +1 -1
  147. package/front_end/panels/utils/utils.ts +1 -7
  148. package/front_end/services/trace_bounds/TraceBounds.ts +4 -2
  149. package/front_end/services/tracing/PerformanceTracing.ts +1 -1
  150. package/front_end/third_party/chromium/README.chromium +1 -1
  151. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  152. package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
  153. package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
  154. package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
  155. package/front_end/third_party/codemirror.next/package.json +3 -2
  156. package/front_end/third_party/puppeteer/README.chromium +2 -2
  157. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.d.ts +8 -10
  158. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.d.ts.map +1 -1
  159. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.js +8 -10
  160. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.js.map +1 -1
  161. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts +28 -30
  162. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
  163. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js +27 -29
  164. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
  165. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +34 -38
  166. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
  167. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js +34 -38
  168. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
  169. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.d.ts +8 -1
  170. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.d.ts.map +1 -1
  171. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.js +12 -14
  172. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.js.map +1 -1
  173. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +92 -108
  174. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +33 -39
  176. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +5 -3
  179. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
  180. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
  181. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +1 -1
  182. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
  183. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts +4 -2
  184. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +14 -5
  186. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
  187. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +1 -0
  188. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  189. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +12 -6
  190. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.d.ts.map +1 -1
  192. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js +24 -2
  193. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js.map +1 -1
  194. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
  195. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts +1 -0
  196. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  197. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js +3 -0
  198. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
  199. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.d.ts +13 -22
  200. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.d.ts.map +1 -1
  201. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.js +13 -22
  202. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.js.map +1 -1
  203. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.d.ts +6 -8
  204. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.d.ts.map +1 -1
  205. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.js +6 -8
  206. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.js.map +1 -1
  207. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
  208. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
  209. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  210. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts +1 -1
  211. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  212. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +6 -3
  213. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
  214. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts +5 -7
  215. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
  216. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js +5 -7
  217. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js.map +1 -1
  218. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  219. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  220. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  221. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  222. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +188 -224
  223. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +140 -166
  224. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.d.ts +8 -10
  225. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.d.ts.map +1 -1
  226. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.js +8 -10
  227. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.js.map +1 -1
  228. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts +28 -30
  229. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
  230. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js +27 -29
  231. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
  232. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +34 -38
  233. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
  234. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js +34 -38
  235. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
  236. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.d.ts +8 -1
  237. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.d.ts.map +1 -1
  238. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.js +12 -14
  239. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.js.map +1 -1
  240. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +92 -108
  241. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  242. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +33 -39
  243. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  244. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
  245. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +5 -3
  246. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
  247. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
  248. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +1 -1
  249. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
  250. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts +4 -2
  251. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  252. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +15 -6
  253. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
  254. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +1 -0
  255. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  256. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +12 -6
  257. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  258. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.d.ts.map +1 -1
  259. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js +24 -2
  260. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js.map +1 -1
  261. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts +1 -0
  262. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  263. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js +3 -0
  264. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
  265. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.d.ts +13 -22
  266. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.d.ts.map +1 -1
  267. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.js +13 -22
  268. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.js.map +1 -1
  269. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.d.ts +6 -8
  270. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.d.ts.map +1 -1
  271. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.js +6 -8
  272. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.js.map +1 -1
  273. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
  274. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
  275. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +1 -1
  276. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  277. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +6 -3
  278. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
  279. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts +5 -7
  280. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
  281. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js +5 -7
  282. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js.map +1 -1
  283. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  284. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  285. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  286. package/front_end/third_party/puppeteer/package/lib/types.d.ts +188 -224
  287. package/front_end/third_party/puppeteer/package/package.json +3 -3
  288. package/front_end/third_party/puppeteer/package/src/api/Dialog.ts +8 -10
  289. package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +27 -29
  290. package/front_end/third_party/puppeteer/package/src/api/Frame.ts +34 -38
  291. package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +17 -14
  292. package/front_end/third_party/puppeteer/package/src/api/Page.ts +92 -108
  293. package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +5 -3
  294. package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +5 -1
  295. package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +28 -3
  296. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +16 -7
  297. package/front_end/third_party/puppeteer/package/src/bidi/core/Browser.ts +28 -2
  298. package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +4 -0
  299. package/front_end/third_party/puppeteer/package/src/cdp/PredefinedNetworkConditions.ts +13 -22
  300. package/front_end/third_party/puppeteer/package/src/common/Device.ts +6 -8
  301. package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
  302. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +6 -3
  303. package/front_end/third_party/puppeteer/package/src/node/PuppeteerNode.ts +5 -7
  304. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  305. package/front_end/ui/components/chrome_link/ChromeLink.ts +4 -2
  306. package/front_end/ui/components/dialogs/Dialog.ts +13 -9
  307. package/front_end/ui/components/highlighting/HighlightElement.ts +77 -0
  308. package/front_end/ui/components/highlighting/HighlightManager.ts +37 -0
  309. package/front_end/ui/components/highlighting/highlighting.ts +2 -0
  310. package/front_end/ui/components/markdown_view/MarkdownImagesMap.ts +5 -3
  311. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -3
  312. package/front_end/ui/components/menus/SelectMenu.ts +6 -4
  313. package/front_end/ui/components/survey_link/SurveyLink.ts +4 -2
  314. package/front_end/ui/components/text_editor/config.ts +10 -6
  315. package/front_end/ui/components/text_editor/javascript.ts +8 -4
  316. package/front_end/ui/legacy/ForwardedInputEventHandler.ts +4 -2
  317. package/front_end/ui/legacy/GlassPane.ts +1 -1
  318. package/front_end/ui/legacy/SettingsUI.ts +1 -5
  319. package/front_end/ui/legacy/Treeoutline.ts +12 -33
  320. package/front_end/ui/legacy/UIUtils.ts +19 -1
  321. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +12 -10
  322. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +30 -32
  323. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
  324. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +25 -25
  325. package/front_end/ui/legacy/components/data_grid/dataGrid.css +5 -0
  326. package/front_end/ui/legacy/components/inline_editor/AnimationTimingModel.ts +4 -2
  327. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +4 -2
  328. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +8 -6
  329. package/front_end/ui/legacy/components/perf_ui/PieChart.ts +6 -4
  330. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -3
  331. package/front_end/ui/legacy/components/source_frame/XMLView.ts +22 -16
  332. package/front_end/ui/legacy/components/source_frame/xmlView.css +0 -2
  333. package/front_end/ui/legacy/components/utils/Linkifier.ts +6 -4
  334. package/front_end/ui/visual_logging/Debugging.ts +10 -6
  335. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -3
  336. package/inspector_overlay/common.ts +5 -3
  337. package/inspector_overlay/highlight_grid_common.ts +1 -1
  338. package/package.json +1 -1
  339. package/front_end/Images/src/bundle.svg +0 -3
  340. package/front_end/panels/network/components/WebBundleInfoView.css +0 -27
  341. package/front_end/panels/network/components/WebBundleInfoView.ts +0 -95
@@ -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
@@ -16,11 +16,26 @@ interface AgentFocusData {
16
16
  insight: Trace.Insights.Types.InsightModel|null;
17
17
  }
18
18
 
19
+ /**
20
+ * Gets the first, most relevant InsightSet to use, following the logic of:
21
+ * 1. If there is only one InsightSet, use that.
22
+ * 2. If there are more, prefer the first we find that has a navigation associated with it.
23
+ * 3. If none with a navigation are found, fallback to the first one.
24
+ * 4. Otherwise, return null.
25
+ *
26
+ * TODO(cjamcl): we should just give the agent the entire insight set, and give
27
+ * summary detail about all of them + the ability to query each.
28
+ */
19
29
  function getFirstInsightSet(insights: Trace.Insights.Types.TraceInsightSets): Trace.Insights.Types.InsightSet|null {
20
- // Currently only support a single insight set. Pick the first one with a navigation.
21
- // TODO(cjamcl): we should just give the agent the entire insight set, and give
22
- // summary detail about all of them + the ability to query each.
23
- return [...insights.values()].filter(insightSet => insightSet.navigation).at(0) ?? null;
30
+ const insightSets = Array.from(insights.values());
31
+ if (insightSets.length === 0) {
32
+ return null;
33
+ }
34
+ if (insightSets.length === 1) {
35
+ return insightSets[0];
36
+ }
37
+
38
+ return insightSets.filter(set => set.navigation).at(0) ?? insightSets.at(0) ?? null;
24
39
  }
25
40
 
26
41
  export class AgentFocus {
@@ -12,8 +12,10 @@ import {debugLog} from './debug.js';
12
12
  export const DELAY_BEFORE_SHOWING_RESPONSE_MS = 500;
13
13
  export const AIDA_REQUEST_DEBOUNCE_TIMEOUT_MS = 200;
14
14
 
15
- // TODO(b/404796739): Remove these definitions of AgentOptions and RequestOptions and
16
- // use the existing ones which are used for AI assistance panel agents.
15
+ /**
16
+ * TODO(b/404796739): Remove these definitions of AgentOptions and RequestOptions and
17
+ * use the existing ones which are used for AI assistance panel agents.
18
+ **/
17
19
  interface AgentOptions {
18
20
  aidaClient: Host.AidaClient.AidaClient;
19
21
  serverSideLoggingEnabled?: boolean;
@@ -102,8 +102,10 @@ export class AutofillManager extends Common.ObjectWrapper.ObjectWrapper<EventTyp
102
102
  }
103
103
  }
104
104
 
105
- // A Match describes how the value of a filled field corresponds to a substring
106
- // of address from startIndex to endIndex.
105
+ /**
106
+ * A Match describes how the value of a filled field corresponds to a substring
107
+ * of address from startIndex to endIndex.
108
+ **/
107
109
  export interface Match {
108
110
  startIndex: number;
109
111
  endIndex: number;
@@ -552,7 +552,7 @@ export class CPUProfileDataModel extends ProfileTreeModel {
552
552
  }
553
553
  }
554
554
 
555
- // Format used by profiles coming from traces.
555
+ /** Format used by profiles coming from traces. **/
556
556
  export type ExtendedProfileNode = Protocol.Profiler.ProfileNode&{parent?: number};
557
557
  export type ExtendedProfile = Protocol.Profiler.Profile&{
558
558
  nodes: Protocol.Profiler.ProfileNode[] | ExtendedProfileNode[],
@@ -103,7 +103,7 @@ export interface ConfigSetting {
103
103
 
104
104
  let cruxManagerInstance: CrUXManager;
105
105
 
106
- // TODO: Potentially support `TABLET`. Tablet field data will always be `null` until then.
106
+ /** TODO: Potentially support `TABLET`. Tablet field data will always be `null` until then. **/
107
107
  export const DEVICE_SCOPE_LIST: DeviceScope[] = ['ALL', 'DESKTOP', 'PHONE'];
108
108
 
109
109
  const pageScopeList: PageScope[] = ['origin', 'url'];
@@ -82,7 +82,7 @@ function parseHostAndPort(pattern: string, scheme: string): {host: string, port:
82
82
  return undefined;
83
83
  }
84
84
 
85
- // The URL constructor strips off the default port for the scheme, even if it was given explicitely
85
+ // The URL constructor strips off the default port for the scheme, even if it was given explicitly
86
86
  const httpPort = defaultPort('http');
87
87
  if (!httpPort) {
88
88
  return undefined;
@@ -100,8 +100,15 @@ function parseHostAndPort(pattern: string, scheme: string): {host: string, port:
100
100
  };
101
101
  }
102
102
 
103
- // HostUrlPatterns define permissions in for extensions in the form of `*://*.example.com:*/`. Since these aren't valid
104
- // URLs Common.ParsedURL can't handle them and we need a separate implementation.
103
+ /**
104
+ * HostUrlPatterns define permissions in for extensions in the form of "<protocol>://<sub-domain>.example.com:<port>/".
105
+ * Where the respected parts can be patters like "*".
106
+ * Since these aren't valid {@link Common.ParsedURL.ParsedURL}
107
+ * can't handle them and we need a separate implementation.
108
+ *
109
+ * More information in the Chromium code base -
110
+ * {@link https://crsrc.org/c/chrome/browser/extensions/extension_management_internal.h;l=137 | here}.
111
+ */
105
112
  export class HostUrlPattern {
106
113
  static parse(pattern: string): HostUrlPattern|undefined {
107
114
  if (pattern === '<all_urls>') {
@@ -122,8 +129,9 @@ export class HostUrlPattern {
122
129
  return new HostUrlPattern({scheme, host, port, matchesAll: false});
123
130
  }
124
131
 
125
- private constructor(readonly pattern: {matchesAll: true}|
126
- {readonly scheme: string, readonly host: string, readonly port: string, matchesAll: false}) {
132
+ private constructor(readonly pattern: {
133
+ matchesAll: true,
134
+ }|{readonly scheme: string, readonly host: string, readonly port: string, matchesAll: false}) {
127
135
  }
128
136
 
129
137
  get scheme(): string {
@@ -18,7 +18,7 @@ const UIStrings = {
18
18
  const str_ = i18n.i18n.registerUIStrings('models/issues_manager/CookieDeprecationMetadataIssue.ts', UIStrings);
19
19
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
20
20
 
21
- // TODO(b/305738703): Move this issue into a warning on CookieIssue.
21
+ /** TODO(b/305738703): Move this issue into a warning on CookieIssue. **/
22
22
  export class CookieDeprecationMetadataIssue extends Issue {
23
23
  readonly #issueDetails: Protocol.Audits.CookieDeprecationMetadataIssueDetails;
24
24
 
@@ -44,14 +44,14 @@ const UIStrings = {
44
44
  const str_ = i18n.i18n.registerUIStrings('models/issues_manager/CookieIssue.ts', UIStrings);
45
45
  const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
46
46
 
47
- // The enum string values need to match the IssueExpanded enum values in UserMetrics.ts.
47
+ /** The enum string values need to match the IssueExpanded enum values in UserMetrics.ts. **/
48
48
  export const enum CookieIssueSubCategory {
49
49
  GENERIC_COOKIE = 'GenericCookie',
50
50
  SAME_SITE_COOKIE = 'SameSiteCookie',
51
51
  THIRD_PARTY_PHASEOUT_COOKIE = 'ThirdPartyPhaseoutCookie',
52
52
  }
53
53
 
54
- // Enum to show cookie status from the security panel's third-party cookie report tool
54
+ /** Enum to show cookie status from the security panel's third-party cookie report tool **/
55
55
  export const enum CookieStatus {
56
56
  BLOCKED = 0,
57
57
  ALLOWED = 1,
@@ -129,7 +129,7 @@ export function substitutePlaceholders(markdown: string, substitutions?: Map<str
129
129
  return result;
130
130
  }
131
131
 
132
- // Ensure that all provided placeholders match the naming pattern.
132
+ /** Ensure that all provided placeholders match the naming pattern. **/
133
133
  function validatePlaceholders(placeholders: Set<string>): void {
134
134
  const invalidPlaceholders = [...placeholders].filter(placeholder => !validPlaceholderNamePattern.test(placeholder));
135
135
  if (invalidPlaceholders.length > 0) {
@@ -34,8 +34,10 @@ export const enum IssueCode {
34
34
  WRITE_ERROR_INSUFFICIENT_RESOURCES = 'SharedDictionaryIssue::WriteErrorInsufficientResources',
35
35
  WRITE_ERROR_INVALID_MATCH_FIELD = 'SharedDictionaryIssue::WriteErrorInvalidMatchField',
36
36
  WRITE_ERROR_INVALID_STRUCTURED_HEADER = 'SharedDictionaryIssue::WriteErrorInvalidStructuredHeader',
37
+ WRITE_ERROR_INVALID_TTL_FIELD = 'SharedDictionaryIssue::WriteErrorInvalidTTLField',
37
38
  WRITE_ERROR_NAVIGATION_REQUEST = 'SharedDictionaryIssue::WriteErrorNavigationRequest',
38
39
  WRITE_ERROR_NO_MATCH_FIELD = 'SharedDictionaryIssue::WriteErrorNoMatchField',
40
+ WRITE_ERROR_NON_INTEGER_TTL_FIELD = 'SharedDictionaryIssue::WriteErrorNonIntegerTTLField',
39
41
  WRITE_ERROR_NON_LIST_MATCH_DEST_FIELD = 'SharedDictionaryIssue::WriteErrorNonListMatchDestField',
40
42
  WRITE_ERROR_NON_SECURE_CONTEXT = 'SharedDictionaryIssue::WriteErrorNonSecureContext',
41
43
  WRITE_ERROR_NON_STRING_ID_FIELD = 'SharedDictionaryIssue::WriteErrorNonStringIdField',
@@ -73,10 +75,14 @@ function getIssueCode(details: Protocol.Audits.SharedDictionaryIssueDetails): Is
73
75
  return IssueCode.WRITE_ERROR_INVALID_MATCH_FIELD;
74
76
  case Protocol.Audits.SharedDictionaryError.WriteErrorInvalidStructuredHeader:
75
77
  return IssueCode.WRITE_ERROR_INVALID_STRUCTURED_HEADER;
78
+ case Protocol.Audits.SharedDictionaryError.WriteErrorInvalidTTLField:
79
+ return IssueCode.WRITE_ERROR_INVALID_TTL_FIELD;
76
80
  case Protocol.Audits.SharedDictionaryError.WriteErrorNavigationRequest:
77
81
  return IssueCode.WRITE_ERROR_NAVIGATION_REQUEST;
78
82
  case Protocol.Audits.SharedDictionaryError.WriteErrorNoMatchField:
79
83
  return IssueCode.WRITE_ERROR_NO_MATCH_FIELD;
84
+ case Protocol.Audits.SharedDictionaryError.WriteErrorNonIntegerTTLField:
85
+ return IssueCode.WRITE_ERROR_NON_INTEGER_TTL_FIELD;
80
86
  case Protocol.Audits.SharedDictionaryError.WriteErrorNonListMatchDestField:
81
87
  return IssueCode.WRITE_ERROR_NON_LIST_MATCH_DEST_FIELD;
82
88
  case Protocol.Audits.SharedDictionaryError.WriteErrorNonSecureContext:
@@ -243,6 +249,13 @@ const issueDescriptions = new Map<Protocol.Audits.SharedDictionaryError, LazyMar
243
249
  links: specLinks,
244
250
  },
245
251
  ],
252
+ [
253
+ Protocol.Audits.SharedDictionaryError.WriteErrorInvalidTTLField,
254
+ {
255
+ file: 'sharedDictionaryWriteErrorInvalidTTLField.md',
256
+ links: specLinks,
257
+ },
258
+ ],
246
259
  [
247
260
  Protocol.Audits.SharedDictionaryError.WriteErrorNavigationRequest,
248
261
  {
@@ -257,6 +270,13 @@ const issueDescriptions = new Map<Protocol.Audits.SharedDictionaryError, LazyMar
257
270
  links: specLinks,
258
271
  },
259
272
  ],
273
+ [
274
+ Protocol.Audits.SharedDictionaryError.WriteErrorNonIntegerTTLField,
275
+ {
276
+ file: 'sharedDictionaryWriteErrorNonIntegerTTLField.md',
277
+ links: specLinks,
278
+ },
279
+ ],
260
280
  [
261
281
  Protocol.Audits.SharedDictionaryError.WriteErrorNonListMatchDestField,
262
282
  {
@@ -0,0 +1 @@
1
+ # The `ttl` field of the `Use-As-Dictionary` HTTP response header must be a positive integer