chrome-devtools-frontend 1.0.1550444 → 1.0.1555174

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 (466) hide show
  1. package/docs/styleguide/ux/components.md +34 -8
  2. package/eslint.config.mjs +7 -0
  3. package/front_end/Images/generate-css-vars.js +8 -4
  4. package/front_end/Images/src/spark.svg +10 -0
  5. package/front_end/core/common/Settings.ts +20 -8
  6. package/front_end/core/host/UserMetrics.ts +3 -1
  7. package/front_end/core/i18n/collect-ui-strings.js +19 -10
  8. package/front_end/core/i18n/generate-locales-js.js +4 -4
  9. package/front_end/core/protocol_client/CDPConnection.ts +1 -0
  10. package/front_end/core/protocol_client/InspectorBackend.ts +5 -1
  11. package/front_end/core/root/Runtime.ts +0 -12
  12. package/front_end/core/sdk/DOMModel.ts +38 -3
  13. package/front_end/core/sdk/DebuggerModel.ts +9 -4
  14. package/front_end/core/sdk/IsolateManager.ts +7 -0
  15. package/front_end/core/sdk/PageResourceLoader.ts +3 -3
  16. package/front_end/core/sdk/RehydratingConnection.ts +5 -2
  17. package/front_end/core/sdk/ResourceTreeModel.ts +0 -1
  18. package/front_end/entrypoints/main/MainImpl.ts +28 -10
  19. package/front_end/generated/SupportedCSSProperties.js +32 -0
  20. package/front_end/models/ai_assistance/AiConversation.ts +94 -4
  21. package/front_end/models/ai_assistance/agents/AiAgent.ts +30 -15
  22. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +179 -41
  23. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +5 -0
  24. package/front_end/models/ai_assistance/agents/StylingAgent.ts +62 -0
  25. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +2 -1
  26. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +1 -7
  27. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +124 -12
  28. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +125 -30
  29. package/front_end/models/ai_assistance/performance/AICallTree.ts +42 -0
  30. package/front_end/models/ai_code_generation/AiCodeGeneration.ts +12 -0
  31. package/front_end/models/issues_manager/Issue.ts +1 -0
  32. package/front_end/models/issues_manager/IssueAggregator.ts +9 -0
  33. package/front_end/models/issues_manager/IssuesManager.ts +5 -0
  34. package/front_end/models/issues_manager/PermissionElementIssue.ts +262 -0
  35. package/front_end/models/issues_manager/descriptions/permissionElementActivationDisabled.md +7 -0
  36. package/front_end/models/issues_manager/descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
  37. package/front_end/models/issues_manager/descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
  38. package/front_end/models/issues_manager/descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
  39. package/front_end/models/issues_manager/descriptions/permissionElementFencedFrameDisallowed.md +5 -0
  40. package/front_end/models/issues_manager/descriptions/permissionElementFontSizeTooLarge.md +5 -0
  41. package/front_end/models/issues_manager/descriptions/permissionElementFontSizeTooSmall.md +5 -0
  42. package/front_end/models/issues_manager/descriptions/permissionElementGeolocationDeprecated.md +5 -0
  43. package/front_end/models/issues_manager/descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
  44. package/front_end/models/issues_manager/descriptions/permissionElementInvalidDisplayStyle.md +5 -0
  45. package/front_end/models/issues_manager/descriptions/permissionElementInvalidSizeValue.md +5 -0
  46. package/front_end/models/issues_manager/descriptions/permissionElementInvalidType.md +5 -0
  47. package/front_end/models/issues_manager/descriptions/permissionElementInvalidTypeActivation.md +5 -0
  48. package/front_end/models/issues_manager/descriptions/permissionElementLowContrast.md +5 -0
  49. package/front_end/models/issues_manager/descriptions/permissionElementNonOpaqueColor.md +5 -0
  50. package/front_end/models/issues_manager/descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
  51. package/front_end/models/issues_manager/descriptions/permissionElementPaddingRightUnsupported.md +6 -0
  52. package/front_end/models/issues_manager/descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
  53. package/front_end/models/issues_manager/descriptions/permissionElementRegistrationFailed.md +5 -0
  54. package/front_end/models/issues_manager/descriptions/permissionElementRequestInProgress.md +5 -0
  55. package/front_end/models/issues_manager/descriptions/permissionElementSecurityChecksFailed.md +5 -0
  56. package/front_end/models/issues_manager/descriptions/permissionElementTypeNotSupported.md +5 -0
  57. package/front_end/models/issues_manager/descriptions/permissionElementUntrustedEvent.md +7 -0
  58. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  59. package/front_end/models/javascript_metadata/NativeFunctions.js +23 -23
  60. package/front_end/models/stack_trace/StackTraceModel.ts +37 -18
  61. package/front_end/models/trace/Processor.ts +14 -15
  62. package/front_end/models/trace/insights/Common.ts +2 -8
  63. package/front_end/models/trace/insights/types.ts +12 -2
  64. package/front_end/models/trace/types/TraceEvents.ts +4 -1
  65. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +28 -6
  66. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +9 -23
  67. package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
  68. package/front_end/panels/ai_assistance/components/ChatView.ts +78 -2
  69. package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +71 -0
  70. package/front_end/panels/ai_assistance/components/PerformanceAgentFlameChart.ts +126 -0
  71. package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +131 -2
  72. package/front_end/panels/ai_assistance/components/chatView.css +28 -0
  73. package/front_end/panels/ai_assistance/components/collapsibleAssistanceContentWidget.css +33 -0
  74. package/front_end/panels/application/AppManifestView.ts +1007 -521
  75. package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -17
  76. package/front_end/panels/application/BounceTrackingMitigationsTreeElement.ts +2 -6
  77. package/front_end/panels/application/ExtensionStorageItemsView.ts +3 -5
  78. package/front_end/panels/application/KeyValueStorageItemsView.ts +3 -2
  79. package/front_end/panels/application/components/BackForwardCacheView.ts +2 -2
  80. package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +133 -118
  81. package/front_end/panels/application/preloading/PreloadingView.ts +46 -45
  82. package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +80 -75
  83. package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +169 -133
  84. package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +74 -93
  85. package/front_end/panels/application/preloading/components/RuleSetGrid.ts +142 -117
  86. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +51 -11
  87. package/front_end/panels/application/preloading/components/components.ts +0 -2
  88. package/front_end/panels/common/Annotation.ts +184 -0
  89. package/front_end/panels/common/AnnotationManager.ts +148 -11
  90. package/front_end/panels/common/ExtensionView.ts +47 -0
  91. package/front_end/panels/common/PersistenceUtils.ts +22 -25
  92. package/front_end/panels/common/annotation.css +40 -0
  93. package/front_end/panels/common/common.ts +1 -0
  94. package/front_end/panels/console/ConsoleInsightTeaser.ts +187 -5
  95. package/front_end/panels/console/ConsolePinPane.ts +437 -217
  96. package/front_end/panels/console/ConsolePrompt.ts +32 -223
  97. package/front_end/panels/console/ConsoleView.ts +67 -66
  98. package/front_end/panels/console/ConsoleViewMessage.ts +8 -3
  99. package/front_end/panels/console/consoleInsightTeaser.css +23 -0
  100. package/front_end/panels/console/consoleView.css +1 -1
  101. package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +89 -0
  102. package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +2 -2
  103. package/front_end/panels/elements/ComputedStyleWidget.ts +16 -5
  104. package/front_end/panels/elements/ElementsPanel.ts +38 -12
  105. package/front_end/panels/elements/ElementsSidebarPane.ts +1 -3
  106. package/front_end/panels/elements/ElementsTreeElement.ts +313 -353
  107. package/front_end/panels/elements/ElementsTreeOutline.ts +39 -13
  108. package/front_end/panels/elements/StylePropertyTreeElement.ts +15 -14
  109. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  110. package/front_end/panels/emulation/MediaQueryInspector.ts +171 -125
  111. package/front_end/panels/explain/components/ConsoleInsight.ts +175 -150
  112. package/front_end/panels/explain/components/consoleInsight.css +348 -347
  113. package/front_end/panels/issues/AffectedPermissionElementsView.ts +46 -0
  114. package/front_end/panels/issues/IssueView.ts +2 -0
  115. package/front_end/panels/issues/IssuesPane.ts +6 -0
  116. package/front_end/panels/layer_viewer/LayerDetailsView.ts +165 -149
  117. package/front_end/panels/layer_viewer/Layers3DView.ts +131 -78
  118. package/front_end/panels/lighthouse/LighthouseStatusView.ts +149 -100
  119. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +90 -64
  120. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +25 -34
  121. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +60 -44
  122. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +170 -151
  123. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +50 -51
  124. package/front_end/panels/linear_memory_inspector/components/valueInterpreterDisplay.css +0 -13
  125. package/front_end/panels/linear_memory_inspector/components/valueInterpreterSettings.css +20 -18
  126. package/front_end/panels/mobile_throttling/CalibrationController.ts +3 -1
  127. package/front_end/panels/network/NetworkDataGridNode.ts +14 -6
  128. package/front_end/panels/network/NetworkItemView.ts +42 -3
  129. package/front_end/panels/network/NetworkLogView.ts +10 -11
  130. package/front_end/panels/network/NetworkPanel.ts +63 -1
  131. package/front_end/panels/network/RequestInitiatorView.ts +146 -113
  132. package/front_end/panels/network/components/RequestHeaderSection.css +51 -50
  133. package/front_end/panels/network/components/RequestHeaderSection.ts +81 -71
  134. package/front_end/panels/network/components/RequestHeadersView.css +1 -1
  135. package/front_end/panels/network/components/RequestHeadersView.ts +26 -11
  136. package/front_end/panels/network/components/RequestTrustTokensView.css +24 -14
  137. package/front_end/panels/network/components/RequestTrustTokensView.ts +144 -140
  138. package/front_end/panels/profiler/IsolateSelector.ts +2 -1
  139. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +49 -33
  140. package/front_end/panels/recorder/RecorderController.ts +2 -3
  141. package/front_end/panels/recorder/components/ControlButton.ts +68 -34
  142. package/front_end/panels/recorder/components/CreateRecordingView.ts +9 -6
  143. package/front_end/panels/recorder/components/RecordingView.ts +81 -88
  144. package/front_end/panels/recorder/components/ReplaySection.ts +226 -145
  145. package/front_end/panels/recorder/{controllers → components}/SelectorPicker.ts +129 -52
  146. package/front_end/panels/recorder/components/StepEditor.ts +21 -67
  147. package/front_end/panels/recorder/components/StepView.ts +222 -180
  148. package/front_end/panels/recorder/components/TimelineSection.ts +69 -48
  149. package/front_end/panels/recorder/components/components.ts +2 -2
  150. package/front_end/panels/recorder/components/selectorPicker.css +14 -0
  151. package/front_end/panels/recorder/components/stepEditor.css +0 -5
  152. package/front_end/panels/recorder/components/stepView.css +196 -198
  153. package/front_end/panels/recorder/extensions/ExtensionManager.ts +4 -48
  154. package/front_end/panels/recorder/models/ScreenshotUtils.ts +17 -11
  155. package/front_end/panels/security/CookieControlsView.ts +30 -26
  156. package/front_end/panels/settings/components/SyncSection.ts +0 -1
  157. package/front_end/panels/sources/CSSPlugin.ts +3 -3
  158. package/front_end/panels/sources/CallStackSidebarPane.ts +60 -75
  159. package/front_end/panels/sources/SourcesPanel.ts +1 -11
  160. package/front_end/panels/sources/TabbedEditorContainer.ts +11 -8
  161. package/front_end/panels/sources/ThreadsSidebarPane.ts +96 -101
  162. package/front_end/panels/sources/threadsSidebarPane.css +6 -5
  163. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +0 -1
  164. package/front_end/panels/timeline/InteractionsTrackAppender.ts +2 -3
  165. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +23 -33
  166. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +4 -3
  167. package/front_end/panels/timeline/TimelineFlameChartView.ts +12 -0
  168. package/front_end/panels/timeline/TimelinePanel.ts +3 -5
  169. package/front_end/panels/timeline/components/IgnoreListSetting.ts +164 -142
  170. package/front_end/panels/timeline/components/InteractionBreakdown.ts +48 -28
  171. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +18 -23
  172. package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +98 -73
  173. package/front_end/panels/timeline/components/Sidebar.ts +16 -7
  174. package/front_end/panels/timeline/components/SidebarInsightsTab.ts +174 -137
  175. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +262 -291
  176. package/front_end/panels/timeline/components/Utils.ts +25 -0
  177. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +210 -146
  178. package/front_end/panels/timeline/components/insights/CLSCulprits.ts +8 -20
  179. package/front_end/panels/timeline/components/insights/Cache.ts +0 -9
  180. package/front_end/panels/timeline/components/insights/Checklist.ts +53 -43
  181. package/front_end/panels/timeline/components/insights/DOMSize.ts +11 -33
  182. package/front_end/panels/timeline/components/insights/DocumentLatency.ts +6 -12
  183. package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +0 -9
  184. package/front_end/panels/timeline/components/insights/EventRef.ts +47 -109
  185. package/front_end/panels/timeline/components/insights/FontDisplay.ts +0 -9
  186. package/front_end/panels/timeline/components/insights/ForcedReflow.ts +0 -9
  187. package/front_end/panels/timeline/components/insights/INPBreakdown.ts +0 -9
  188. package/front_end/panels/timeline/components/insights/ImageDelivery.ts +1 -10
  189. package/front_end/panels/timeline/components/insights/ImageRef.ts +112 -0
  190. package/front_end/panels/timeline/components/insights/InsightRenderer.ts +91 -0
  191. package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +0 -9
  192. package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +11 -14
  193. package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +0 -9
  194. package/front_end/panels/timeline/components/insights/ModernHTTP.ts +0 -9
  195. package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +6 -21
  196. package/front_end/panels/timeline/components/insights/NodeLink.ts +68 -43
  197. package/front_end/panels/timeline/components/insights/README.md +2 -3
  198. package/front_end/panels/timeline/components/insights/RenderBlocking.ts +0 -9
  199. package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +0 -9
  200. package/front_end/panels/timeline/components/insights/ThirdParties.ts +0 -9
  201. package/front_end/panels/timeline/components/insights/Viewport.ts +7 -19
  202. package/front_end/panels/timeline/components/insights/baseInsightComponent.css +5 -0
  203. package/front_end/panels/timeline/components/insights/insights.ts +2 -0
  204. package/front_end/panels/timeline/components/interactionBreakdown.css +15 -13
  205. package/front_end/panels/timeline/components/sidebarInsightsTab.css +50 -48
  206. package/front_end/panels/timeline/enable-easter-egg.js +7 -3
  207. package/front_end/third_party/chromium/README.chromium +1 -1
  208. package/front_end/third_party/puppeteer/README.chromium +2 -2
  209. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.d.ts +96 -0
  210. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
  211. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.js +8 -0
  212. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.js.map +1 -0
  213. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +87 -0
  214. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
  215. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
  216. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts +2 -6
  217. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -1
  218. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js +5 -24
  219. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js.map +1 -1
  220. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +5 -0
  221. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  222. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  223. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts +1 -0
  224. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
  225. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js.map +1 -1
  226. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
  227. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
  228. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js +42 -0
  229. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
  230. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +4 -1
  231. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
  232. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +10 -0
  233. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
  234. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
  235. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
  236. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js +90 -0
  237. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
  238. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts +3 -1
  239. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
  240. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +3 -2
  241. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
  242. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +4 -1
  243. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  244. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +5 -2
  245. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  246. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +4 -0
  247. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  248. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +14 -2
  249. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  250. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.d.ts.map +1 -1
  251. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.js +7 -0
  252. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.js.map +1 -1
  253. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +1 -1
  254. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
  255. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.d.ts +18 -0
  256. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
  257. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js +30 -0
  258. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
  259. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +5 -2
  260. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
  261. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +22 -3
  262. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
  263. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.d.ts +1 -1
  264. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.d.ts.map +1 -1
  265. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts +2 -3
  266. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
  267. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js +4 -6
  268. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
  269. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.d.ts +2 -2
  270. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.d.ts.map +1 -1
  271. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js +1 -1
  272. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js.map +1 -1
  273. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +2 -0
  274. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  275. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +8 -0
  276. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  277. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.d.ts.map +1 -1
  278. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js +8 -3
  279. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js.map +1 -1
  280. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.d.ts +1 -0
  281. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.d.ts.map +1 -1
  282. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.js +1 -0
  283. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.js.map +1 -1
  284. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +30 -0
  285. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
  286. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +15 -0
  287. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  288. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  289. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts +1 -1
  290. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  291. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -13
  292. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
  293. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +5 -3
  294. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  295. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.js +17 -0
  296. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.js.map +1 -1
  297. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  298. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  299. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  300. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  301. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  302. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  303. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +221 -4
  304. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +182 -95
  305. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts +96 -0
  306. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
  307. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.js +7 -0
  308. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.js.map +1 -0
  309. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +87 -0
  310. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
  311. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
  312. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts +2 -6
  313. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -1
  314. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js +4 -22
  315. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js.map +1 -1
  316. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +5 -0
  317. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  318. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  319. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts +1 -0
  320. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
  321. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js.map +1 -1
  322. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
  323. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
  324. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.js +38 -0
  325. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
  326. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +4 -1
  327. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
  328. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +10 -0
  329. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
  330. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
  331. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
  332. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js +85 -0
  333. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
  334. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts +3 -1
  335. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
  336. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +3 -2
  337. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
  338. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +4 -1
  339. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  340. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +5 -2
  341. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  342. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +4 -0
  343. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  344. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +14 -2
  345. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  346. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.d.ts.map +1 -1
  347. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.js +7 -0
  348. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.js.map +1 -1
  349. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +1 -1
  350. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
  351. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.d.ts +18 -0
  352. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
  353. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.js +26 -0
  354. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
  355. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +5 -2
  356. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
  357. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +22 -3
  358. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
  359. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.d.ts +1 -1
  360. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.d.ts.map +1 -1
  361. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts +2 -3
  362. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
  363. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js +2 -4
  364. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
  365. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.d.ts +2 -2
  366. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.d.ts.map +1 -1
  367. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js +2 -2
  368. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js.map +1 -1
  369. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +2 -0
  370. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  371. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +8 -0
  372. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  373. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.d.ts.map +1 -1
  374. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js +8 -3
  375. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js.map +1 -1
  376. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.d.ts +1 -0
  377. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.d.ts.map +1 -1
  378. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.js +1 -0
  379. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.js.map +1 -1
  380. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +31 -1
  381. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
  382. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +15 -0
  383. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  384. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts +1 -1
  385. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  386. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -13
  387. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
  388. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +5 -3
  389. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  390. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.js +16 -1
  391. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.js.map +1 -1
  392. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  393. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  394. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  395. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  396. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  397. package/front_end/third_party/puppeteer/package/lib/types.d.ts +221 -4
  398. package/front_end/third_party/puppeteer/package/package.json +4 -4
  399. package/front_end/third_party/puppeteer/package/src/api/BluetoothEmulation.ts +103 -0
  400. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +96 -1
  401. package/front_end/third_party/puppeteer/package/src/api/DeviceRequestPrompt.ts +2 -10
  402. package/front_end/third_party/puppeteer/package/src/api/Page.ts +6 -0
  403. package/front_end/third_party/puppeteer/package/src/api/api.ts +1 -0
  404. package/front_end/third_party/puppeteer/package/src/bidi/BluetoothEmulation.ts +52 -0
  405. package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +15 -0
  406. package/front_end/third_party/puppeteer/package/src/bidi/DeviceRequestPrompt.ts +138 -0
  407. package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +7 -3
  408. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +10 -2
  409. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +30 -2
  410. package/front_end/third_party/puppeteer/package/src/bidi/util.ts +8 -0
  411. package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +1 -1
  412. package/front_end/third_party/puppeteer/package/src/cdp/BluetoothEmulation.ts +47 -0
  413. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +33 -3
  414. package/front_end/third_party/puppeteer/package/src/cdp/CdpSession.ts +1 -1
  415. package/front_end/third_party/puppeteer/package/src/cdp/DeviceRequestPrompt.ts +3 -8
  416. package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +2 -2
  417. package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +9 -4
  418. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +13 -0
  419. package/front_end/third_party/puppeteer/package/src/cdp/WebWorker.ts +8 -3
  420. package/front_end/third_party/puppeteer/package/src/cdp/cdp.ts +1 -0
  421. package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +45 -1
  422. package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +20 -0
  423. package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +5 -17
  424. package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +23 -7
  425. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  426. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  427. package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +4 -0
  428. package/front_end/ui/components/annotations/AnnotationRepository.ts +153 -13
  429. package/front_end/ui/components/settings/SettingCheckbox.ts +4 -6
  430. package/front_end/ui/components/snackbars/Snackbars.docs.ts +0 -1
  431. package/front_end/ui/components/text_editor/AiCodeCompletionTeaserPlaceholder.ts +12 -3
  432. package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +182 -0
  433. package/front_end/ui/components/text_editor/text_editor.ts +1 -0
  434. package/front_end/ui/helpers/OpenInNewTab.ts +5 -1
  435. package/front_end/ui/i18n/i18n.ts +9 -9
  436. package/front_end/ui/kit/icons/Icon.docs.ts +22 -65
  437. package/front_end/ui/kit/kit.ts +1 -0
  438. package/front_end/ui/kit/link/Link.docs.ts +15 -0
  439. package/front_end/ui/kit/link/Link.ts +151 -0
  440. package/front_end/ui/kit/link/link.css +27 -0
  441. package/front_end/ui/legacy/EmptyWidget.ts +6 -0
  442. package/front_end/ui/legacy/Floaty.ts +442 -0
  443. package/front_end/ui/legacy/InspectorView.ts +12 -0
  444. package/front_end/ui/legacy/ReportView.ts +1 -1
  445. package/front_end/ui/legacy/SelectMenu.docs.ts +0 -1
  446. package/front_end/ui/legacy/TabbedPane.ts +150 -65
  447. package/front_end/ui/legacy/Widget.ts +1 -3
  448. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -1
  449. package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +36 -36
  450. package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +22 -37
  451. package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +31 -1
  452. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -2
  453. package/front_end/ui/legacy/components/utils/Linkifier.ts +7 -11
  454. package/front_end/ui/legacy/floaty.css +77 -0
  455. package/front_end/ui/legacy/legacy.ts +2 -0
  456. package/front_end/ui/legacy/tabbedPane.css +4 -7
  457. package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
  458. package/inspector_overlay/loadCSS.rollup.js +5 -4
  459. package/package.json +2 -2
  460. package/front_end/panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts +0 -99
  461. package/front_end/panels/recorder/components/SelectButton.ts +0 -304
  462. package/front_end/panels/recorder/controllers/controllers.ts +0 -7
  463. package/front_end/ui/components/chrome_link/ChromeLink.ts +0 -76
  464. package/front_end/ui/components/chrome_link/chromeLink.css +0 -12
  465. package/front_end/ui/components/chrome_link/chrome_link.ts +0 -9
  466. /package/front_end/panels/recorder/components/{selectButton.css → replaySection.css} +0 -0
