chrome-devtools-frontend 1.0.1690531 → 1.0.1695017

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 (304) hide show
  1. package/.agents/skills/devtools-model-management/SKILL.md +3 -3
  2. package/.agents/skills/foundation-test-migration/SKILL.md +2 -2
  3. package/.agents/skills/merging-devtools-module/SKILL.md +5 -5
  4. package/.gitmodules +0 -4
  5. package/AUTHORS +3 -0
  6. package/config/typescript/tsconfig.base.json +1 -0
  7. package/docs/get_the_code.md +4 -9
  8. package/front_end/Images/src/comment-mode-cursor.svg +23 -0
  9. package/front_end/Tests.js +1 -1
  10. package/front_end/application_tokens.css +5 -0
  11. package/front_end/core/common/ColorConverter.ts +3 -3
  12. package/front_end/core/host/UserMetrics.ts +27 -0
  13. package/front_end/core/protocol_client/DevToolsCDPConnection.ts +0 -46
  14. package/front_end/core/protocol_client/InspectorBackend.ts +6 -6
  15. package/front_end/core/sdk/CSSLocation.ts +32 -0
  16. package/front_end/core/sdk/CSSModel.ts +2 -22
  17. package/front_end/core/sdk/CSSQuery.ts +2 -1
  18. package/front_end/core/sdk/CSSRule.ts +29 -0
  19. package/front_end/core/sdk/DebuggerModel.ts +5 -1
  20. package/front_end/core/sdk/NetworkManager.ts +2 -0
  21. package/front_end/core/sdk/NetworkRequest.ts +14 -1
  22. package/front_end/core/sdk/NetworkRequestAccess.ts +41 -22
  23. package/front_end/core/sdk/ResourceTreeModel.ts +72 -23
  24. package/front_end/core/sdk/SecurityOrigin.ts +89 -29
  25. package/front_end/core/sdk/Target.ts +18 -0
  26. package/front_end/core/sdk/sdk.ts +2 -0
  27. package/front_end/entrypoints/main/MainImpl.ts +8 -1
  28. package/front_end/foundation/Universe.ts +14 -11
  29. package/front_end/generated/Deprecation.ts +8 -0
  30. package/front_end/generated/InspectorBackendCommands.ts +9 -8
  31. package/front_end/generated/SupportedCSSProperties.ts +13 -3
  32. package/front_end/generated/protocol.ts +24 -0
  33. package/front_end/models/ai_assistance/AiAgent2.ts +42 -9
  34. package/front_end/models/ai_assistance/AiConversation.ts +6 -6
  35. package/front_end/models/ai_assistance/README.md +5 -3
  36. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +1 -0
  37. package/front_end/models/ai_assistance/agents/AiAgent.ts +28 -34
  38. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +13 -17
  39. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +5 -3
  40. package/front_end/models/ai_assistance/agents/StorageAgent.ts +16 -10
  41. package/front_end/models/ai_assistance/agents/StylingAgent.ts +3 -4
  42. package/front_end/models/ai_assistance/ai_assistance.ts +0 -2
  43. package/front_end/models/ai_assistance/contexts/AccessibilityContext.ts +11 -2
  44. package/front_end/models/ai_assistance/contexts/DOMNodeContext.ts +17 -5
  45. package/front_end/models/ai_assistance/contexts/FileContext.ts +13 -6
  46. package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +52 -25
  47. package/front_end/models/ai_assistance/contexts/RequestContext.ts +18 -34
  48. package/front_end/models/ai_assistance/contexts/StorageContext.ts +14 -3
  49. package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +2 -5
  50. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +135 -58
  51. package/front_end/models/ai_assistance/tools/CookieUtils.ts +25 -35
  52. package/front_end/models/ai_assistance/tools/DOMStorageUtils.ts +6 -3
  53. package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +9 -2
  54. package/front_end/models/ai_assistance/tools/GetCookieValues.ts +1 -1
  55. package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +3 -2
  56. package/front_end/models/ai_assistance/tools/GetFunctionCode.ts +3 -5
  57. package/front_end/models/ai_assistance/tools/GetInsightDetails.ts +1 -1
  58. package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +8 -11
  59. package/front_end/models/ai_assistance/tools/GetResourceContent.ts +2 -4
  60. package/front_end/models/ai_assistance/tools/GetSourceContent.ts +6 -13
  61. package/front_end/models/ai_assistance/tools/GetStorageBreakdown.ts +1 -1
  62. package/front_end/models/ai_assistance/tools/GetStorageValues.ts +9 -9
  63. package/front_end/models/ai_assistance/tools/GetStyles.ts +3 -2
  64. package/front_end/models/ai_assistance/tools/ListCookies.ts +1 -1
  65. package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +6 -14
  66. package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +10 -15
  67. package/front_end/models/ai_assistance/tools/ListSources.ts +5 -7
  68. package/front_end/models/ai_assistance/tools/ListStorageKeys.ts +9 -9
  69. package/front_end/models/ai_assistance/tools/README.md +4 -2
  70. package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +3 -2
  71. package/front_end/models/ai_assistance/tools/Tool.ts +27 -3
  72. package/front_end/models/comment_manager/CD4ABridge.ts +128 -0
  73. package/front_end/models/comment_manager/CommentManager.ts +50 -8
  74. package/front_end/models/comment_manager/comment_manager.ts +2 -0
  75. package/front_end/models/emulation/DeviceModeModel.ts +37 -47
  76. package/front_end/models/javascript_metadata/NativeFunctions.ts +9 -1
  77. package/front_end/models/live-metrics/web-vitals-injected/README.md +1 -1
  78. package/front_end/models/source_map_scopes/NamesResolver.ts +9 -7
  79. package/front_end/models/trace/ModelImpl.ts +2 -0
  80. package/front_end/models/trace/Processor.ts +6 -4
  81. package/front_end/models/trace/handlers/LayerTreeHandler.ts +3 -3
  82. package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +1 -1
  83. package/front_end/models/trace/helpers/SyntheticEvents.ts +23 -1
  84. package/front_end/models/trace/types/Configuration.ts +7 -0
  85. package/front_end/models/trace/types/TraceEvents.ts +20 -4
  86. package/front_end/panels/accessibility/ARIAAttributesView.ts +3 -0
  87. package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingListView.ts +177 -0
  88. package/front_end/panels/accessibility/accessibility.ts +2 -0
  89. package/front_end/panels/accessibility/accessibilityAnnouncementRecordingListView.css +33 -0
  90. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +25 -15
  91. package/front_end/panels/ai_assistance/components/ChatMessage.ts +6 -35
  92. package/front_end/panels/ai_assistance/components/DisabledWidget.ts +4 -3
  93. package/front_end/panels/animation/AnimationTimeline.ts +1 -0
  94. package/front_end/panels/application/CrashReportContextView.ts +0 -1
  95. package/front_end/panels/application/FrameDetailsView.ts +5 -4
  96. package/front_end/panels/application/IndexedDBViews.ts +4 -4
  97. package/front_end/panels/application/indexedDBViews.css +0 -14
  98. package/front_end/panels/console/ConsoleContextSelector.ts +12 -5
  99. package/front_end/panels/console/ConsoleViewMessage.ts +12 -8
  100. package/front_end/panels/coverage/coverageView.css +8 -8
  101. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +4 -5
  102. package/front_end/panels/developer_resources/developerResourcesView.css +3 -3
  103. package/front_end/panels/elements/ElementsTreeElement.ts +39 -12
  104. package/front_end/panels/elements/ElementsTreeOutline.ts +183 -107
  105. package/front_end/panels/elements/ShortcutTreeElement.ts +4 -0
  106. package/front_end/panels/elements/StylePropertiesSection.ts +1 -34
  107. package/front_end/panels/elements/components/CSSPropertyIconResolver.ts +5 -4
  108. package/front_end/panels/elements/components/StylePropertyEditor.ts +1 -0
  109. package/front_end/panels/elements/components/computedStyleProperty.css +5 -5
  110. package/front_end/panels/elements/components/computedStyleTrace.css +5 -5
  111. package/front_end/panels/elements/components/cssHintDetailsView.css +1 -1
  112. package/front_end/panels/elements/components/cssPropertyDocsView.css +3 -3
  113. package/front_end/panels/elements/components/cssVariableValueView.css +4 -4
  114. package/front_end/panels/elements/components/elementsBreadcrumbs.css +3 -3
  115. package/front_end/panels/elements/components/elementsTreeExpandButton.css +5 -5
  116. package/front_end/panels/elements/components/queryContainer.css +2 -2
  117. package/front_end/panels/elements/elementsTreeOutline.css +20 -4
  118. package/front_end/panels/event_listeners/eventListenersView.css +1 -1
  119. package/front_end/panels/issues/AffectedElementsView.ts +3 -0
  120. package/front_end/panels/issues/issues.ts +2 -0
  121. package/front_end/panels/layer_viewer/LayerDetailsView.ts +12 -10
  122. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +1 -0
  123. package/front_end/panels/layer_viewer/Layers3DView.ts +13 -11
  124. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +1 -1
  125. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspectorUtils.ts +2 -2
  126. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplayUtils.ts +1 -1
  127. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -1
  128. package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +11 -11
  129. package/front_end/panels/media/PlayerPropertiesView.ts +1 -1
  130. package/front_end/panels/media/TickingFlameChart.ts +3 -2
  131. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +2 -1
  132. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +1 -1
  133. package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +2 -1
  134. package/front_end/panels/network/NetworkLogViewColumns.ts +5 -2
  135. package/front_end/panels/network/RequestHeadersView.ts +46 -10
  136. package/front_end/panels/network/components/RequestHeadersView.css +12 -0
  137. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +3 -3
  138. package/front_end/panels/profiler/HeapProfileView.ts +1 -1
  139. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
  140. package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
  141. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +3 -3
  142. package/front_end/panels/recorder/RecordingListView.ts +0 -6
  143. package/front_end/panels/recorder/RecordingView.ts +0 -6
  144. package/front_end/panels/recorder/controlButton.css +10 -10
  145. package/front_end/panels/recorder/startView.css +1 -1
  146. package/front_end/panels/screencast/ScreencastView.ts +4 -2
  147. package/front_end/panels/search/SearchView.ts +1 -1
  148. package/front_end/panels/security/SecurityPanel.ts +46 -35
  149. package/front_end/panels/timeline/TimelineFlameChartView.ts +0 -32
  150. package/front_end/panels/timeline/TimelinePanel.ts +0 -17
  151. package/front_end/panels/timeline/components/cwvMetrics.css +2 -2
  152. package/front_end/panels/timeline/components/insights/checklist.css +1 -1
  153. package/front_end/panels/timeline/components/insights/table.css +3 -3
  154. package/front_end/panels/timeline/overlays/components/entriesLinkOverlay.css +4 -4
  155. package/front_end/panels/timeline/overlays/components/entryLabelOverlay.css +4 -4
  156. package/front_end/panels/timeline/overlays/components/timeRangeOverlay.css +2 -2
  157. package/front_end/panels/timeline/overlays/components/timespanBreakdownOverlay.css +4 -4
  158. package/front_end/panels/timeline/timelinePanel.css +0 -74
  159. package/front_end/panels/web_audio/webAudio.css +5 -5
  160. package/front_end/third_party/chromium/README.chromium +1 -1
  161. package/front_end/third_party/csp_evaluator/package/tsconfig.json +1 -0
  162. package/front_end/third_party/diff/DiffWrapper.ts +1 -8
  163. package/front_end/third_party/puppeteer/README.chromium +2 -2
  164. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +183 -4
  165. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +708 -122
  166. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +85 -3
  167. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
  168. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js +84 -11
  169. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
  170. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/ScreenRecording.d.ts +75 -0
  171. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/ScreenRecording.d.ts.map +1 -0
  172. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/ScreenRecording.js +102 -0
  173. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/ScreenRecording.js.map +1 -0
  174. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/api.d.ts +1 -0
  175. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/api.d.ts.map +1 -1
  176. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/api.js +1 -0
  177. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/api.js.map +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts +6 -1
  179. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts.map +1 -1
  180. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js +7 -0
  181. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js.map +1 -1
  182. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ScreenRecording.d.ts +31 -0
  183. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ScreenRecording.d.ts.map +1 -0
  184. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ScreenRecording.js +138 -0
  185. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ScreenRecording.js.map +1 -0
  186. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/bidi.d.ts +1 -0
  187. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/bidi.d.ts.map +1 -1
  188. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/bidi.js +1 -0
  189. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/bidi.js.map +1 -1
  190. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts +6 -0
  191. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  192. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js +23 -0
  193. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  194. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts +6 -1
  195. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts.map +1 -1
  196. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js +7 -0
  197. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js.map +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ScreenRecording.d.ts +31 -0
  199. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ScreenRecording.d.ts.map +1 -0
  200. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ScreenRecording.js +131 -0
  201. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ScreenRecording.js.map +1 -0
  202. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.d.ts +1 -0
  203. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.d.ts.map +1 -1
  204. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.js +1 -0
  205. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.js.map +1 -1
  206. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js +7 -4
  207. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js.map +1 -1
  208. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.d.ts +4 -1
  209. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.d.ts.map +1 -1
  210. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.js +5 -1
  211. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.js.map +1 -1
  212. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts +42 -0
  213. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  214. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Device.d.ts +2 -2
  215. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Device.d.ts.map +1 -1
  216. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Device.js +265 -1
  217. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Device.js.map +1 -1
  218. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts +4 -0
  219. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  220. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +24 -3
  221. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
  222. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.d.ts +23 -2
  223. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -1
  224. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.js +49 -3
  225. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
  226. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
  227. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
  228. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
  229. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts.map +1 -1
  230. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
  231. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js.map +1 -1
  232. package/front_end/third_party/puppeteer/package/lib/types.d.ts +183 -4
  233. package/front_end/third_party/puppeteer/package/package.json +4 -4
  234. package/front_end/third_party/puppeteer/package/src/api/Page.ts +143 -11
  235. package/front_end/third_party/puppeteer/package/src/api/ScreenRecording.ts +145 -0
  236. package/front_end/third_party/puppeteer/package/src/api/api.ts +1 -0
  237. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +11 -0
  238. package/front_end/third_party/puppeteer/package/src/bidi/ScreenRecording.ts +106 -0
  239. package/front_end/third_party/puppeteer/package/src/bidi/bidi.ts +1 -0
  240. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +41 -0
  241. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +11 -0
  242. package/front_end/third_party/puppeteer/package/src/cdp/ScreenRecording.ts +101 -0
  243. package/front_end/third_party/puppeteer/package/src/cdp/cdp.ts +1 -0
  244. package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +17 -9
  245. package/front_end/third_party/puppeteer/package/src/common/BrowserWebSocketTransport.ts +4 -0
  246. package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +46 -0
  247. package/front_end/third_party/puppeteer/package/src/common/Device.ts +287 -1
  248. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +30 -1
  249. package/front_end/third_party/puppeteer/package/src/node/NodeWebSocketTransport.ts +73 -2
  250. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  251. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  252. package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +194 -0
  253. package/front_end/tsconfig.json +1 -2
  254. package/front_end/ui/comments/CommentAnchorResolver.ts +8 -3
  255. package/front_end/ui/comments/CommentOverlayManager.ts +53 -12
  256. package/front_end/ui/comments/CommentsOverlayWidget.ts +3 -3
  257. package/front_end/ui/comments/CommentsStatusBarPill.ts +96 -0
  258. package/front_end/ui/comments/comments-meta.ts +21 -0
  259. package/front_end/ui/comments/comments.ts +2 -0
  260. package/front_end/ui/comments/commentsOverlay.css +22 -3
  261. package/front_end/ui/components/markdown_view/MarkdownView.ts +31 -1
  262. package/front_end/ui/kit/icons/Icon.ts +0 -1
  263. package/front_end/ui/kit/link/Link.ts +8 -1
  264. package/front_end/ui/legacy/InspectorView.ts +17 -1
  265. package/front_end/ui/legacy/SplitWidget.ts +16 -2
  266. package/front_end/ui/legacy/StatusBar.ts +78 -0
  267. package/front_end/ui/legacy/Toolbar.ts +4 -0
  268. package/front_end/ui/legacy/Treeoutline.ts +78 -11
  269. package/front_end/ui/legacy/UIUtils.ts +2 -1
  270. package/front_end/ui/legacy/ViewRegistration.ts +1 -0
  271. package/front_end/ui/legacy/components/data_grid/dataGrid.css +23 -23
  272. package/front_end/ui/legacy/components/inline_editor/PositionAreaEditor.docs.ts +83 -0
  273. package/front_end/ui/legacy/components/inline_editor/PositionAreaEditor.ts +600 -0
  274. package/front_end/ui/legacy/components/inline_editor/animationNameSwatch.css +1 -1
  275. package/front_end/ui/legacy/components/inline_editor/colorMixSwatch.css +4 -4
  276. package/front_end/ui/legacy/components/inline_editor/cssAngleSwatch.css +3 -3
  277. package/front_end/ui/legacy/components/inline_editor/inline_editor.ts +2 -0
  278. package/front_end/ui/legacy/components/inline_editor/linkSwatch.css +1 -1
  279. package/front_end/ui/legacy/components/inline_editor/positionAreaEditor.css +154 -0
  280. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +113 -51
  281. package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +10 -7
  282. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +16 -97
  283. package/front_end/ui/legacy/components/object_ui/customPreviewComponent.css +7 -3
  284. package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +1 -1
  285. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +0 -66
  286. package/front_end/ui/legacy/components/perf_ui/perf_ui.ts +0 -2
  287. package/front_end/ui/legacy/inspectorCommon.css +30 -6
  288. package/front_end/ui/legacy/legacy.ts +2 -0
  289. package/front_end/ui/legacy/statusBar.css +18 -0
  290. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  291. package/inspector_overlay/main.ts +8 -8
  292. package/mcp/mcp.ts +5 -0
  293. package/package.json +2 -9
  294. package/front_end/Images/generate-css-vars.js +0 -52
  295. package/front_end/Images/rollup.config.mjs +0 -36
  296. package/front_end/models/ai_assistance/AiOrigins.ts +0 -107
  297. package/front_end/models/live-metrics/web-vitals-injected/rollup.config.mjs +0 -20
  298. package/front_end/panels/recorder/injected/rollup.config.mjs +0 -20
  299. package/front_end/panels/timeline/EasterEgg.d.ts +0 -6
  300. package/front_end/panels/timeline/easter-egg-tsconfig.json +0 -8
  301. package/front_end/panels/timeline/enable-easter-egg.js +0 -20
  302. package/front_end/third_party/puppeteer-replay/puppeteer-replay-tsconfig.json +0 -8
  303. package/front_end/ui/legacy/components/perf_ui/BrickBreaker.ts +0 -606
  304. package/inspector_overlay/loadCSS.rollup.js +0 -29
