chrome-devtools-frontend 1.0.1669021 → 1.0.1672557

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 (302) hide show
  1. package/.agents/skills/fixing-skipped-tests/SKILL.md +6 -6
  2. package/.agents/skills/gerrit-cli/SKILL.md +4 -10
  3. package/.agents/skills/gerrit-cli/references/commands.md +45 -2
  4. package/.agents/skills/gerrit-cli/references/workflows.md +7 -0
  5. package/.agents/skills/gerrit-cli/scripts/import_upstream.py +34 -152
  6. package/config/typescript/tsconfig.eslint.json +1 -1
  7. package/docs/contributing/settings-experiments-features.md +2 -8
  8. package/docs/ecosystem/automatic_workspace_folders.md +0 -19
  9. package/eslint.config.mjs +5 -5
  10. package/front_end/core/common/Lazy.ts +3 -3
  11. package/front_end/core/common/SettingRegistration.ts +0 -7
  12. package/front_end/core/common/Settings.ts +0 -38
  13. package/front_end/core/host/UserMetrics.ts +187 -953
  14. package/front_end/core/host/UserMetricsEnums.ts +949 -0
  15. package/front_end/core/root/Runtime.ts +21 -138
  16. package/front_end/core/sdk/CSSMetadata.ts +70 -65
  17. package/front_end/core/sdk/CategorizedBreakpoint.ts +0 -1
  18. package/front_end/core/sdk/ChildTargetManager.ts +0 -2
  19. package/front_end/core/sdk/EmulationModel.ts +0 -2
  20. package/front_end/core/sdk/EventBreakpointsModel.ts +0 -4
  21. package/front_end/core/sdk/NetworkManager.ts +0 -3
  22. package/front_end/core/sdk/PageResourceLoader.ts +9 -9
  23. package/front_end/core/sdk/RehydratingConnection.ts +52 -4
  24. package/front_end/core/sdk/Target.ts +0 -4
  25. package/front_end/devtools_compatibility.js +886 -0
  26. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +7 -6
  27. package/front_end/entrypoints/main/ExecutionContextSelector.ts +0 -1
  28. package/front_end/entrypoints/main/MainImpl.ts +18 -22
  29. package/front_end/foundation/Universe.ts +7 -2
  30. package/front_end/generated/InspectorBackendCommands.ts +3 -10
  31. package/front_end/generated/{SupportedCSSProperties.js → SupportedCSSProperties.ts} +16 -0
  32. package/front_end/generated/protocol-mapping.d.ts +0 -42
  33. package/front_end/generated/protocol-proxy-api.d.ts +0 -38
  34. package/front_end/generated/protocol.ts +9 -169
  35. package/front_end/models/ai_assistance/AiAgent2.ts +11 -3
  36. package/front_end/models/ai_assistance/AiConversation.ts +1 -0
  37. package/front_end/models/ai_assistance/AiHistoryStorage.ts +8 -5
  38. package/front_end/models/ai_assistance/AiSetting.ts +108 -0
  39. package/front_end/models/ai_assistance/AiUtils.ts +47 -0
  40. package/front_end/models/ai_assistance/ChangeManager.ts +1 -0
  41. package/front_end/models/ai_assistance/ExtensionScope.ts +3 -12
  42. package/front_end/models/ai_assistance/agents/AiAgent.ts +11 -18
  43. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +3 -0
  44. package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +42 -17
  45. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +1 -1
  46. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +3 -2
  47. package/front_end/models/ai_assistance/agents/StorageAgent.ts +253 -155
  48. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
  49. package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
  50. package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +12 -6
  51. package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +3 -1
  52. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +1 -0
  53. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +4 -3
  54. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +1 -1
  55. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -0
  56. package/front_end/models/ai_assistance/injected.ts +1 -0
  57. package/front_end/models/ai_assistance/performance/AICallTree.ts +1 -0
  58. package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
  59. package/front_end/models/ai_assistance/skills/SkillRegistry.ts +2 -0
  60. package/front_end/models/ai_assistance/skills/performance.md +10 -0
  61. package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +52 -5
  62. package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +4 -4
  63. package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +4 -4
  64. package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +5 -4
  65. package/front_end/models/ai_assistance/tools/GetStyles.ts +5 -4
  66. package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +5 -4
  67. package/front_end/models/ai_assistance/tools/README.md +1 -1
  68. package/front_end/models/ai_assistance/tools/RecordPerformanceTrace.ts +63 -0
  69. package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +5 -5
  70. package/front_end/models/ai_assistance/tools/Tool.ts +118 -24
  71. package/front_end/models/ai_assistance/tools/ToolRegistry.ts +2 -0
  72. package/front_end/models/badges/UserBadges.ts +2 -0
  73. package/front_end/models/bindings/NetworkProject.ts +5 -0
  74. package/front_end/models/bindings/ResourceScriptMapping.ts +2 -0
  75. package/front_end/models/bindings/ResourceUtils.ts +3 -0
  76. package/front_end/models/crux-manager/CrUXManager.ts +1 -0
  77. package/front_end/models/emulation/DeviceModeModel.ts +140 -7
  78. package/front_end/models/emulation/EmulatedDevices.ts +246 -793
  79. package/front_end/models/issues_manager/IssuesManager.ts +10 -2
  80. package/front_end/models/live-metrics/LiveMetrics.ts +41 -9
  81. package/front_end/models/logs/LogManager.ts +8 -5
  82. package/front_end/models/logs/NetworkLog.ts +1 -0
  83. package/front_end/models/persistence/IsolatedFileSystemManager.ts +21 -3
  84. package/front_end/models/persistence/NetworkPersistenceManager.ts +6 -0
  85. package/front_end/models/project_settings/ProjectSettingsModel.ts +8 -12
  86. package/front_end/models/trace/Processor.ts +42 -10
  87. package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +12 -19
  88. package/front_end/models/trace/handlers/MetaHandler.ts +38 -5
  89. package/front_end/models/trace/insights/CLSCulprits.ts +1 -2
  90. package/front_end/models/trace/insights/CharacterSet.ts +1 -1
  91. package/front_end/models/trace/insights/Common.ts +21 -2
  92. package/front_end/models/trace/insights/DocumentLatency.ts +1 -1
  93. package/front_end/models/trace/insights/LCPBreakdown.ts +7 -6
  94. package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
  95. package/front_end/models/trace/insights/ModernHTTP.ts +7 -3
  96. package/front_end/models/trace/insights/NetworkDependencyTree.ts +1 -1
  97. package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
  98. package/front_end/models/trace/insights/ThirdParties.ts +5 -2
  99. package/front_end/models/trace/insights/types.ts +11 -6
  100. package/front_end/models/trace/types/Configuration.ts +5 -0
  101. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +3 -1
  102. package/front_end/models/workspace/IgnoreListManager.ts +2 -0
  103. package/front_end/models/workspace/UISourceCode.ts +2 -0
  104. package/front_end/models/workspace_diff/WorkspaceDiff.ts +4 -0
  105. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +22 -22
  106. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -7
  107. package/front_end/panels/ai_assistance/components/ChatInput.ts +4 -0
  108. package/front_end/panels/ai_assistance/components/ChatMessage.ts +79 -34
  109. package/front_end/panels/ai_assistance/components/WalkthroughView.ts +1 -2
  110. package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
  111. package/front_end/panels/application/ApplicationPanelSidebar.ts +9 -106
  112. package/front_end/panels/application/ApplicationPanelTreeElement.ts +1 -1
  113. package/front_end/panels/application/application.ts +0 -10
  114. package/front_end/panels/application/components/components.ts +0 -4
  115. package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +0 -5
  116. package/front_end/panels/browser_debugger/EventListenerBreakpointsSidebarPane.ts +6 -12
  117. package/front_end/panels/browser_debugger/browser_debugger-meta.ts +5 -3
  118. package/front_end/panels/console/ConsoleFormat.ts +2 -62
  119. package/front_end/panels/console/ConsoleViewMessage.ts +14 -7
  120. package/front_end/panels/elements/ElementsTreeElement.ts +1 -2
  121. package/front_end/panels/emulation/AdvancedApp.ts +1 -2
  122. package/front_end/panels/emulation/DeviceModeToolbar.ts +83 -69
  123. package/front_end/panels/emulation/DeviceModeView.ts +4 -134
  124. package/front_end/panels/emulation/DeviceModeWrapper.ts +52 -69
  125. package/front_end/panels/emulation/MediaQueryInspector.ts +2 -2
  126. package/front_end/panels/emulation/emulation-meta.ts +12 -12
  127. package/front_end/panels/issues/IssuesPane.ts +3 -1
  128. package/front_end/panels/lighthouse/LighthouseController.ts +6 -0
  129. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +17 -21
  130. package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +206 -126
  131. package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +1 -1
  132. package/front_end/panels/mobile_throttling/CalibrationController.ts +1 -1
  133. package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +3 -3
  134. package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +6 -6
  135. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +14 -12
  136. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +13 -13
  137. package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +10 -10
  138. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +28 -28
  139. package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +6 -6
  140. package/front_end/panels/network/RequestHeadersView.ts +1 -1
  141. package/front_end/panels/network/ResourceChunkView.ts +243 -144
  142. package/front_end/panels/network/ResourceDirectSocketChunkView.ts +52 -29
  143. package/front_end/panels/network/ResourceWebSocketFrameView.ts +21 -35
  144. package/front_end/panels/network/resourceChunkView.css +41 -36
  145. package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +21 -12
  146. package/front_end/panels/profiler/profiler.ts +4 -0
  147. package/front_end/panels/recorder/RecorderPanel.ts +6 -14
  148. package/front_end/panels/sensors/LocationsSettingsTab.ts +7 -7
  149. package/front_end/panels/settings/AISettingsTab.ts +75 -31
  150. package/front_end/panels/settings/SettingsScreen.ts +8 -13
  151. package/front_end/panels/settings/components/SyncSection.ts +3 -4
  152. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +650 -18
  153. package/front_end/panels/settings/emulation/devicesSettingsTab.css +18 -0
  154. package/front_end/panels/settings/settings-meta.ts +0 -1
  155. package/front_end/panels/sources/CategorizedBreakpointL10n.ts +0 -2
  156. package/front_end/panels/sources/DebuggerPausedMessage.ts +11 -5
  157. package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
  158. package/front_end/panels/sources/EditingLocationHistoryManager.ts +12 -9
  159. package/front_end/panels/sources/SourcesPanel.ts +19 -17
  160. package/front_end/panels/sources/SourcesView.ts +191 -96
  161. package/front_end/panels/sources/TabbedEditorContainer.ts +3 -4
  162. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -5
  163. package/front_end/panels/timeline/TimelinePanel.ts +2 -0
  164. package/front_end/panels/timeline/TimelineUIUtils.ts +15 -0
  165. package/front_end/panels/timeline/components/CWVMetrics.ts +16 -3
  166. package/front_end/panels/timeline/components/cwvMetrics.css +4 -0
  167. package/front_end/panels/timeline/components/liveMetricsView.css +0 -17
  168. package/front_end/panels/timeline/components/metricValueStyles.css +17 -0
  169. package/front_end/panels/timeline/timeline-meta.ts +3 -5
  170. package/front_end/third_party/chromium/README.chromium +1 -1
  171. package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
  172. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  173. package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
  174. package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
  175. package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
  176. package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
  177. package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
  178. package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
  179. package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
  180. package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
  181. package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
  182. package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
  183. package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
  184. package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
  185. package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
  186. package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
  187. package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
  188. package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
  189. package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
  190. package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
  191. package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
  192. package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
  193. package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
  194. package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
  195. package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
  196. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +1332 -193
  197. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
  198. package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
  199. package/front_end/third_party/puppeteer/README.chromium +2 -2
  200. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +64 -15
  201. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +65 -16
  202. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +50 -7
  203. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
  204. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
  205. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts +2 -1
  206. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
  207. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js +5 -5
  208. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js.map +1 -1
  209. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts +2 -1
  210. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts.map +1 -1
  211. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js +8 -6
  212. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js.map +1 -1
  213. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.d.ts.map +1 -1
  214. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.js +3 -0
  215. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.js.map +1 -1
  216. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
  217. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +16 -1
  218. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
  219. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.d.ts +5 -1
  220. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.d.ts.map +1 -1
  221. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js +11 -6
  222. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js.map +1 -1
  223. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.d.ts.map +1 -1
  224. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.js +5 -0
  225. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.js.map +1 -1
  226. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  227. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js +10 -0
  228. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js.map +1 -1
  229. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js +4 -3
  230. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js.map +1 -1
  231. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts +27 -2
  232. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts.map +1 -1
  233. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js +12 -1
  234. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js.map +1 -1
  235. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts +2 -2
  236. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts.map +1 -1
  237. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js +2 -2
  238. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js.map +1 -1
  239. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  240. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js +2 -0
  241. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js.map +1 -1
  242. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts +2 -1
  243. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
  244. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js +5 -4
  245. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js.map +1 -1
  246. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
  247. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
  248. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
  249. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
  250. package/front_end/third_party/puppeteer/package/lib/types.d.ts +64 -15
  251. package/front_end/third_party/puppeteer/package/package.json +2 -2
  252. package/front_end/third_party/puppeteer/package/src/api/Page.ts +50 -7
  253. package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +9 -7
  254. package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +9 -6
  255. package/front_end/third_party/puppeteer/package/src/bidi/Dialog.ts +4 -0
  256. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +24 -1
  257. package/front_end/third_party/puppeteer/package/src/cdp/Connection.ts +11 -6
  258. package/front_end/third_party/puppeteer/package/src/cdp/Dialog.ts +7 -0
  259. package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +11 -0
  260. package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +7 -3
  261. package/front_end/third_party/puppeteer/package/src/common/Debug.ts +30 -5
  262. package/front_end/third_party/puppeteer/package/src/common/util.ts +2 -2
  263. package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +2 -0
  264. package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +6 -4
  265. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  266. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  267. package/front_end/tsconfig.compatibility.json +2 -1
  268. package/front_end/tsconfig.json +1 -1
  269. package/front_end/ui/components/icon_button/IconButton.ts +1 -1
  270. package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
  271. package/front_end/ui/components/settings/SettingCheckbox.ts +4 -7
  272. package/front_end/ui/components/settings/settings.ts +1 -2
  273. package/front_end/ui/legacy/Treeoutline.ts +52 -30
  274. package/front_end/ui/legacy/components/object_ui/CSSStyleSanitizer.ts +74 -0
  275. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +6 -1
  276. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +47 -54
  277. package/front_end/ui/legacy/components/object_ui/object_ui.ts +2 -0
  278. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +5 -27
  279. package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +10 -12
  280. package/front_end/ui/settings/SettingUIRegistration.ts +0 -8
  281. package/front_end/ui/visual_logging/KnownContextValues.ts +37 -0
  282. package/inspector_overlay/tsconfig.json +8 -2
  283. package/package.json +3 -2
  284. package/.agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py +0 -47
  285. package/front_end/core/sdk/CSSModel.test.api.ts +0 -102
  286. package/front_end/core/sdk/DOMModel.test.api.ts +0 -104
  287. package/front_end/foundation/Universe.test.api.ts +0 -73
  288. package/front_end/panels/application/SharedStorageEventsView.ts +0 -128
  289. package/front_end/panels/application/SharedStorageItemsView.ts +0 -179
  290. package/front_end/panels/application/SharedStorageListTreeElement.ts +0 -65
  291. package/front_end/panels/application/SharedStorageModel.ts +0 -249
  292. package/front_end/panels/application/SharedStorageTreeElement.ts +0 -40
  293. package/front_end/panels/application/components/SharedStorageAccessGrid.ts +0 -191
  294. package/front_end/panels/application/components/SharedStorageMetadataView.ts +0 -133
  295. package/front_end/panels/application/components/sharedStorageAccessGrid.css +0 -29
  296. package/front_end/panels/application/components/sharedStorageMetadataView.css +0 -29
  297. package/front_end/panels/application/sharedStorageEventsView.css +0 -9
  298. package/front_end/panels/network/OriginalResourceChunkView.ts +0 -340
  299. package/front_end/panels/network/originalResourceChunkView.css +0 -49
  300. package/front_end/ui/components/settings/SettingDeprecationWarning.ts +0 -47
  301. package/front_end/ui/components/settings/settingDeprecationWarning.css +0 -14
  302. /package/front_end/generated/{ARIAProperties.js → ARIAProperties.ts} +0 -0