@@ -330,6 +330,37 @@ Content:
330
330
 
331
331
  IMPORTANT: Never show eventKey to the user.
332
332
 
333
+ The following are markdown block(s) of code that ran in the page, each representing a separate function. <FUNCTION_START> and <FUNCTION_END> marks the exact function declaration, and everything outside that is provided for additional context. Comments at the end of each line indicate the runtime performance cost of that code. Do not show the user the function markers or the additional context.
334
+
335
+ Here are 3 relevant functions:
336
+
337
+ (anonymous) @ https://s.yimg.com/aaq/prebid/prebid-2.0.js:12:53984. With added context, chunk is from 9:0 to 18:0
338
+ ```
339
+ // context ...
340
+
341
+ () => { /* some code from https://s.yimg.com/aaq/prebid/prebid-2.0.js... */ }
342
+
343
+ // context ...
344
+ ```
345
+
346
+ (anonymous) @ https://s.yimg.com/aaq/f10d509c/d1irmdsmbztlvx.js:0:43042. With added context, chunk is from 0:0 to 6:0
347
+ ```
348
+ // context ...
349
+
350
+ () => { /* some code from https://s.yimg.com/aaq/f10d509c/d1irmdsmbztlvx.js... */ }
351
+
352
+ // context ...
353
+ ```
354
+
355
+ (anonymous) @ https://s.yimg.com/aaq/prebid/prebid-2.0.js:12:15854. With added context, chunk is from 9:0 to 18:0
356
+ ```
357
+ // context ...
358
+
359
+ () => { /* some code from https://s.yimg.com/aaq/prebid/prebid-2.0.js... */ }
360
+
361
+ // context ...
362
+ ```
363
+
333
364
  # Bottom-up main thread summary