@@ -22,12 +22,12 @@ This guide outlines the standard procedure for creating a new model or migrating
22
22
  ## 2. Build Configuration (`BUILD.gn`)
23
23
  Every model requires a `BUILD.gn` file in its directory with three specific targets:
24
24
 
25
- 1. **`devtools_module("<model_name>")`**: Lists implementation source files (`sources`) and dependencies (`deps`).
25
+ 1. **`devtools_module("<model_name>")`**: Lists implementation source files (`sources`) and TypeScript dependencies (`ts_deps`). Non-TypeScript dependencies (e.g. CSS, assets) go into `deps`.
26
26
  * **Crucial:** Do NOT include the barrel file (`<model_name>.ts`) in `sources`.
27
27
  2. **`devtools_entrypoint("bundle")`**: Defines the barrel file (`entrypoint = "<model_name>.ts"`).
28
- * **Crucial:** Must depend on the module target: `deps = [ ":<model_name>" ]`.
28
+ * **Crucial:** Must depend on the module target: `ts_deps = [ ":<model_name>" ]`.
29
29
  3. **`ts_library("unittests")`**: Lists test files and test-only dependencies.
30
- * **Crucial:** Must depend on the bundle: `deps = [ ":bundle" ]`.
30
+ * **Crucial:** Must depend on the bundle: `ts_deps = [ ":bundle" ]`.
31
31
 