@@ -1275,14 +1275,6 @@ export declare const /**
1275
1275
  */
1276
1276
  export declare class Connection extends EventEmitter<CDPSessionEvents> {
1277
1277
  #private;
1278
- constructor(
1279
- url: string,
1280
- transport: ConnectionTransport,
1281
- delay?: number,
1282
- timeout?: number,
1283
- rawErrors?: boolean,
1284
- idGenerator?: () => number,
1285
- );
1286
1278
  static fromSession(session: CDPSession): Connection | undefined;
1287
1279
  get timeout(): number;
1288
1280
  /**
@@ -5425,6 +5417,18 @@ export declare interface LocatorScrollOptions extends ActionOptions {
5425
5417
  scrollLeft?: number;
5426
5418
  }
5427
5419
 
5420
+ /**
5421
+ * @public
5422
+ * @experimental
5423
+ */
5424
+ export declare type Logger = (prefix: string) => LoggerFunction | undefined;
5425
+
5426
+ /**
5427
+ * @public
5428
+ * @experimental
5429
+ */
5430
+ export declare type LoggerFunction = (...args: unknown[]) => void;
5431
+
5428
5432
  /**
5429
5433
  * @public
5430
5434
  */
@@ -5466,18 +5470,58 @@ export declare interface MediaFeature {
5466
5470
  * @public
5467
5471
  */
5468
5472
  export declare interface Metrics {
5473
+ /**
5474
+ * The timestamp when the metrics sample was taken, in monotonic time
5475
+ * (seconds since an arbitrary point in the past).
5476
+ */
5469
5477
  Timestamp?: number;
5478
+ /**
5479
+ * Number of documents in the page.
5480
+ */
5470
5481
  Documents?: number;
5482
+ /**
5483
+ * Number of frames in the page.
5484
+ */
5471
5485
  Frames?: number;
5486
+ /**
5487
+ * Number of events in the page.
5488
+ */
5472
5489
  JSEventListeners?: number;
5490
+ /**
5491
+ * Number of DOM nodes in the page.
5492
+ */
5473
5493
  Nodes?: number;
5494
+ /**
5495
+ * Total number of full or partial page layouts.
5496
+ */
5474
5497
  LayoutCount?: number;
5498
+ /**
5499
+ * Total number of page style recalculations.
5500
+ */
5475
5501
  RecalcStyleCount?: number;
5502
+ /**
5503
+ * Combined duration of all page layouts, in seconds.
5504
+ */
5476
5505
  LayoutDuration?: number;
5506
+ /**
5507
+ * Combined duration of all page style recalculations, in seconds.
5508
+ */
5477
5509
  RecalcStyleDuration?: number;
5510
+ /**
5511
+ * Combined duration of JavaScript execution, in seconds.
5512
+ */
5478
5513
  ScriptDuration?: number;
5514
+ /**
5515
+ * Combined duration of all tasks performed by the browser, in seconds.
5516
+ */
5479
5517
  TaskDuration?: number;
5518
+ /**
5519
+ * Used JavaScript heap size, in bytes.
5520
+ */
5480
5521
  JSHeapUsedSize?: number;
5522
+ /**
5523
+ * Total JavaScript heap size, in bytes.
5524
+ */
5481
5525
  JSHeapTotalSize?: number;
5482
5526
  }
5483
5527
 
@@ -6642,7 +6686,8 @@ export declare abstract class Page extends EventEmitter<PageEvents> {
6642
6686
  *
6643
6687
  * @returns
6644
6688
  *
6645
- * - `Timestamp` : The timestamp when the metrics sample was taken.
6689
+ * - `Timestamp` : The timestamp when the metrics sample was taken, in
6690
+ * monotonic time (seconds).
6646
6691
  *
6647
6692
  * - `Documents` : Number of documents in the page.
6648
6693
  *
@@ -6656,18 +6701,20 @@ export declare abstract class Page extends EventEmitter<PageEvents> {
6656
6701
  *
6657
6702
  * - `RecalcStyleCount` : Total number of page style recalculations.
6658
6703
  *
6659
- * - `LayoutDuration` : Combined durations of all page layouts.
6704
+ * - `LayoutDuration` : Combined durations of all page layouts, in seconds.
6660
6705
  *
6661
6706
  * - `RecalcStyleDuration` : Combined duration of all page style
6662
- * recalculations.
6707
+ * recalculations, in seconds.
6663
6708
  *
6664
- * - `ScriptDuration` : Combined duration of JavaScript execution.
6709
+ * - `ScriptDuration` : Combined duration of JavaScript execution, in
6710
+ * seconds.
6665
6711
  *
6666
- * - `TaskDuration` : Combined duration of all tasks performed by the browser.
6712
+ * - `TaskDuration` : Combined duration of all tasks performed by the
6713
+ * browser, in seconds.
6667
6714
  *
6668
- * - `JSHeapUsedSize` : Used JavaScript heap size.
6715
+ * - `JSHeapUsedSize` : Used JavaScript heap size, in bytes.
6669
6716
  *
6670
- * - `JSHeapTotalSize` : Total JavaScript heap size.
6717
+ * - `JSHeapTotalSize` : Total JavaScript heap size, in bytes.
6671
6718
  *
6672
6719
  * @remarks
6673
6720
  * All timestamps are in monotonic time: monotonically increasing time
@@ -8432,6 +8479,8 @@ declare namespace Puppeteer_2 {
8432
8479
  CookieData,
8433
8480
  DeleteCookiesRequest,
8434
8481
  CustomQueryHandler,
8482
+ LoggerFunction,
8483
+ Logger,
8435
8484
  Device,
8436
8485
  EventType,
8437
8486
  Handler,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "puppeteer-core",
3
- "version": "25.4.0",
3
+ "version": "25.5.0",
4
4
  "description": "A high-level API to control headless Chrome over the DevTools Protocol",
5
5
  "keywords": [
6
6
  "puppeteer",
@@ -148,7 +148,7 @@
148
148
  "author": "The Chromium Authors",
149
149
  "license": "Apache-2.0",
150
150
  "dependencies": {
151
- "@puppeteer/browsers": "3.0.6",
151
+ "@puppeteer/browsers": "3.1.0",
152
152
  "chromium-bidi": "17.0.2",
153
153
  "devtools-protocol": "0.0.1653615",
154
154
  "typed-query-selector": "^2.12.2",
@@ -125,18 +125,58 @@ import type {WebWorker} from './WebWorker.js';
125
125
  * @public
126
126
  */
127
127
  export interface Metrics {
128
+ /**
129
+ * The timestamp when the metrics sample was taken, in monotonic time
130
+ * (seconds since an arbitrary point in the past).
131
+ */
128
132
  Timestamp?: number;
133
+ /**
134
+ * Number of documents in the page.
135
+ */
129
136
  Documents?: number;
137
+ /**
138
+ * Number of frames in the page.
139
+ */
130
140
  Frames?: number;
141
+ /**
142
+ * Number of events in the page.
143
+ */
131
144
  JSEventListeners?: number;
145
+ /**
146
+ * Number of DOM nodes in the page.
147
+ */
132
148
  Nodes?: number;
149
+ /**
150
+ * Total number of full or partial page layouts.
151
+ */
133
152
  LayoutCount?: number;
153
+ /**
154
+ * Total number of page style recalculations.
155
+ */
134
156
  RecalcStyleCount?: number;
157
+ /**
158
+ * Combined duration of all page layouts, in seconds.
159
+ */
135
160
  LayoutDuration?: number;
161
+ /**
162
+ * Combined duration of all page style recalculations, in seconds.
163
+ */
136
164
  RecalcStyleDuration?: number;
165
+ /**
166
+ * Combined duration of JavaScript execution, in seconds.
167
+ */
137
168
  ScriptDuration?: number;
169
+ /**
170
+ * Combined duration of all tasks performed by the browser, in seconds.
171
+ */
138
172
  TaskDuration?: number;
173
+ /**
174
+ * Used JavaScript heap size, in bytes.
175
+ */
139
176
  JSHeapUsedSize?: number;
177
+ /**
178
+ * Total JavaScript heap size, in bytes.
179
+ */
140
180
  JSHeapTotalSize?: number;
141
181
  }
142
182
 
@@ -1720,7 +1760,8 @@ export abstract class Page extends EventEmitter<PageEvents> {
1720
1760
  *
1721
1761
  * @returns
1722
1762
  *
1723
- * - `Timestamp` : The timestamp when the metrics sample was taken.
1763
+ * - `Timestamp` : The timestamp when the metrics sample was taken, in
1764
+ * monotonic time (seconds).
1724
1765
  *
1725
1766
  * - `Documents` : Number of documents in the page.
1726
1767
  *
@@ -1734,18 +1775,20 @@ export abstract class Page extends EventEmitter<PageEvents> {
1734
1775
  *
1735
1776
  * - `RecalcStyleCount` : Total number of page style recalculations.
1736
1777
  *
1737
- * - `LayoutDuration` : Combined durations of all page layouts.
1778
+ * - `LayoutDuration` : Combined durations of all page layouts, in seconds.
1738
1779
  *
1739
1780
  * - `RecalcStyleDuration` : Combined duration of all page style
1740
- * recalculations.
1781
+ * recalculations, in seconds.
1741
1782
  *
1742
- * - `ScriptDuration` : Combined duration of JavaScript execution.
1783
+ * - `ScriptDuration` : Combined duration of JavaScript execution, in
1784
+ * seconds.
1743
1785
  *
1744
- * - `TaskDuration` : Combined duration of all tasks performed by the browser.
1786
+ * - `TaskDuration` : Combined duration of all tasks performed by the
1787
+ * browser, in seconds.
1745
1788
  *
1746
- * - `JSHeapUsedSize` : Used JavaScript heap size.
1789
+ * - `JSHeapUsedSize` : Used JavaScript heap size, in bytes.
1747
1790
  *
1748
- * - `JSHeapTotalSize` : Total JavaScript heap size.
1791
+ * - `JSHeapTotalSize` : Total JavaScript heap size, in bytes.
1749
1792
  *
1750
1793
  * @remarks
1751
1794
  * All timestamps are in monotonic time: monotonically increasing time
@@ -9,24 +9,25 @@ import type {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js'
9
9
 
10
10
  import type {CDPEvents, CDPSession} from '../api/CDPSession.js';
11
11
  import type {Connection as CdpConnection} from '../cdp/Connection.js';
12
- import {debug} from '../common/Debug.js';
12
+ import {debug, type DebugPrefix, type Logger} from '../common/Debug.js';
13
13
  import {TargetCloseError} from '../common/Errors.js';
14
14
  import type {Handler} from '../common/EventEmitter.js';
15
15
 
16
16
  import {BidiConnection} from './Connection.js';
17
17
 
18
- const bidiServerLogger = (
19
- prefix: string,
20
- ): ((...args: unknown[]) => void) | undefined => {
21
- return debug(`bidi:${prefix}`);
22
- };
23
-
24
18
  /**
25
19
  * @internal
26
20
  */
27
21
  export async function connectBidiOverCdp(
28
22
  cdp: CdpConnection,
23
+ logger: Logger = debug,
29
24
  ): Promise<BidiConnection> {
25
+ const bidiServerLogger = (
26
+ prefix: string,
27
+ ): ((...args: unknown[]) => void) | undefined => {
28
+ return logger(`bidi:${prefix}` as DebugPrefix);
29
+ };
30
+
30
31
  const transportBiDi = new NoOpTransport();
31
32
  const cdpConnectionAdapter = new CdpConnectionAdapter(cdp);
32
33
  const pptrTransport = {
@@ -53,6 +54,7 @@ export async function connectBidiOverCdp(
53
54
  cdp._idGenerator,
54
55
  cdp.delay,
55
56
  cdp.timeout,
57
+ logger,
56
58
  );
57
59
  const bidiServer = await BidiMapper.BidiServer.createAndStart(
58
60
  transportBiDi,
@@ -9,7 +9,7 @@ import type * as Bidi from 'webdriver-bidi-protocol';
9
9
 
10
10
  import {CallbackRegistry} from '../common/CallbackRegistry.js';
11
11
  import type {ConnectionTransport} from '../common/ConnectionTransport.js';
12
- import {debug} from '../common/Debug.js';
12
+ import {debug, DEBUG_PREFIXES, type Logger} from '../common/Debug.js';
13
13
  import {ConnectionClosedError} from '../common/Errors.js';
14
14
  import type {EventsWithWildcard} from '../common/EventEmitter.js';
15
15
  import {EventEmitter} from '../common/EventEmitter.js';
@@ -23,9 +23,6 @@ import type {
23
23
  Connection,
24
24
  } from './core/Connection.js';
25
25
 
26
- const debugProtocolSend = debug('puppeteer:webDriverBiDi:SEND ►');
27
- const debugProtocolReceive = debug('puppeteer:webDriverBiDi:RECV ◀');
28
-
29
26
  export type CdpEvent = ChromiumBidi.Cdp.Event;
30
27
 
31
28
  /**
@@ -60,6 +57,8 @@ export class BidiConnection
60
57
  #closed = false;
61
58
  #callbacks: CallbackRegistry;
62
59
  #emitters: Array<EventEmitter<any>> = [];
60
+ #debugProtocolSend: ((...args: unknown[]) => void) | undefined;
61
+ #debugProtocolReceive: ((...args: unknown[]) => void) | undefined;
63
62
 
64
63
  constructor(
65
64
  url: string,
@@ -67,6 +66,7 @@ export class BidiConnection
67
66
  idGenerator: GetIdFn,
68
67
  delay = 0,
69
68
  timeout?: number,
69
+ logger: Logger = debug,
70
70
  ) {
71
71
  super();
72
72
  this.#url = url;
@@ -74,6 +74,9 @@ export class BidiConnection
74
74
  this.#timeout = timeout ?? 180_000;
75
75
  this.#callbacks = new CallbackRegistry(idGenerator);
76
76
 
77
+ this.#debugProtocolSend = logger(DEBUG_PREFIXES.bidiSend);
78
+ this.#debugProtocolReceive = logger(DEBUG_PREFIXES.bidiReceive);
79
+
77
80
  this.#transport = transport;
78
81
  this.#transport.onmessage = this.onMessage.bind(this);
79
82
  this.#transport.onclose = this.unbind.bind(this);
@@ -131,7 +134,7 @@ export class BidiConnection
131
134
  method,
132
135
  params,
133
136
  } as Bidi.Command);
134
- debugProtocolSend?.(stringifiedMessage);
137
+ this.#debugProtocolSend?.(stringifiedMessage);
135
138
  this.#transport.send(stringifiedMessage);
136
139
  }) as Promise<{result: Commands[T]['returnType']}>;
137
140
  }
@@ -145,7 +148,7 @@ export class BidiConnection
145
148
  return setTimeout(f, this.#delay);
146
149
  });
147
150
  }
148
- debugProtocolReceive?.(message);
151
+ this.#debugProtocolReceive?.(message);
149
152
  const object: Bidi.Message | CdpEvent = JSON.parse(message);
150
153
  if ('type' in object) {
151
154
  switch (object.type) {
@@ -18,6 +18,10 @@ export class BidiDialog extends Dialog {
18
18
  super(prompt.info.type, prompt.info.message, prompt.info.defaultValue);
19
19
  this.#prompt = prompt;
20
20
  this.handled = prompt.handled;
21
+
22
+ prompt.once('handled', () => {
23
+ this.handled = true;
24
+ });
21
25
  }
22
26
 
23
27
  override async handle(options: {
@@ -132,6 +132,7 @@ export class CdpBrowser extends BrowserBase {
132
132
  #handleDevToolsAsPage = false;
133
133
  #extensions = new Map<string, Extension>();
134
134
  #version?: Deferred<Protocol.Browser.GetVersionResponse>;
135
+ #hasNetworkRestrictions = false;
135
136
 
136
137
  constructor(
137
138
  connection: Connection,
@@ -162,10 +163,12 @@ export class CdpBrowser extends BrowserBase {
162
163
  });
163
164
  this.#handleDevToolsAsPage = handleDevToolsAsPage;
164
165
  this.#setIsPageTargetCallback(isPageTargetCallback);
165
- connection.rejectEmulateNetworkConditionsCalls = Boolean(
166
+ this.#hasNetworkRestrictions = Boolean(
166
167
  (blocklist && blocklist.length > 0) ||
167
168
  (allowlist && allowlist.length > 0),
168
169
  );
170
+ connection.rejectEmulateNetworkConditionsCalls =
171
+ this.#hasNetworkRestrictions;
169
172
  this.#targetManager = new TargetManager(
170
173
  connection,
171
174
  this.#createTarget,
@@ -529,6 +532,11 @@ export class CdpBrowser extends BrowserBase {
529
532
  }
530
533
 
531
534
  override async installPWA(options: InstallPWAOptions): Promise<string> {
535
+ if (this.#hasNetworkRestrictions) {
536
+ throw new Error(
537
+ 'PWA APIs are not supported when network restrictions are configured.',
538
+ );
539
+ }
532
540
  await this.#connection.send('PWA.install', {
533
541
  manifestId: options.manifestId,
534
542
  installUrlOrBundleUrl: options.installUrlOrBundleUrl,
@@ -543,12 +551,22 @@ export class CdpBrowser extends BrowserBase {
543
551
  }
544
552
 
545
553
  override async uninstallPWA(options: UninstallPWAOptions): Promise<void> {
554
+ if (this.#hasNetworkRestrictions) {
555
+ throw new Error(
556
+ 'PWA APIs are not supported when network restrictions are configured.',
557
+ );
558
+ }
546
559
  await this.#connection.send('PWA.uninstall', {
547
560
  manifestId: options.manifestId,
548
561
  });
549
562
  }
550
563
 
551
564
  override async launchPWA(options: LaunchPWAOptions): Promise<Page> {
565
+ if (this.#hasNetworkRestrictions) {
566
+ throw new Error(
567
+ 'PWA APIs are not supported when network restrictions are configured.',
568
+ );
569
+ }
552
570
  // `PWA.launch` resolves with the id of the launched *tab* target (see the
553
571
  // CDP `PWA.LaunchResponse` docs). Tab targets sit above page targets in the
554
572
  // target hierarchy and are not exposed through `browser.targets()`, so the
@@ -582,6 +600,11 @@ export class CdpBrowser extends BrowserBase {
582
600
  }
583
601
 
584
602
  override async getPWAState(options: GetPWAStateOptions): Promise<PWAState> {
603
+ if (this.#hasNetworkRestrictions) {
604
+ throw new Error(
605
+ 'PWA APIs are not supported when network restrictions are configured.',
606
+ );
607
+ }
585
608
  const {badgeCount, fileHandlers} = await this.#connection.send(
586
609
  'PWA.getOsAppState',
587
610
  {manifestId: options.manifestId},
@@ -15,7 +15,7 @@ import {
15
15
  } from '../api/CDPSession.js';
16
16
  import {CallbackRegistry} from '../common/CallbackRegistry.js';
17
17
  import type {ConnectionTransport} from '../common/ConnectionTransport.js';
18
- import {debug} from '../common/Debug.js';
18
+ import {debug, DEBUG_PREFIXES, type Logger} from '../common/Debug.js';
19
19
  import {ConnectionClosedError, TargetCloseError} from '../common/Errors.js';
20
20
  import {EventEmitter} from '../common/EventEmitter.js';
21
21
  import {createProtocolErrorMessage} from '../util/ErrorLike.js';
@@ -26,9 +26,6 @@ import {
26
26
 
27
27
  import {CdpCDPSession} from './CdpSession.js';
28
28
 
29
- const debugProtocolSend = debug('puppeteer:protocol:SEND ►');
30
- const debugProtocolReceive = debug('puppeteer:protocol:RECV ◀');
31
-
32
29
  /**
33
30
  * @public
34
31
  */
@@ -44,7 +41,12 @@ export class Connection extends EventEmitter<CDPSessionEvents> {
44
41
  #callbacks: CallbackRegistry;
45
42
  #rawErrors = false;
46
43
  #idGenerator: GetIdFn;
44
+ #debugProtocolSend: ((...args: unknown[]) => void) | undefined;
45
+ #debugProtocolReceive: ((...args: unknown[]) => void) | undefined;
47
46
 
47
+ /**
48
+ * @internal
49
+ */
48
50
  constructor(
49
51
  url: string,
50
52
  transport: ConnectionTransport,
@@ -52,12 +54,15 @@ export class Connection extends EventEmitter<CDPSessionEvents> {
52
54
  timeout?: number,
53
55
  rawErrors = false,
54
56
  idGenerator: () => number = createIncrementalIdGenerator(),
57
+ logger: Logger = debug,
55
58
  ) {
56
59
  super();
57
60
  this.#rawErrors = rawErrors;
58
61
  this.#idGenerator = idGenerator;
59
62
  this.#callbacks = new CallbackRegistry(idGenerator);
60
63
  this.#url = url;
64
+ this.#debugProtocolSend = logger(DEBUG_PREFIXES.cdpSend);
65
+ this.#debugProtocolReceive = logger(DEBUG_PREFIXES.cdpReceive);
61
66
  this.#delay = delay;
62
67
  this.#timeout = timeout ?? 180_000;
63
68
 
@@ -176,7 +181,7 @@ export class Connection extends EventEmitter<CDPSessionEvents> {
176
181
  id,
177
182
  sessionId,
178
183
  });
179
- debugProtocolSend?.(stringifiedMessage);
184
+ this.#debugProtocolSend?.(stringifiedMessage);
180
185
  this.#transport.send(stringifiedMessage);
181
186
  }) as Promise<ProtocolMapping.Commands[T]['returnType']>;
182
187
  }
@@ -197,7 +202,7 @@ export class Connection extends EventEmitter<CDPSessionEvents> {
197
202
  return setTimeout(r, this.#delay);
198
203
  });
199
204
  }
200
- debugProtocolReceive?.(message);
205
+ this.#debugProtocolReceive?.(message);
201
206
  const object = JSON.parse(message);
202
207
  if (object.method === 'Target.attachedToTarget') {
203
208
  const sessionId = object.params.sessionId;
@@ -23,6 +23,8 @@ export class CdpDialog extends Dialog {
23
23
  ) {
24
24
  super(type, message, defaultValue);
25
25
  this.#client = client;
26
+
27
+ client.once('Page.javascriptDialogClosed', this.#onDialogClosed);
26
28
  }
27
29
 
28
30
  override async handle(options: {
@@ -33,5 +35,10 @@ export class CdpDialog extends Dialog {
33
35
  accept: options.accept,
34
36
  promptText: options.text,
35
37
  });
38
+ this.#client.off('Page.javascriptDialogClosed', this.#onDialogClosed);
36
39
  }
40
+
41
+ #onDialogClosed = () => {
42
+ this.handled = true;
43
+ };
37
44
  }
@@ -85,6 +85,7 @@ export class NetworkManager extends EventEmitter<NetworkManagerEvents> {
85
85
  #userAgentMetadata?: Protocol.Emulation.UserAgentMetadata;
86
86
  #platform?: string;
87
87
  #acceptLanguage?: string;
88
+ #userAgentOverrideApplied = false;
88
89
 
89
90
  readonly #handlers = [
90
91
  ['Fetch.requestPaused', this.#onRequestPaused],
@@ -285,6 +286,15 @@ export class NetworkManager extends EventEmitter<NetworkManagerEvents> {
285
286
  }
286
287
 
287
288
  async #applyUserAgent(client: CDPSession) {
289
+ const nothingToEmulate =
290
+ this.#userAgent === undefined &&
291
+ this.#userAgentMetadata === undefined &&
292
+ this.#acceptLanguage === undefined &&
293
+ this.#platform === undefined;
294
+ // Still need to send once to reset a previously-applied override.
295
+ if (nothingToEmulate && !this.#userAgentOverrideApplied) {
296
+ return;
297
+ }
288
298
  const userAgent =
289
299
  this.#userAgent ??
290
300
  (await this.#frameManager.page().browser().userAgent());
@@ -298,6 +308,7 @@ export class NetworkManager extends EventEmitter<NetworkManagerEvents> {
298
308
  userAgentMetadata: this.#userAgentMetadata,
299
309
  platform: this.#platform,
300
310
  });
311
+ this.#userAgentOverrideApplied = !nothingToEmulate;
301
312
  } catch (error) {
302
313
  if (this.#canIgnoreError(error)) {
303
314
  return;
@@ -115,10 +115,10 @@ async function getConnectionTransport(
115
115
  endpointUrl: browserWSEndpoint,
116
116
  };
117
117
  } else if (browserURL) {
118
- const connectionURL = await getWSEndpoint(browserURL);
118
+ const connectionURL = await getWSEndpoint(browserURL, headers);
119
119
  const WebSocketClass = await getWebSocketTransportClass();
120
120
  const connectionTransport: ConnectionTransport =
121
- await WebSocketClass.create(connectionURL);
121
+ await WebSocketClass.create(connectionURL, headers);
122
122
  return {
123
123
  connectionTransport: connectionTransport,
124
124
  endpointUrl: connectionURL,
@@ -181,12 +181,16 @@ async function getConnectionTransport(
181
181
  throw new Error('Invalid connection options');
182
182
  }
183
183
 
184
- async function getWSEndpoint(browserURL: string): Promise<string> {
184
+ async function getWSEndpoint(
185
+ browserURL: string,
186
+ headers?: Record<string, string>,
187
+ ): Promise<string> {
185
188
  const endpointURL = new URL('/json/version', browserURL);
186
189
 
187
190
  try {
188
191
  const result = await globalThis.fetch(endpointURL.toString(), {
189
192
  method: 'GET',
193
+ headers,
190
194
  });
191
195
  if (!result.ok) {
192
196
  throw new Error(`HTTP ${result.statusText}`);
@@ -9,6 +9,33 @@ import {isNode, environment} from '../environment.js';
9
9
  declare global {
10
10
  const __PUPPETEER_DEBUG: string;
11
11
  }
12
+ /**
13
+ * @internal
14
+ */
15
+ export const DEBUG_PREFIXES = {
16
+ cdpSend: 'puppeteer:protocol:SEND ►',
17
+ cdpReceive: 'puppeteer:protocol:RECV ◀',
18
+ bidiSend: 'puppeteer:webDriverBiDi:SEND ►',
19
+ bidiReceive: 'puppeteer:webDriverBiDi:RECV ◀',
20
+ error: 'puppeteer:error',
21
+ ffmpeg: 'puppeteer:ffmpeg',
22
+ } as const;
23
+
24
+ /**
25
+ * @internal
26
+ */
27
+ export type DebugPrefix = (typeof DEBUG_PREFIXES)[keyof typeof DEBUG_PREFIXES];
28
+
29
+ /**
30
+ * @public
31
+ * @experimental
32
+ */
33
+ export type LoggerFunction = (...args: unknown[]) => void;
34
+ /**
35
+ * @public
36
+ * @experimental
37
+ */
38
+ export type Logger = (prefix: string) => LoggerFunction | undefined;
12
39
  /**
13
40
  * A debug function that can be used in any environment.
14
41
  *
@@ -36,7 +63,7 @@ declare global {
36
63
  * @example
37
64
  *
38
65
  * ```
39
- * const log = debug('Page');
66
+ * const log = debug(DEBUG_PREFIXES.error);
40
67
  *
41
68
  * log('new page created')
42
69
  * // logs "Page: new page created"
@@ -47,9 +74,7 @@ declare global {
47
74
  *
48
75
  * @internal
49
76
  */
50
- export const debug = (
51
- prefix: string,
52
- ): ((...args: unknown[]) => void) | undefined => {
77
+ export const debug: Logger = (prefix): LoggerFunction | undefined => {
53
78
  if (isNode) {
54
79
  const nodeDebug = environment.value.debuglog?.(prefix);
55
80
  if (!nodeDebug || !nodeDebug.enabled) {
@@ -60,7 +85,7 @@ export const debug = (
60
85
  if (captureLogs) {
61
86
  capturedLogs.push(prefix + logArgs);
62
87
  }
63
- (nodeDebug as (...args: any[]) => void)(...logArgs);
88
+ (nodeDebug as LoggerFunction)(...logArgs);
64
89
  };
65
90
  }
66
91
 
@@ -21,7 +21,7 @@ import {assert} from '../util/assert.js';
21
21
  import {mergeUint8Arrays, stringToTypedArray} from '../util/encoding.js';
22
22
  import {packageVersion} from '../util/version.js';
23
23
 
24
- import {debug} from './Debug.js';
24
+ import {debug, DEBUG_PREFIXES} from './Debug.js';
25
25
  import {TimeoutError} from './Errors.js';
26
26
  import type {EventEmitter, EventType} from './EventEmitter.js';
27
27
  import type {
@@ -34,7 +34,7 @@ import {paperFormats} from './PDFOptions.js';
34
34
  /**
35
35
  * @internal
36
36
  */
37
- export const debugError = debug('puppeteer:error');
37
+ export const debugError = debug(DEBUG_PREFIXES.error);
38
38
 
39
39
  /**
40
40
  * @internal
@@ -201,6 +201,8 @@ export class ChromeLauncher extends BrowserLauncher {
201
201
  'MediaRouter',
202
202
  'OptimizationHints',
203
203
  'WebUIReloadButton',
204
+ 'WebUIOmniboxPopup',
205
+ 'WebUIOmniboxAimPopup',
204
206
  ...(turnOnExperimentalFeaturesForTesting
205
207
  ? []
206
208
  : [