334
365
 
335
366
  This is the bottom-up summary for the entire trace. Only the top 20 activities (sorted by self time) are shown. An activity is all the aggregated time spent on the same type of work. For example, it can be all the time spent in a specific JavaScript function, or all the time spent in a specific browser rendering stage (like layout, v8 compile, parsing html). "Self time" represents the aggregated time spent directly in an activity, across all occurrences. "Total time" represents the aggregated time spent in an activity or any of its children.
@@ -439,18 +470,6 @@ Here are all the insights that contain some related request from the given range
439
470
  - LegacyJavaScript: benji-2.2.99.js (s.yimg.com) (eventKey: s-3387, ts: 157423742567), 25fa214.caas-news_web.min.js (s.yimg.com) (eventKey: s-3412, ts: 157423743431), wnsrvbjmeprtfrnfx.js (s.yimg.com) (eventKey: s-6273, ts: 157423760794), consent.js (s.yimg.com) (eventKey: s-3384, ts: 157423742450), news.yahoo.com/ (news.yahoo.com) (eventKey: s-2116, ts: 157423489126)
440
471
  === end content
441
472
 
442
- Title: PerformanceTraceFormatter formatCallTree
443
- Content:
444
- # Call tree:
445
-
446
- 1;r-62;Task;10.6;0.1;;2;;;S
447
- 2;r-63;Evaluate script;10.5;1.5;;3-5;;
448
- 3;r-75;Profiling overhead;8.8;8.8;;;;
449
- 4;p-3728792-1-17-3;(anonymous);0.2;0.2;;;;
450
-
451
- IMPORTANT: Never show eventKey to the user.
452
- === end content
453
-
454
473
  Title: PerformanceTraceFormatter formatTraceSummary web-dev.json.gz