32
32
  ## 3. Global Registration (Crucial)
33
33
  The build system does not auto-detect new modules. You must manually register them in **`config/gni/devtools_grd_files.gni`**:
@@ -143,13 +143,13 @@ When a module and its tests are ready, update `BUILD.gn`:
143
143
 
144
144
  devtools_foundation_module("my_module") {
145
145
  sources = [ "MyModule.ts" ]
146
- deps = [ "../../core/common:bundle" ]
146
+ ts_deps = [ "../../core/common:bundle" ]
147
147
  }
148
148
 
149
149
  devtools_foundation_module("unittests") {
150
150
  testonly = true
151
151
  sources = [ "MyModule.test.ts" ]
152
- deps = [
152
+ ts_deps = [
153
153
  ":my_module",
154
154
  "../../testing",
155
155
  ]
@@ -19,7 +19,7 @@ You will need the following information:
19
19
 
20
20
  Read the contents of the `BUILD.gn` file from both the child module and the parent module. Identify the following from the child's `BUILD.gn`:
21
21
  - The list of `sources` in the `devtools_module`.
22
- - The list of `deps` (dependencies) in the `devtools_module`.
22
+ - The list of `ts_deps` (and non-TypeScript `deps`) in the `devtools_module`.
23
23
  - The `entrypoint` for the `devtools_entrypoint("bundle")`.
24
24
 
25
25
  ### 2. Modify the Parent `BUILD.gn`
@@ -27,8 +27,8 @@ Read the contents of the `BUILD.gn` file from both the child module and the pare
27
27
  Edit the `BUILD.gn` file in the parent module's directory to incorporate the child module's configuration.
28
28
 
29
29
  1. **Add Child's Sources:** Append the list of `sources` from the child's `devtools_module` to the parent's `sources` list. Remember to maintain the relative path from the parent's directory (e.g., `extensions/ExtensionUI.ts`).
30
- 2. **Merge Dependencies:** Add the `deps` from the child's `devtools_module` to the parent's `deps` list. Remove any duplicate entries.
31
- 3. **Remove Child Bundle Dependency:** Delete the dependency on the child's bundle from the parent's `deps` list (e.g., remove `./extensions:bundle`).
30
+ 2. **Merge Dependencies:** Add the `ts_deps` from the child's `devtools_module` to the parent's `ts_deps` list (and merge any non-TypeScript `deps`). Remove any duplicate entries.
31
+ 3. **Remove Child Bundle Dependency:** Delete the dependency on the child's bundle from the parent's `ts_deps` list (e.g., remove `./extensions:bundle`).
32
32
 
33
33
  ### 3. Delete the Child `BUILD.gn`
34
34
 
@@ -63,7 +63,7 @@ devtools_module("timeline") {
63
63
  "UIDevtoolsUtils.ts",
64
64
  ]
65
65
 
66
- deps = [
66
+ ts_deps = [
67
67
  ...
68
68
  "./components:bundle",
69
69
  "./extensions:bundle",
@@ -82,7 +82,7 @@ devtools_module("timeline") {
82
82
  "extensions/ExtensionUI.ts", # Added from child
83
83
  ]
84
84
 
85
- deps = [
85
+ ts_deps = [
86
86
  ...
87
87
  "./components:bundle",
88
88
  # "./extensions:bundle", # Removed
package/.gitmodules CHANGED
@@ -1,7 +1,3 @@
1
- [submodule "test/ai_evals/eval_data"]
2
- path = test/ai_evals/eval_data
3
- url = https://chrome-internal.googlesource.com/devtools/chrome-devtools-evals
4
- gclient-condition = checkout_ai_evals == True
5
1
  [submodule "third_party/clang-format/script"]
6
2
  path = third_party/clang-format/script
7
3
  url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/clang/tools/clang-format
package/AUTHORS CHANGED
@@ -35,6 +35,7 @@ Conner Turner <cturner@zyme.xyz>
35
35
  Daniel bellfield <dnlbellfield@gmail.com>
36
36
  Danny Eldridge <me@heardanieljames.com>
37
37
  Derek Li <the.derekli@gmail.com>
38
+ Dmitry Kryaklin <dmkryak@gmail.com>
38
39
  Douglas Chiang <douglasdothnc@gmail.com>
39
40
  Dragonish <no.web.developer@outlook.com>
40
41
  Eden Wang <nedenwang@gmail.com>
@@ -79,6 +80,7 @@ Michael Rienstra <mrienstra@gmail.com>
79
80
  Mostafa Aboalkasim <mostafa.aboalkasim.offical@gmail.com>
80
81
  Muhammad Mahad <mahadtxt@gmail.com>
81
82
  Naoto Ono <onoto1998@gmail.com>
83
+ Navoda Munasinha <navoda.munasinha@codimite.com>
82
84
  Nourhan Hasan <nourhan.m.hasan@gmail.com>
83
85
  Paras Awasthi <awasthiparas6@gmail.com>
84
86
  Paul Fisher <paul@pfish.zone>
@@ -121,6 +123,7 @@ Yoichiro Hibara <hibarayoichiro871@gmail.com>
121
123
  Yoni Feigelson <yfeigelson@gmail.com>
122
124
  Young Min Kim <y@ylem.kim>
123
125
  Yuan Zhuang <joann.yuanzhuang@gmail.com>
126
+ Zuyao Chen <zuyaocat@gmail.com>
124
127
  # Please DO NOT APPEND here. See comments at the top of the file.
125
128
  # END individuals section.
126
129
 
@@ -23,6 +23,7 @@
23
23
  "preserveConstEnums": true,
24
24
  "composite": true,
25
25
  "declaration": true,
26
+ "isolatedDeclarations": true,
26
27
 
27
28
  "sourceMap": true,
28
29
  "inlineSources": true
@@ -43,17 +43,12 @@ npm run build -- -t Debug
43
43
  will build in `out/Debug` instead of `out/Default`. If the directory doesn't exist,
44
44
  it'll automatically create and initialize it.
45
45
 
46
- You can disable type checking (via TypeScript) by using the `devtools_skip_typecheck`
47
- argument in your GN configuration. This uses [esbuild](https://esbuild.github.io/)
48
- instead of `tsc` to compile the TypeScript files and generally results in much
49
- shorter build times.
50
-
51
- Additionally, we now bundle files together by default in all builds, which has
52
- a build time cost. If you want an even fast fast build, you might want to opt
53
- out of bundling by setting `devtools_bundle` to `false`
46
+ We bundle files together by default in all builds, which has a build time cost.
47
+ If you want a faster build, you can opt out of bundling by setting `devtools_bundle`
48
+ to `false`:
54
49
 
55
50
  ```bash
56
- gn gen out/Fast --args="devtools_skip_typecheck=true devtools_bundle=false"
51
+ gn gen out/Fast --args="devtools_bundle=false"
57
52
  ```
58
53
 
59
54
  and use `npm run build -- -t Fast` to build this target.
@@ -0,0 +1,23 @@
1
+ <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g filter="url(#filter0_dd_6727_40653)">
3
+ <path d="M30 18C30 12.4772 25.5228 8 20 8C14.4772 8 10 12.4772 10 18V27.2308C10 27.6556 10.3444 28 10.7692 28H20C25.5228 28 30 23.5228 30 18Z" fill="white"/>
4
+ <path d="M20 7C13.9249 7 9 11.9249 9 18V27.2305C9 28.2076 9.79241 29 10.7695 29H20C26.0751 29 31 24.0751 31 18C31 11.9249 26.0751 7 20 7Z" stroke="#0B57D0" stroke-width="2"/>
5
+ </g>
6
+ <defs>
7
+ <filter id="filter0_dd_6727_40653" x="0" y="0" width="40" height="40" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
8
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
9
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
10
+ <feMorphology radius="2" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_6727_40653"/>
11
+ <feOffset dy="2"/>
12
+ <feGaussianBlur stdDeviation="3"/>
13
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"/>
14
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_6727_40653"/>
15
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
16
+ <feOffset dy="1"/>
17
+ <feGaussianBlur stdDeviation="1"/>
18
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0"/>
19
+ <feBlend mode="normal" in2="effect1_dropShadow_6727_40653" result="effect2_dropShadow_6727_40653"/>
20
+ <feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_6727_40653" result="shape"/>
21
+ </filter>
22
+ </defs>
23
+ </svg>
@@ -550,7 +550,7 @@
550
550
  this._waitForTargets(1, callback.bind(this));
551
551
 
552
552
  function callback() {
553
- ProtocolClient.test.deprecatedRunAfterPendingDispatches(this.releaseControl.bind(this));
553
+ setTimeout(this.releaseControl.bind(this), 0);
554
554
  }
555
555
  };
556
556
 
@@ -254,6 +254,11 @@
254
254
  */
255
255
  --combobox-dropdown-arrow: var(--image-file-arrow-drop-down-light);
256
256
 
257
+ /**
258
+ * Comment mode cursor.
259
+ */
260
+ --comment-cursor: var(--image-file-comment-mode-cursor) 10 28, auto;
261
+
257
262
  &.theme-with-dark-background {
258
263
  --color-primary-old: rgb(138 180 248);
259
264
  --color-primary-variant: rgb(102 157 246);
@@ -274,9 +274,9 @@ export class ColorConverter {
274
274
  const xyzInput = new Vector3([x, y, z]);
275
275
  const lmsIntermediate = XYZ_TO_LMS_MATRIX.multiply(xyzInput);
276
276
 
277
- lmsIntermediate.values[0] = Math.pow(lmsIntermediate.values[0], 1.0 / 3.0);
278
- lmsIntermediate.values[1] = Math.pow(lmsIntermediate.values[1], 1.0 / 3.0);
279
- lmsIntermediate.values[2] = Math.pow(lmsIntermediate.values[2], 1.0 / 3.0);
277
+ lmsIntermediate.values[0] = Math.cbrt(lmsIntermediate.values[0]);
278
+ lmsIntermediate.values[1] = Math.cbrt(lmsIntermediate.values[1]);
279
+ lmsIntermediate.values[2] = Math.cbrt(lmsIntermediate.values[2]);
280
280
 
281
281
  const labOutput = LMS_TO_OKLAB_MATRIX.multiply(lmsIntermediate);
282
282
  return [labOutput.values[0], labOutput.values[1], labOutput.values[2]];
@@ -265,6 +265,31 @@ export class UserMetrics {
265
265
  InspectorFrontendHostInstance.recordPerformanceHistogram('DevTools.Insights.ShortTeaserGenerationTime',
266
266
  timeInMilliseconds);
267
267
  }
268
+
269
+ changeRecorded(count: number): void {
270
+ InspectorFrontendHostInstance.recordCountHistogram('DevTools.Comments.ChangeRecorded', count, 1, 100, 50);
271
+ }
272
+
273
+ changeSharedWithAgent(count: number): void {
274
+ InspectorFrontendHostInstance.recordCountHistogram('DevTools.Comments.ChangeSharedWithAgent', count, 1, 100, 50);
275
+ }
276
+
277
+ commentCreated(count: number): void {
278
+ InspectorFrontendHostInstance.recordCountHistogram('DevTools.Comments.CommentCreated', count, 1, 100, 50);
279
+ }
280
+
281
+ commentResolved(resolver: CommentResolver, count: number): void {
282
+ InspectorFrontendHostInstance.recordCountHistogram(`DevTools.Comments.CommentResolvedBy${resolver}`, count, 1, 100,
283
+ 50);
284
+ }
285
+
286
+ commentSharedWithAgent(count: number): void {
287
+ InspectorFrontendHostInstance.recordCountHistogram('DevTools.Comments.CommentSharedWithAgent', count, 1, 100, 50);
288
+ }
289
+
290
+ commentSize(characters: number): void {
291
+ InspectorFrontendHostInstance.recordCountHistogram('DevTools.Comments.CommentSize', characters, 1, 100_000, 50);
292
+ }
268
293
  }
269
294
 
270
295
  /**
@@ -493,3 +518,5 @@ export function resendRequestType(resourceType: Common.ResourceType.ResourceType
493
518
  const key = resendRequestTypeMap.get(resourceType);
494
519
  return (key ? ResendRequestType[key] : undefined) ?? ResendRequestType.OTHER;
495
520
  }
521
+
522
+ export type CommentResolver = 'Agent'|'User';
@@ -25,21 +25,15 @@ interface CallbackWithDebugInfo {
25
25
 
26
26
  type Callback = (error: MessageError|null, arg1: Object|null) => void;
27
27
 
28
- const LongPollingMethods = new Set<string>(['CSS.takeComputedStyleUpdates']);
29
-
30
28
  export class DevToolsCDPConnection implements CDPConnection {
31
29
  readonly #transport: ConnectionTransport;
32
30
  #lastMessageId = 1;
33
- #pendingResponsesCount = 0;
34
- readonly #pendingLongPollingMessageIds = new Set<number>();
35
- #pendingScripts: Array<() => void> = [];
36
31
  readonly #callbacks = new Map<number, CallbackWithDebugInfo>();
37
32
  readonly #observers = new Set<CDPConnectionObserver>();
38
33
 
39
34
  constructor(transport: ConnectionTransport) {
40
35
  this.#transport = transport;
41
36
 
42
- test.deprecatedRunAfterPendingDispatches = this.deprecatedRunAfterPendingDispatches.bind(this);
43
37
  test.sendRawMessage = this.sendRawMessageForTesting.bind(this);
44
38
 
45
39
  this.#transport.setOnMessage(this.onMessage.bind(this));
@@ -81,11 +75,6 @@ export class DevToolsCDPConnection implements CDPConnection {
81
75
  test.onMessageSent({domain, method, params: (paramsObject as Object), id: messageId, sessionId});
82
76
  }
83
77
 
84
- ++this.#pendingResponsesCount;
85
- if (LongPollingMethods.has(method)) {
86
- this.#pendingLongPollingMessageIds.add(messageId);
87
- }
88
-
89
78
  return new Promise(resolve => {
90
79
  this.#callbacks.set(messageId, {resolve, method, sessionId});
91
80
  this.#transport.sendRawMessage(JSON.stringify(messageObject));
@@ -147,45 +136,10 @@ export class DevToolsCDPConnection implements CDPConnection {
147
136
  }
148
137
 
149
138
  callback.resolve(messageObject);
150
- --this.#pendingResponsesCount;
151
- this.#pendingLongPollingMessageIds.delete(messageObject.id);
152
-
153
- if (this.#pendingScripts.length && !this.hasOutstandingNonLongPollingRequests()) {
154
- this.deprecatedRunAfterPendingDispatches();
155
- }
156
139
  } else if ('method' in messageObject) {
157
140
  this.#observers.forEach(observer => observer.onEvent(messageObject));
158
141
  } else {
159
142
  InspectorBackend.reportProtocolError('Protocol Error: the message without method', messageObject);
160
143
  }
161
144
  }
162
-
163
- private hasOutstandingNonLongPollingRequests(): boolean {
164
- return this.#pendingResponsesCount - this.#pendingLongPollingMessageIds.size > 0;
165
- }
166
-
167
- private deprecatedRunAfterPendingDispatches(script?: (() => void)): void {
168
- if (script) {
169
- this.#pendingScripts.push(script);
170
- }
171
-
172
- // Execute all promises.
173
- setTimeout(() => {
174
- if (!this.hasOutstandingNonLongPollingRequests()) {
175
- this.executeAfterPendingDispatches();
176
- } else {
177
- this.deprecatedRunAfterPendingDispatches();
178
- }
179
- }, 0);
180
- }
181
-
182
- private executeAfterPendingDispatches(): void {
183
- if (!this.hasOutstandingNonLongPollingRequests()) {
184
- const scripts = this.#pendingScripts;
185
- this.#pendingScripts = [];
186
- for (let id = 0; id < scripts.length; ++id) {
187
- scripts[id]();
188
- }
189
- }
190
- }
191
145
  }
@@ -153,12 +153,6 @@ export const test = {
153
153
  */
154
154
  dumpProtocol: null as ((arg0: string) => void) | null,
155
155
 
156
- /**
157
- * Runs a function when no protocol activity is present.
158
- * ProtocolClient.test.deprecatedRunAfterPendingDispatches(() => console.log('done'))
159
- */
160
- deprecatedRunAfterPendingDispatches: null as ((arg0: () => void) => void) | null,
161
-
162
156
  /**
163
157
  * Sends a raw message over main connection.
164
158
  * ProtocolClient.test.sendRawMessage('Page.enable', {}, console.log)
@@ -181,6 +175,12 @@ export const test = {
181
175
  * Set to get notified about any messages received over protocol.
182
176
  */
183
177
  onMessageReceived: null as ((message: Object) => void) | null,
178
+
179
+ /**
180
+ * Runs a function when no protocol activity is present.
181
+ * ProtocolClient.test.deprecatedRunAfterPendingDispatches(() => console.log('done'))
182
+ */
183
+ deprecatedRunAfterPendingDispatches: null as ((arg0: () => void) => void) | null,
184
184
  };
185
185
 
186
186
  export class SessionRouter implements CDPConnectionObserver {
@@ -0,0 +1,32 @@
1
+ // Copyright 2026 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import type * as Protocol from '../../generated/protocol.js';
6
+ import type * as Platform from '../platform/platform.js';
7
+
8
+ import type {CSSModel} from './CSSModel.js';
9
+ import type {CSSStyleSheetHeader} from './CSSStyleSheetHeader.js';
10
+
11
+ export class CSSLocation {
12
+ readonly #cssModel: CSSModel;
13
+ styleSheetId: Protocol.DOM.StyleSheetId;
14
+ url: Platform.DevToolsPath.UrlString;
15
+ lineNumber: number;
16
+ columnNumber: number;
17
+ constructor(header: CSSStyleSheetHeader, lineNumber: number, columnNumber?: number) {
18
+ this.#cssModel = header.cssModel();
19
+ this.styleSheetId = header.id;
20
+ this.url = header.resourceURL();
21
+ this.lineNumber = lineNumber;
22
+ this.columnNumber = columnNumber || 0;
23
+ }
24
+
25
+ cssModel(): CSSModel {
26
+ return this.#cssModel;
27
+ }
28
+
29
+ header(): CSSStyleSheetHeader|null {
30
+ return this.#cssModel.styleSheetHeaderForId(this.styleSheetId);
31
+ }
32
+ }
@@ -11,6 +11,7 @@ import * as Root from '../root/root.js';
11
11
  import * as TextUtils from '../text_utils/text_utils.js';
12
12
 
13
13
  import {CSSFontFace} from './CSSFontFace.js';
14
+ import {CSSLocation} from './CSSLocation.js';
14
15
  import {CSSMatchedStyles} from './CSSMatchedStyles.js';
15
16
  import {CSSMedia} from './CSSMedia.js';
16
17
  import {cssMetadata} from './CSSMetadata.js';
@@ -1052,28 +1053,7 @@ export class Edit {
1052
1053
  }
1053
1054
  }
1054
1055
 
1055
- export class CSSLocation {
1056
- readonly #cssModel: CSSModel;
1057
- styleSheetId: Protocol.DOM.StyleSheetId;
1058
- url: Platform.DevToolsPath.UrlString;
1059
- lineNumber: number;
1060
- columnNumber: number;
1061
- constructor(header: CSSStyleSheetHeader, lineNumber: number, columnNumber?: number) {
1062
- this.#cssModel = header.cssModel();
1063
- this.styleSheetId = header.id;
1064
- this.url = header.resourceURL();
1065
- this.lineNumber = lineNumber;
1066
- this.columnNumber = columnNumber || 0;
1067
- }
1068
-
1069
- cssModel(): CSSModel {
1070
- return this.#cssModel;
1071
- }
1072
-
1073
- header(): CSSStyleSheetHeader|null {
1074
- return this.#cssModel.styleSheetHeaderForId(this.styleSheetId);
1075
- }
1076
- }
1056
+ export {CSSLocation};
1077
1057
 
1078
1058
  class CSSDispatcher implements ProtocolProxyApi.CSSDispatcher {
1079
1059
  readonly #cssModel: CSSModel;
@@ -5,7 +5,8 @@
5
5
  import type * as Protocol from '../../generated/protocol.js';
6
6
  import type * as TextUtils from '../text_utils/text_utils.js';
7
7
 
8
- import {CSSLocation, type CSSModel, type Edit} from './CSSModel.js';
8
+ import {CSSLocation} from './CSSLocation.js';
9
+ import type {CSSModel, Edit} from './CSSModel.js';
9
10
  import type {CSSStyleSheetHeader} from './CSSStyleSheetHeader.js';
10
11
 
11
12
  type CSSQueryPayload =
@@ -231,6 +231,35 @@ export class CSSStyleRule extends CSSRule {
231
231
 
232
232
  super.rebase(edit);
233
233
  }
234
+
235
+ constructResolvedSelector(nestingIndex?: number): string|undefined {
236
+ const nestingSelectors = this.nestingSelectors;
237
+ if (!nestingSelectors) {
238
+ return nestingIndex === undefined ? this.selectorText() : undefined;
239
+ }
240
+
241
+ if (nestingIndex !== undefined && (nestingIndex < 0 || nestingIndex >= nestingSelectors.length)) {
242
+ return undefined;
243
+ }
244
+
245
+ const selectorText = nestingIndex !== undefined ? nestingSelectors[nestingIndex] : this.selectorText();
246
+
247
+ const parentIndex = nestingIndex !== undefined ? nestingIndex + 1 : 0;
248
+ const parentSelector = this.constructResolvedSelector(parentIndex);
249
+
250
+ if (!parentSelector) {
251
+ return selectorText;
252
+ }
253
+
254
+ // Strip pseudo-elements (e.g. ::before) because pseudo-elements are invalid inside CSS :is(...).
255
+ const sanitizedParent = parentSelector.replace(/::[a-zA-Z-]+/g, '').trim();
256
+
257
+ if (selectorText.includes('&')) {
258
+ return selectorText.replaceAll('&', `:is(${sanitizedParent})`);
259
+ }
260
+
261
+ return `:is(${sanitizedParent}) ${selectorText.trim()}`;
262
+ }
234
263
  }
235
264
 
236
265
  export class CSSPropertyRule extends CSSRule {
@@ -1473,8 +1473,12 @@ export class Scope implements ScopeChainEntry {
1473
1473
  return undefined;
1474
1474
  }
1475
1475
 
1476
+ empty(): boolean {
1477
+ return Boolean(this.#payload.empty);
1478
+ }
1479
+
1476
1480
  extraProperties(): RemoteObjectProperty[] {
1477
- if (this.#ordinal !== 0 || this.#type !== Protocol.Debugger.ScopeType.Local || this.#callFrame.script.isWasm()) {
1481
+ if (this !== this.#callFrame.localScope() || this.#callFrame.script.isWasm()) {
1478
1482
  return [];
1479
1483
  }
1480
1484
 
@@ -1014,6 +1014,8 @@ export class NetworkDispatcher implements ProtocolProxyApi.NetworkDispatcher {
1014
1014
  }
1015
1015
  requestToManagerMap.set(networkRequest, this.#manager);
1016
1016
  }
1017
+ networkRequest.setCacheDisabled(
1018
+ this.#manager.target().targetManager().settings.resolve(cacheDisabledSettingDescriptor).get());
1017
1019
  networkRequest.hasNetworkData = true;
1018
1020
  this.updateNetworkRequestWithRequest(networkRequest, request);
1019
1021
  networkRequest.setIssueTime(timestamp, wallTime);
@@ -178,6 +178,7 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
178
178
  #endTime = -1;
179
179
  #blockedReason: Protocol.Network.BlockedReason|undefined = undefined;
180
180
  #renderBlockingBehavior?: Protocol.Network.RenderBlockingBehavior;
181
+ #initiatorSecurityOrigin?: SecurityOrigin;
181
182
  #corsErrorStatus: Protocol.Network.CorsErrorStatus|undefined = undefined;
182
183
  statusCode = 0;
183
184
  statusText = '';
@@ -248,6 +249,7 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
248
249
  #fromMemoryCache?: boolean;
249
250
  #fromDiskCache?: boolean;
250
251
  #fromPrefetchCache?: boolean;
252
+ #cacheDisabled = false;
251
253
  #fromEarlyHints?: boolean;
252
254
  #fetchedViaServiceWorker?: boolean;
253
255
  #serviceWorkerRouterInfo?: Protocol.Network.ServiceWorkerRouterInfo;
@@ -423,7 +425,10 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
423
425
  * @see {@link requestURLSecurityOrigin} to obtain the origin of the target resource URL being requested.
424
426
  */
425
427
  initiatorSecurityOrigin(): SecurityOrigin {
426
- return this.#resolveSecurityOrigin(this.#documentURL);
428
+ if (!this.#initiatorSecurityOrigin) {
429
+ this.#initiatorSecurityOrigin = this.#resolveSecurityOrigin(this.#documentURL);
430
+ }
431
+ return this.#initiatorSecurityOrigin;
427
432
  }
428
433
 
429
434
  #resolveSecurityOrigin(url: Platform.DevToolsPath.UrlString): SecurityOrigin {
@@ -727,6 +732,14 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
727
732
  this.#fromPrefetchCache = true;
728
733
  }
729
734
 
735
+ cacheDisabled(): boolean {
736
+ return this.#cacheDisabled;
737
+ }
738
+
739
+ setCacheDisabled(cacheDisabled: boolean): void {
740
+ this.#cacheDisabled = cacheDisabled;
741
+ }
742
+
730
743
  fromEarlyHints(): boolean {
731
744
  return Boolean(this.#fromEarlyHints);
732
745
  }
@@ -48,11 +48,24 @@ export const CORS_SAFELISTED_RESPONSE_HEADERS: ReadonlySet<string> = new Set([
48
48
  export const REDACTED_RESPONSE_BODY = '<redacted cross-origin response body>';
49
49
 
50
50
  /**
51
- * Returns whether a network request used credentials (cookies, authorization headers,
52
- * or server-indicated credentials mode).
51
+ * Returns whether a network request was made with credentials (cookies or authorization headers)
52
+ * or received `Set-Cookie` in the response.
53
+ *
54
+ * NOTE: The response header `Access-Control-Allow-Credentials: true` is sent by the server
55
+ * to grant permission for credentialed CORS; it is not a credential sent by the client.
56
+ *
57
+ * Example:
58
+ * If a page makes an uncredentialed request:
59
+ * `fetch('https://api.example.com/data', {credentials: 'omit'})`
60
+ * And the server responds with:
61
+ * `Access-Control-Allow-Origin: *`
62
+ * `Access-Control-Allow-Credentials: true`
63
+ * The browser allows the page to read the response under `*` because the client sent no cookies or auth.
64
+ * If we treated `Access-Control-Allow-Credentials: true` as a credential here, we would falsely mark
65
+ * this request as credentialed and reject the wildcard `*`.
53
66
  *
54
67
  * @param request The network request to inspect.
55
- * @returns True if the request included credentials or requires credentialed CORS.
68
+ * @returns True if the request or response carried authentication credentials or cookies.
56
69
  * @see https://fetch.spec.whatwg.org/#credentials
57
70
  */
58
71
  export function isRequestCredentialed(request: NetworkRequest.NetworkRequest): boolean {
@@ -61,45 +74,40 @@ export function isRequestCredentialed(request: NetworkRequest.NetworkRequest): b
61
74
  );
62
75
  const hasCookies = request.includedRequestCookies().length > 0 || request.responseCookies.length > 0 ||
63
76
  Boolean(request.requestHeaderValue('cookie')) || Boolean(request.responseHeaderValue('set-cookie'));
64
- const hasAllowCredentials =
65
- request.responseHeaderValue('access-control-allow-credentials')?.trim().toLowerCase() === 'true';
66
77
 
67
- return hasAuthHeaders || hasCookies || hasAllowCredentials;
78
+ return hasAuthHeaders || hasCookies;
68
79
  }
69
80
 
70
81
  /**
71
82
  * Evaluates the response access mode for a network request relative to an initiator origin.
72
83
  *
73
84
  * Evaluation rules:
74
- * 1. If `initiatorOrigin` is omitted, the origin is derived from `request.documentURL`. If
75
- * `documentURL` is invalid or opaque, access mode defaults to `OPAQUE_CROSS_ORIGIN`.
76
- * 2. If the initiator origin is opaque (e.g. sandboxed iframe or `data:` URL), returns `OPAQUE_CROSS_ORIGIN`.
77
- * 3. If the initiator origin is same-origin with the request URL, returns `SAME_ORIGIN`.
78
- * 4. If Chrome's network stack flagged a CORS error (`corsErrorStatus`), returns `OPAQUE_CROSS_ORIGIN`.
79
- * 5. If the server provided an `Access-Control-Allow-Origin` header:
85
+ * 1. If the initiator security origin is opaque (e.g. sandboxed iframe or `data:` URL), returns `OPAQUE_CROSS_ORIGIN`.
86
+ * 2. If the initiator security origin is same-origin with the request URL, returns `SAME_ORIGIN`.
87
+ * 3. If Chrome's network stack flagged a CORS error (`corsErrorStatus`), returns `OPAQUE_CROSS_ORIGIN`.
88
+ * 4. If the server provided an `Access-Control-Allow-Origin` header:
80
89
  * - Wildcard `*` grants `CORS_ALLOWED` only if the request does not include credentials. Under the
81
90
  * Fetch specification, wildcard `*` is invalid for credentialed requests.
82
- * - An explicit match against the initiator origin grants `CORS_ALLOWED`.
83
- * 6. Otherwise, returns `OPAQUE_CROSS_ORIGIN`.
91
+ * - An explicit match against the initiator origin grants `CORS_ALLOWED` if uncredentialed, or if
92
+ * `Access-Control-Allow-Credentials: true` is also present for credentialed requests.
93
+ * 5. Otherwise, returns `OPAQUE_CROSS_ORIGIN`.
84
94
  *
85
95
  * @param request The network request being inspected.
86
- * @param initiatorOrigin The security origin of the initiating context (e.g. page or conversation origin).
96
+ * @param initiatorSecurityOrigin The security origin of the initiating context (e.g. page or conversation origin).
87
97
  * @returns The evaluated `ResponseAccessMode`.
88
98
  */
89
99
  export function evaluateResponseAccessMode(
90
100
  request: NetworkRequest.NetworkRequest,
91
- initiatorOrigin?: SecurityOrigin.SecurityOrigin,
101
+ initiatorSecurityOrigin: SecurityOrigin.SecurityOrigin,
92
102
  ): ResponseAccessMode {
93
- const effectiveInitiatorOrigin = initiatorOrigin ?? SecurityOrigin.SecurityOrigin.create(request.documentURL);
94
-
95
103
  // Opaque initiator contexts (e.g. data: URLs, sandboxed iframes) are never permitted
96
104
  // to inspect cross-origin response content.
97
- if (effectiveInitiatorOrigin.isOpaque()) {
105
+ if (initiatorSecurityOrigin.isOpaque()) {
98
106
  return ResponseAccessMode.OPAQUE_CROSS_ORIGIN;
99
107
  }
100
108
 
101
- const resourceOrigin = SecurityOrigin.SecurityOrigin.create(request.url());
102
- if (effectiveInitiatorOrigin.isSameOriginWith(resourceOrigin)) {
109
+ const resourceOrigin = request.requestURLSecurityOrigin();
110
+ if (initiatorSecurityOrigin.isSameOriginWith(resourceOrigin)) {
103
111
  return ResponseAccessMode.SAME_ORIGIN;
104
112
  }
105
113
 
@@ -121,7 +129,18 @@ export function evaluateResponseAccessMode(
121
129
  return ResponseAccessMode.CORS_ALLOWED;
122
130
  }
123
131
 
124
- if (allowOriginHeader.toLowerCase() === effectiveInitiatorOrigin.siteId().toLowerCase()) {
132
+ const allowedOrigin = SecurityOrigin.SecurityOrigin.create(allowOriginHeader);
133
+ if (initiatorSecurityOrigin.isSameOriginWith(allowedOrigin)) {
134
+ // Under the WHATWG Fetch specification (§ 3.2.5), when a request includes
135
+ // credentials (cookies or authorization headers), the response is only exposed
136
+ // if the server explicitly includes Access-Control-Allow-Credentials: true.
137
+ if (isCredentialed) {
138
+ const allowCredentials =
139
+ request.responseHeaderValue('access-control-allow-credentials')?.trim().toLowerCase() === 'true';
140
+ if (!allowCredentials) {
141
+ return ResponseAccessMode.OPAQUE_CROSS_ORIGIN;
142
+ }
143
+ }
125
144
  return ResponseAccessMode.CORS_ALLOWED;
126
145
  }
127
146