455
474
  Content:
456
475
  URL: https://web.dev/cls/
@@ -924,6 +943,99 @@ Content:
924
943
  - name: localhost, main thread time: 0.3 ms, network transfer size: 22.9 kB
925
944
  === end content
926
945
 
946
+ Title: PerformanceTraceFormatter formatCallTree long-task-from-worker-thread.json.gz
947
+ Content:
948
+ # Call tree:
949
+
950
+ 1;r-62;Task;10.6;0.1;;2;;;S
951
+ 2;r-63;Evaluate script;10.5;1.5;;3-5;;
952
+ 3;r-75;Profiling overhead;8.8;8.8;;;;
953
+ 4;p-3728792-1-17-3;(anonymous);0.2;0.2;;;;
954
+
955
+ IMPORTANT: Never show eventKey to the user.
956
+ === end content
957
+
958
+ Title: PerformanceTraceFormatter formatCallTree web-dev.json.gz
959
+ Content:
960
+ # All URLs:
961
+
962
+ * 0: https://www.gstatic.com/firebasejs/6.6.1/firebase-auth.js
963
+ * 1: https://www.gstatic.com/firebasejs/6.6.1/firebase-app.js
964
+
965
+ # Call tree:
966
+
967
+ 1;r-4608;Task;7.2;;;2;;
968
+ 2;r-4619;Evaluate script;7.2;;0;3;;
969
+ 3;p-73704-775-2074-418;(anonymous);7.2;;0;4;0;0;S
970
+ 4;p-73704-775-2074-419;(anonymous);7.2;0.1;0;5;0;9
971
+ 5;p-73704-775-2075-420;(anonymous);7.1;;0;6;0;200
972
+ 6;p-73704-775-2075-421;(anonymous);7.1;2.6;0;7;0;231
973
+ 7;p-73704-775-2095-422;(anonymous);4.5;1.3;0;8-19;0;292
974
+ 8;p-73704-775-2095-423;(anonymous);0.5;0.1;0;19-21;0;756
975
+ 9;p-73704-775-2097-424;Et;0.1;0.1;0;;0;10766
976
+ 10;p-73704-775-2098-425;St;0.4;0.2;0;21;0;10904
977
+ 11;p-73704-775-2105-427;k;0.4;0.4;0;;0;5125
978
+ 12;p-73704-775-2108-428;Go;0.1;;0;22;0;68523
979
+ 13;p-73704-775-2109-430;Oi;0.4;0.2;0;23;0;38264
980
+ 14;p-73704-775-2115-432;tl;0.3;0.3;0;;0;154217
981
+ 15;p-73704-775-2118-433;ul;0.6;0.5;0;24;0;155034
982
+ 16;p-73704-775-2121-435;cl;0.1;0.1;0;;0;155107
983
+ 17;p-73704-775-2123-436;hl;0.1;;0;25;0;155309
984
+ 18;p-73704-775-2124-439;sl;0.1;0.1;0;;0;154927
985
+ 19;p-73704-775-2127-441;hl;0.1;0.1;0;;0;155309
986
+ 20;p-73704-775-2128-442;registerService;0.2;;1;26-28;0;9441
987
+ 21;p-73704-775-2099-426;vt;0.2;0.2;0;;0;10155
988
+ 22;p-73704-775-2108-429;Mo;0.1;0.1;0;;0;66493
989
+ 23;p-73704-775-2111-431;vi;0.1;0.1;0;;0;37138
990
+ 24;p-73704-775-2118-434;ll;0.1;0.1;0;;0;155345
991
+ 25;p-73704-775-2123-437;ll;0.1;;0;28;0;155345
992
+ 26;p-73704-775-2128-443;u;0.1;0.1;1;;0;10091
993
+ 27;p-73704-775-2129-444;d;0.1;0.1;1;;0;595
994
+ 28;p-73704-775-2123-438;get prototype;0.1;0.1;;;;
995
+
996
+ IMPORTANT: Never show eventKey to the user.
997
+
998
+ The following are markdown block(s) of code that ran in the page, each representing a separate function. <FUNCTION_START> and <FUNCTION_END> marks the exact function declaration, and everything outside that is provided for additional context. Comments at the end of each line indicate the runtime performance cost of that code. Do not show the user the function markers or the additional context.
999
+
1000
+ Here are 4 relevant functions:
1001
+
1002
+ (anonymous) @ https://www.gstatic.com/firebasejs/6.6.1/firebase-auth.js:0:0. With added context, chunk is from 0:0 to 6:0
1003
+ ```
1004
+ // context ...
1005
+
1006
+ () => { /* some code from https://www.gstatic.com/firebasejs/6.6.1/firebase-auth.js... */ }
1007
+
1008
+ // context ...
1009
+ ```
1010
+
1011
+ (anonymous) @ https://www.gstatic.com/firebasejs/6.6.1/firebase-auth.js:0:231. With added context, chunk is from 0:0 to 6:0
1012
+ ```
1013
+ // context ...
1014
+
1015
+ () => { /* some code from https://www.gstatic.com/firebasejs/6.6.1/firebase-auth.js... */ }
1016
+
1017
+ // context ...
1018
+ ```
1019
+
1020
+ (anonymous) @ https://www.gstatic.com/firebasejs/6.6.1/firebase-auth.js:0:292. With added context, chunk is from 0:0 to 6:0
1021
+ ```
1022
+ // context ...
1023
+
1024
+ () => { /* some code from https://www.gstatic.com/firebasejs/6.6.1/firebase-auth.js... */ }
1025
+
1026
+ // context ...
1027
+ ```
1028
+
1029
+ (anonymous) @ https://www.gstatic.com/firebasejs/6.6.1/firebase-auth.js:0:155034. With added context, chunk is from 0:0 to 6:0
1030
+ ```
1031
+ // context ...
1032
+
1033
+ () => { /* some code from https://www.gstatic.com/firebasejs/6.6.1/firebase-auth.js... */ }
1034
+
1035
+ // context ...
1036
+ ```
1037
+ === end content
1038
+
927
1039
  Title: PerformanceTraceFormatter formatNetworkRequests formats network requests that have redirects
928
1040
  Content:
929
1041
  ## Network request: http://localhost:3000/redirect3
@@ -2,6 +2,9 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ import type * as Platform from '../../../core/platform/platform.js';
6
+ import type * as Protocol from '../../../generated/protocol.js';
7
+ import * as Annotations from '../../../ui/components/annotations/annotations.js';
5
8
  import * as CrUXManager from '../../crux-manager/crux-manager.js';
6
9
  import type * as SourceMapScopes from '../../source_map_scopes/source_map_scopes.js';
7
10
  import * as Trace from '../../trace/trace.js';
@@ -23,7 +26,7 @@ interface FormatFactByInsightSetOptions {
23
26
  title: string;
24
27
  description?: string;
25
28
  empty: string;
26
- cb: (insightSet: Trace.Insights.Types.InsightSet) => string | null;
29
+ cb: (insightSet: Trace.Insights.Types.InsightSet) => Promise<string|null>;
27
30
  }
28
31
 
29
32
  export class PerformanceTraceFormatter {
@@ -31,6 +34,10 @@ export class PerformanceTraceFormatter {
31
34
  #parsedTrace: Trace.TraceModel.ParsedTrace;
32
35
  #insightSet: Trace.Insights.Types.InsightSet|null;
33
36
  #eventsSerializer: Trace.EventsSerializer.EventsSerializer;
37
+ #formattedFunctionCodes = new Set<string>();
38
+ resolveFunctionCode?:
39
+ (url: Platform.DevToolsPath.UrlString, line: number,
40
+ column: number) => Promise<SourceMapScopes.FunctionCodeResolver.FunctionCode|null>;
34
41
 
35
42
  constructor(focus: AgentFocus) {
36
43
  this.#focus = focus;
@@ -140,9 +147,9 @@ export class PerformanceTraceFormatter {
140
147
  'The following is a list of insight sets. An insight set covers a specific part of the trace, split by navigations. The insights within each insight set are specific to that part of the trace. Be sure to consider the insight set id and bounds when calling functions. If no specific insight set or navigation is mentioned, assume the user is referring to the first one.');
141
148
 
142
149
  for (const insightSet of parsedTrace.insights?.values() ?? []) {
143
- const lcp = insightSet ? Trace.Insights.Common.getLCP(insightSet) : null;
144
- const cls = insightSet ? Trace.Insights.Common.getCLS(insightSet) : null;
145
- const inp = insightSet ? Trace.Insights.Common.getINP(insightSet) : null;
150
+ const lcp = Trace.Insights.Common.getLCP(insightSet);
151
+ const cls = Trace.Insights.Common.getCLS(insightSet);
152
+ const inp = Trace.Insights.Common.getINP(insightSet);
146
153
 
147
154
  parts.push(`\n## insight set id: ${insightSet.id}\n`);
148
155
  parts.push(`URL: ${insightSet.url}`);
@@ -150,11 +157,11 @@ export class PerformanceTraceFormatter {
150
157
  if (lcp || cls || inp) {
151
158
  parts.push('Metrics (lab / observed):');
152
159
  if (lcp) {
153
- const nodeId = insightSet?.model.LCPBreakdown.lcpEvent?.args.data?.nodeId;
160
+ const nodeId = insightSet.model.LCPBreakdown?.lcpEvent?.args.data?.nodeId;
154
161
  const nodeIdText = nodeId !== undefined ? `, nodeId: ${nodeId}` : '';
155
162
  parts.push(
156
163
  ` - LCP: ${Math.round(lcp.value / 1000)} ms, event: ${this.serializeEvent(lcp.event)}${nodeIdText}`);
157
- const subparts = insightSet?.model.LCPBreakdown.subparts;
164
+ const subparts = insightSet.model.LCPBreakdown?.subparts;
158
165
  if (subparts) {
159
166
  const serializeSubpart = (subpart: Trace.Insights.Models.LCPBreakdown.Subpart): string => {
160
167
  return `${micros(subpart.range)}, bounds: ${this.serializeBounds(subpart)}`;
@@ -176,6 +183,16 @@ export class PerformanceTraceFormatter {
176
183
  if (cls) {
177
184
  const eventText = cls.worstClusterEvent ? `, event: ${this.serializeEvent(cls.worstClusterEvent)}` : '';
178
185
  parts.push(` - CLS: ${cls.value.toFixed(2)}${eventText}`);
186
+
187
+ if (Annotations.AnnotationRepository.annotationsEnabled()) {
188
+ const worstClusterEvent = cls.worstClusterEvent as Trace.Types.Events.SyntheticLayoutShiftCluster;
189
+ const layoutShiftData =
190
+ worstClusterEvent?.worstShiftEvent?.args?.data as Trace.Types.Events.LayoutShiftData;
191
+ if (layoutShiftData?.impacted_nodes && layoutShiftData.impacted_nodes?.length > 0) {
192
+ Annotations.AnnotationRepository.instance().addElementsAnnotation(
193
+ 'This element is impacted by a layout shift', layoutShiftData.impacted_nodes[0].node_id.toString());
194
+ }
195
+ }
179
196
  }
180
197
  } else {
181
198
  parts.push('Metrics (lab / observed): n/a');
@@ -223,7 +240,7 @@ export class PerformanceTraceFormatter {
223
240
  return parts.join('\n');
224
241
  }
225
242
 
226
- #formatFactByInsightSet(options: FormatFactByInsightSetOptions): string {
243
+ async #formatFactByInsightSet(options: FormatFactByInsightSetOptions): Promise<string> {
227
244
  const {insights, title, description, empty, cb} = options;
228
245
  const lines = [`# ${title}\n`];
229
246
 
@@ -237,7 +254,7 @@ export class PerformanceTraceFormatter {
237
254
  if (multipleInsightSets) {
238
255
  lines.push(`## insight set id: ${insightSet.id}\n`);
239
256
  }
240
- lines.push((cb(insightSet) ?? empty) + '\n');
257
+ lines.push((await cb(insightSet) ?? empty) + '\n');
241
258
  }
242
259
  } else {
243
260
  lines.push(empty + '\n');
@@ -246,27 +263,27 @@ export class PerformanceTraceFormatter {
246
263
  return lines.join('\n');
247
264
  }
248
265
 
249
- formatCriticalRequests(): string {
266
+ formatCriticalRequests(): Promise<string> {
250
267
  const parsedTrace = this.#parsedTrace;
251
268
  return this.#formatFactByInsightSet({
252
269
  insights: parsedTrace.insights,
253
270
  title: 'Critical network requests',
254
271
  empty: 'none',
255
- cb: insightSet => {
272
+ cb: async insightSet => {
256
273
  const criticalRequests: Trace.Types.Events.SyntheticNetworkRequest[] = [];
257
274
 
258
275
  const walkRequest = (node: Trace.Insights.Models.NetworkDependencyTree.CriticalRequestNode): void => {
259
276
  criticalRequests.push(node.request);
260
277
  node.children.forEach(walkRequest);
261
278
  };
262
- insightSet.model.NetworkDependencyTree.rootNodes.forEach(walkRequest);
279
+ insightSet.model.NetworkDependencyTree?.rootNodes.forEach(walkRequest);
263
280
 
264
281
  return criticalRequests.length ? this.formatNetworkRequests(criticalRequests, {verbose: false}) : null;
265
282
  },
266
283
  });
267
284
  }
268
285
 
269
- #serializeBottomUpRootNode(rootNode: Trace.Extras.TraceTree.BottomUpRootNode, limit: number): string {
286
+ async #serializeBottomUpRootNode(rootNode: Trace.Extras.TraceTree.BottomUpRootNode, limit: number): Promise<string> {
270
287
  // Sorted by selfTime.
271
288
  // No nodes less than 1 ms.
272
289
  // Limit.
@@ -274,6 +291,7 @@ export class PerformanceTraceFormatter {
274
291
  .filter(n => n.totalTime >= 1)
275
292
  .sort((a, b) => b.selfTime - a.selfTime)
276
293
  .slice(0, limit);
294
+ const callFrames: Protocol.Runtime.CallFrame[] = [];
277
295
 
278
296
  function nodeToText(this: PerformanceTraceFormatter, node: Trace.Extras.TraceTree.Node): string {
279
297
  const event = node.event;
@@ -281,10 +299,14 @@ export class PerformanceTraceFormatter {
281
299
  let frame;
282
300
  if (Trace.Types.Events.isProfileCall(event)) {
283
301
  frame = event.callFrame;
302
+ if (node.selfTime >= 100 && callFrames.length < 3) {
303
+ callFrames.push(frame);
304
+ }
284
305
  } else {
285
306
  frame = Trace.Helpers.Trace.getStackTraceTopCallFrameInEventPayload(event);
286
307
  }
287
308
 
309
+ // TODO(crbug.com/452333154): this is not source mapped.
288
310
  let source = Trace.Name.forEntry(event);
289
311
  if (frame?.url) {
290
312
  source += ` (url: ${frame.url}`;
@@ -300,7 +322,8 @@ export class PerformanceTraceFormatter {
300
322
  return `- self: ${millis(node.selfTime)}, total: ${millis(node.totalTime)}, source: ${source}`;
301
323
  }
302
324
 
303
- return topNodes.map(node => nodeToText.call(this, node)).join('\n');
325
+ return topNodes.map(node => nodeToText.call(this, node)).join('\n') +
326
+ await this.#serializeRelevantFunctions(callFrames);
304
327
  }
305
328
 
306
329
  #getSerializeBottomUpRootNodeFormat(limit: number): string {
@@ -308,7 +331,7 @@ export class PerformanceTraceFormatter {
308
331
  limit} activities (sorted by self time) are shown. An activity is all the aggregated time spent on the same type of work. For example, it can be all the time spent in a specific JavaScript function, or all the time spent in a specific browser rendering stage (like layout, v8 compile, parsing html). "Self time" represents the aggregated time spent directly in an activity, across all occurrences. "Total time" represents the aggregated time spent in an activity or any of its children.`;
309
332
  }
310
333
 
311
- formatMainThreadBottomUpSummary(): string {
334
+ formatMainThreadBottomUpSummary(): Promise<string> {
312
335
  const parsedTrace = this.#parsedTrace;
313
336
  const limit = 10;
314
337
  return this.#formatFactByInsightSet({
@@ -316,13 +339,13 @@ export class PerformanceTraceFormatter {
316
339
  title: 'Main thread bottom-up summary',
317
340
  description: this.#getSerializeBottomUpRootNodeFormat(limit),
318
341
  empty: 'no activity',
319
- cb: insightSet => {
342
+ cb: async insightSet => {
320
343
  const rootNode = AIQueries.mainThreadActivityBottomUpSingleNavigation(
321
344
  insightSet.navigation?.args.data?.navigationId,
322
345
  insightSet.bounds,
323
346
  parsedTrace,
324
347
  );
325
- return rootNode ? this.#serializeBottomUpRootNode(rootNode, limit) : null;
348
+ return rootNode ? await this.#serializeBottomUpRootNode(rootNode, limit) : null;
326
349
  },
327
350
  });
328
351
  }
@@ -343,13 +366,13 @@ export class PerformanceTraceFormatter {
343
366
  return listText;
344
367
  }
345
368
 
346
- formatThirdPartySummary(): string {
369
+ formatThirdPartySummary(): Promise<string> {
347
370
  const parsedTrace = this.#parsedTrace;
348
371
  return this.#formatFactByInsightSet({
349
372
  insights: parsedTrace.insights,
350
373
  title: '3rd party summary',
351
374
  empty: 'no 3rd parties',
352
- cb: insightSet => {
375
+ cb: async insightSet => {
353
376
  const thirdPartySummaries =
354
377
  Trace.Extras.ThirdParties.summarizeByThirdParty(parsedTrace.data, insightSet.bounds);
355
378
  return thirdPartySummaries.length ? this.#formatThirdPartyEntitySummaries(thirdPartySummaries) : null;
@@ -357,13 +380,13 @@ export class PerformanceTraceFormatter {
357
380
  });
358
381
  }
359
382
 
360
- formatLongestTasks(): string {
383
+ formatLongestTasks(): Promise<string> {
361
384
  const parsedTrace = this.#parsedTrace;
362
385
  return this.#formatFactByInsightSet({
363
386
  insights: parsedTrace.insights,
364
387
  title: 'Longest tasks',
365
388
  empty: 'none',
366
- cb: insightSet => {
389
+ cb: async insightSet => {
367
390
  const longestTaskTrees =
368
391
  AIQueries.longestTasks(insightSet.navigation?.args.data?.navigationId, insightSet.bounds, parsedTrace, 3);
369
392
  if (!longestTaskTrees?.length) {
@@ -421,12 +444,12 @@ export class PerformanceTraceFormatter {
421
444
  return results.join('\n');
422
445
  }
423
446
 
424
- formatMainThreadTrackSummary(bounds: Trace.Types.Timing.TraceWindowMicro): string {
447
+ async formatMainThreadTrackSummary(bounds: Trace.Types.Timing.TraceWindowMicro): Promise<string> {
425
448
  if (!this.#parsedTrace.insights) {
426
449
  return 'No main thread activity found';
427
450
  }
428
451
 
429
- const results = [];
452
+ const results: string[] = [];
430
453
 
431
454
  const insightSet = this.#parsedTrace.insights?.values().find(
432
455
  insightSet => Trace.Helpers.Timing.boundsIncludeTimeRange({bounds, timeRange: insightSet.bounds}));
@@ -437,7 +460,7 @@ export class PerformanceTraceFormatter {
437
460
  );
438
461
  if (topDownTree) {
439
462
  results.push('# Top-down main thread summary');
440
- results.push(this.formatCallTree(topDownTree, 2 /* headerLevel */));
463
+ results.push(await this.formatCallTree(topDownTree, 2 /* headerLevel */));
441
464
  }
442
465
 
443
466
  const bottomUpRootNode = AIQueries.mainThreadActivityBottomUp(
@@ -448,7 +471,7 @@ export class PerformanceTraceFormatter {
448
471
  results.push('# Bottom-up main thread summary');
449
472
  const limit = 20;
450
473
  results.push(this.#getSerializeBottomUpRootNodeFormat(limit));
451
- results.push(this.#serializeBottomUpRootNode(bottomUpRootNode, limit));
474
+ results.push(await this.#serializeBottomUpRootNode(bottomUpRootNode, limit));
452
475
  }
453
476
 
454
477
  const thirdPartySummaries = Trace.Extras.ThirdParties.summarizeByThirdParty(this.#parsedTrace.data, bounds);
@@ -492,8 +515,21 @@ export class PerformanceTraceFormatter {
492
515
  return results.join('\n\n');
493
516
  }
494
517
 
495
- formatCallTree(tree: AICallTree, headerLevel = 1): string {
496
- return `${tree.serialize(headerLevel)}\n\nIMPORTANT: Never show eventKey to the user.`;
518
+ async formatCallTree(tree: AICallTree, headerLevel = 1): Promise<string> {
519
+ let result = `${tree.serialize(headerLevel)}\n\nIMPORTANT: Never show eventKey to the user.\n`;
520
+
521
+ const relevantCallFrames = [];
522
+ if (tree.selectedNode && Trace.Types.Events.isProfileCall(tree.selectedNode.event)) {
523
+ relevantCallFrames.push(tree.selectedNode.event.callFrame);
524
+ }
525
+ const topCallFrameByTotalTime = tree.topCallFrameByTotalTime();
526
+ if (topCallFrameByTotalTime) {
527
+ relevantCallFrames.push(topCallFrameByTotalTime);
528
+ }
529
+ relevantCallFrames.push(...tree.topCallFramesBySelfTime(3));
530
+ result += await this.#serializeRelevantFunctions(relevantCallFrames);
531
+
532
+ return result;
497
533
  }
498
534
 
499
535
  formatNetworkRequests(
@@ -562,6 +598,7 @@ export class PerformanceTraceFormatter {
562
598
  string {
563
599
  const {
564
600
  url,
601
+ requestId,
565
602
  statusCode,
566
603
  initialPriority,
567
604
  priority,
@@ -622,7 +659,8 @@ export class PerformanceTraceFormatter {
622
659
  const eventKey = this.#eventsSerializer.keyForEvent(request);
623
660
  const eventKeyLine = eventKey ? `eventKey: ${eventKey}\n` : '';
624
661
 
625
- return `${titlePrefix}: ${url}
662
+ return `${titlePrefix}: ${url}${
663
+ Annotations.AnnotationRepository.annotationsEnabled() ? `\nrequestId: ${requestId}` : ''}
626
664
  ${eventKeyLine}Timings:
627
665
  - Queued at: ${micros(startTimesForLifecycle.queuedAt)}
628
666
  - Request sent at: ${micros(startTimesForLifecycle.requestSentAt)}
@@ -815,7 +853,34 @@ The order of headers corresponds to an internal fixed list. If a header is not p
815
853
  return parts.join(';');
816
854
  }
817
855
 
856
+ resolveFunctionCodeAtLocation(url: Platform.DevToolsPath.UrlString, line: number, column: number):
857
+ Promise<SourceMapScopes.FunctionCodeResolver.FunctionCode|null> {
858
+ if (!this.resolveFunctionCode) {
859
+ throw new Error('missing resolveFunctionCode');
860
+ }
861
+
862
+ return this.resolveFunctionCode(url, line, column);
863
+ }
864
+
818
865
  formatFunctionCode(code: SourceMapScopes.FunctionCodeResolver.FunctionCode): string {
866
+ return this.#getFormattedFunctionCodeExplainer() + '\n\n' + this.#formatFunctionCode(code);
867
+ }
868
+
869
+ #getFormattedFunctionCodeExplainer(): string {
870
+ return 'The following are markdown block(s) of code that ran in the page, each representing a separate function. <FUNCTION_START> and <FUNCTION_END> marks the exact function declaration, and everything outside that is provided for additional context. Comments at the end of each line indicate the runtime performance cost of that code. Do not show the user the function markers or the additional context.';
871
+ }
872
+
873
+ #functionCodeToKey(code: SourceMapScopes.FunctionCodeResolver.FunctionCode): string {
874
+ return code.functionBounds.uiSourceCode.url() + ':' + code.functionBounds.range.toString();
875
+ }
876
+
877
+ #hasFormattedFunctionCode(code: SourceMapScopes.FunctionCodeResolver.FunctionCode): boolean {
878
+ return this.#formattedFunctionCodes.has(this.#functionCodeToKey(code));
879
+ }
880
+
881
+ #formatFunctionCode(code: SourceMapScopes.FunctionCodeResolver.FunctionCode): string {
882
+ this.#formattedFunctionCodes.add(this.#functionCodeToKey(code));
883
+
819
884
  const {startLine, startColumn} = code.range;
820
885
  const {
821
886
  startLine: contextStartLine,
@@ -823,18 +888,48 @@ The order of headers corresponds to an internal fixed list. If a header is not p
823
888
  endLine: contextEndLine,
824
889
  endColumn: contextEndColumn
825
890
  } = code.rangeWithContext;
826
- const name = code.functionBounds.name;
891
+ const name = code.functionBounds.name || '(anonymous)';
827
892
  const url = code.functionBounds.uiSourceCode.url();
828
893
 
829
894
  const parts = [];
830
895
  parts.push(`${name} @ ${url}:${startLine}:${startColumn}. With added context, chunk is from ${contextStartLine}:${
831
896
  contextStartColumn} to ${contextEndLine}:${contextEndColumn}`);
832
- parts.push(
833
- '\nThe following is a markdown block of JavaScript. <FUNCTION_START> and <FUNCTION_END> marks the exact function declaration, and everything outside that is provided for additional context. Comments at the end of each line indicate the runtime performance cost of that code. Do not show the user the function markers or the additional context.\n');
834
897
  parts.push('```');
835
898
  parts.push(code.codeWithContext);
836
899
  parts.push('```');
837
900
 
838
901
  return parts.join('\n');
839
902
  }
903
+
904
+ /**
905
+ * Appends the code of each call frame's function, but only if the function was not
906
+ * serialized previously.
907
+ */
908
+ async #serializeRelevantFunctions(callFrames: Protocol.Runtime.CallFrame[]): Promise<string> {
909
+ const resolveFunctionCode = this.resolveFunctionCode;
910
+ if (!resolveFunctionCode) {
911
+ return '';
912
+ }
913
+
914
+ const functionCodeStrings = [];
915
+ const functionCodes = await Promise.all(callFrames.map(
916
+ frame =>
917
+ resolveFunctionCode(frame.url as Platform.DevToolsPath.UrlString, frame.lineNumber, frame.columnNumber)));
918
+ for (const code of functionCodes) {
919
+ if (code && !this.#hasFormattedFunctionCode(code)) {
920
+ functionCodeStrings.push(this.#formatFunctionCode(code));
921
+ }
922
+ }
923
+
924
+ if (!functionCodeStrings.length) {
925
+ return '';
926
+ }
927
+
928
+ return '\n' + [
929
+ this.#getFormattedFunctionCodeExplainer(),
930
+ functionCodeStrings.length > 1 ? `Here are ${functionCodeStrings.length} relevant functions:` :
931
+ `Here is a relevant function:`,
932
+ ...functionCodeStrings,
933
+ ].join('\n\n');
934
+ }
840
935
  }
@@ -2,6 +2,7 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ import type * as Protocol from '../../../generated/protocol.js';
5
6
  import * as Trace from '../../../models/trace/trace.js';
6
7
  import * as SourceMapsResolver from '../../../models/trace_source_maps_resolver/trace_source_maps_resolver.js';
7
8
 
@@ -375,6 +376,47 @@ export class AICallTree {
375
376
  return line;
376
377
  }
377
378
 
379
+ topCallFramesBySelfTime(limit: number): Protocol.Runtime.CallFrame[] {
380
+ const functionNodesByCallFrame = new Map<string, Trace.Extras.TraceTree.Node[]>();
381
+
382
+ this.breadthFirstWalk(this.rootNode.children().values(), node => {
383
+ if (Trace.Types.Events.isProfileCall(node.event)) {
384
+ const callFrame = node.event.callFrame;
385
+ const callFrameKey = `${callFrame.scriptId}:${callFrame.lineNumber}:${callFrame.columnNumber}`;
386
+ const array = functionNodesByCallFrame.get(callFrameKey) ?? [];
387
+ array.push(node);
388
+ functionNodesByCallFrame.set(callFrameKey, array);
389
+ }
390
+ });
391
+
392
+ return [...functionNodesByCallFrame.values()]
393
+ .map(nodes => {
394
+ return {
395
+ callFrame: (nodes[0].event as Trace.Types.Events.SyntheticProfileCall).callFrame,
396
+ selfTime: nodes.reduce((total, cur) => total + cur.selfTime, 0),
397
+ };
398
+ })
399
+ .sort((a, b) => b.selfTime - a.selfTime)
400
+ .slice(0, limit)
401
+ .map(({callFrame}) => callFrame);
402
+ }
403
+
404
+ topCallFrameByTotalTime(): Protocol.Runtime.CallFrame|null {
405
+ let topChild: Trace.Extras.TraceTree.Node|null = null;
406
+ let topProfileCallEvent: Trace.Types.Events.SyntheticProfileCall|null = null;
407
+
408
+ for (const child of this.rootNode.children().values()) {
409
+ if (Trace.Types.Events.isProfileCall(child.event)) {
410
+ if (!topChild || child.totalTime > topChild.totalTime) {
411
+ topChild = child;
412
+ topProfileCallEvent = child.event;
413
+ }
414
+ }
415
+ }
416
+
417
+ return topProfileCallEvent?.callFrame ?? null;
418
+ }
419
+
378
420
  // Only used for debugging.
379
421
  logDebug(): void {
380
422
  const str = this.serialize();
@@ -150,4 +150,16 @@ export class AiCodeGeneration {
150
150
 
151
151
  return response;
152
152
  }
153
+
154
+ static isAiCodeGenerationEnabled(locale: string): boolean {
155
+ if (!locale.startsWith('en-')) {
156
+ return false;
157
+ }
158
+ const aidaAvailability = Root.Runtime.hostConfig.aidaAvailability;
159
+ if (!aidaAvailability || aidaAvailability.blockedByGeo || aidaAvailability.blockedByAge ||
160
+ aidaAvailability.blockedByEnterprisePolicy) {
161
+ return false;
162
+ }
163
+ return Boolean(aidaAvailability.enabled && Root.Runtime.hostConfig.devToolsAiCodeGeneration?.enabled);
164
+ }
153
165
  }
@@ -51,6 +51,7 @@ export const enum IssueCategory {
51
51
  CORS = 'Cors',
52
52
  ATTRIBUTION_REPORTING = 'AttributionReporting',
53
53
  QUIRKS_MODE = 'QuirksMode',
54
+ PERMISSION_ELEMENT = 'PermissionElement',
54
55
  OTHER = 'Other',
55
56
  }
56
57
 
@@ -21,6 +21,7 @@ import {LowTextContrastIssue} from './LowTextContrastIssue.js';
21
21
  import type {MarkdownIssueDescription} from './MarkdownIssueDescription.js';
22
22
  import {MixedContentIssue} from './MixedContentIssue.js';
23
23
  import {PartitioningBlobURLIssue} from './PartitioningBlobURLIssue.js';
24
+ import {PermissionElementIssue} from './PermissionElementIssue.js';
24
25
  import {QuirksModeIssue} from './QuirksModeIssue.js';
25
26
  import {SharedArrayBufferIssue} from './SharedArrayBufferIssue.js';
26
27
 
@@ -67,6 +68,7 @@ export class AggregatedIssue extends Issue {
67
68
  #cookieDeprecationMetadataIssues = new Set<CookieDeprecationMetadataIssue>();
68
69
  #mixedContentIssues = new Set<MixedContentIssue>();
69
70
  #partitioningBlobURLIssues = new Set<PartitioningBlobURLIssue>();
71
+ #permissionElementIssues = new Set<PermissionElementIssue>();
70
72
  #sharedArrayBufferIssues = new Set<SharedArrayBufferIssue>();
71
73
  #quirksModeIssues = new Set<QuirksModeIssue>();
72
74
  #attributionReportingIssues = new Set<AttributionReportingIssue>();
@@ -190,6 +192,10 @@ export class AggregatedIssue extends Issue {
190
192
  return this.#partitioningBlobURLIssues;
191
193
  }
192
194
 
195
+ getPermissionElementIssues(): Iterable<PermissionElementIssue> {
196
+ return this.#permissionElementIssues;
197
+ }
198
+
193
199
  /**
194
200
  * Produces a primary key for a cookie. Use this instead of `JSON.stringify` in
195
201
  * case new fields are added to `AffectedCookie`.
@@ -282,6 +288,9 @@ export class AggregatedIssue extends Issue {
282
288
  if (issue instanceof PartitioningBlobURLIssue) {
283
289
  this.#partitioningBlobURLIssues.add(issue);
284
290
  }
291
+ if (issue instanceof PermissionElementIssue) {
292
+ this.#permissionElementIssues.add(issue);
293
+ }
285
294
  }
286
295
 
287
296
  getKind(): IssueKind {
@@ -25,6 +25,7 @@ import {Events} from './IssuesManagerEvents.js';
25
25
  import {LowTextContrastIssue} from './LowTextContrastIssue.js';
26
26
  import {MixedContentIssue} from './MixedContentIssue.js';
27
27
  import {PartitioningBlobURLIssue} from './PartitioningBlobURLIssue.js';
28
+ import {PermissionElementIssue} from './PermissionElementIssue.js';
28
29
  import {PropertyRuleIssue} from './PropertyRuleIssue.js';
29
30
  import {QuirksModeIssue} from './QuirksModeIssue.js';
30
31
  import {SharedArrayBufferIssue} from './SharedArrayBufferIssue.js';
@@ -144,6 +145,10 @@ const issueCodeHandlers = new Map<
144
145
  Protocol.Audits.InspectorIssueCode.UnencodedDigestIssue,
145
146
  UnencodedDigestIssue.fromInspectorIssue,
146
147
  ],
148
+ [
149
+ Protocol.Audits.InspectorIssueCode.PermissionElementIssue,
150
+ PermissionElementIssue.fromInspectorIssue,
151
+ ],
147
152
  ]);
148
153
 
149
154
  /**