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
@@ -18,7 +18,7 @@
18
18
  color: var(--sys-color-on-surface);
19
19
  display: flex;
20
20
  flex-direction: column;
21
- overflow-x: auto;
21
+ overflow: auto hidden;
22
22
  }
23
23
 
24
24
  .object-properties-section li,
@@ -495,10 +495,6 @@ export class FlameChart extends FlameChartBase implements NetworkTimeCalculator.
495
495
  }
496
496
  }
497
497
 
498
- getBarHeight(): number {
499
- return this.barHeight;
500
- }
501
-
502
498
  setBarHeight(value: number): void {
503
499
  this.barHeight = value;
504
500
  }
@@ -1654,60 +1650,6 @@ export class FlameChart extends FlameChartBase implements NetworkTimeCalculator.
1654
1650
  this.canvas.addEventListener(eventName, onEvent);
1655
1651
  }
1656
1652
 
1657
- drawTrackOnCanvas(trackName: string, context: CanvasRenderingContext2D, minWidth: number):
1658
- {top: number, height: number, visibleEntries: Set<number>}|null {
1659
- const timelineData = this.timelineData();
1660
- if (!timelineData) {
1661
- return null;
1662
- }
1663
- const canvasWidth = this.offsetWidth;
1664
- const canvasHeight = this.offsetHeight;
1665
- context.save();
1666
- const ratio = window.devicePixelRatio;
1667
- context.scale(ratio, ratio);
1668
- context.fillStyle = 'rgba(0, 0, 0, 0)';
1669
- context.fillRect(0, 0, canvasWidth, canvasHeight);
1670
- context.font = this.#font;
1671
-
1672
- const groups = this.rawTimelineData?.groups || [];
1673
- const groupOffsets = this.groupOffsets;
1674
- if (!groups.length || !groupOffsets) {
1675
- return null;
1676
- }
1677
- const trackIndex = groups.findIndex(g => g.name.includes(trackName));
1678
- if (trackIndex < 0) {
1679
- return null;
1680
- }
1681
- this.scrollGroupIntoView(trackIndex);
1682
- const group = groups[trackIndex];
1683
- const startLevel = group.startLevel;
1684
- const endLevel = groups[trackIndex + 1].startLevel;
1685
- const groupTop = groupOffsets[trackIndex];
1686
- const nextOffset = groupOffsets[trackIndex + 1];
1687
-
1688
- const {drawBatches, titleIndices} = this.getDrawBatches(context, timelineData);
1689
-
1690
- const entryIndexIsInTrack = (index: number): boolean => {
1691
- const barWidth = Math.min(this.#eventBarWidth(timelineData, index), canvasWidth);
1692
- return timelineData.entryLevels[index] >= startLevel && timelineData.entryLevels[index] < endLevel &&
1693
- barWidth > minWidth;
1694
- };
1695
- let allFilteredIndexes: number[] = [];
1696
- for (const [{color, outline}, {indexes}] of drawBatches) {
1697
- const filteredIndexes = indexes.filter(entryIndexIsInTrack);
1698
- allFilteredIndexes = [...allFilteredIndexes, ...filteredIndexes];
1699
- this.#drawBatchEvents(context, timelineData, color, filteredIndexes, outline);
1700
- }
1701
- const filteredTitleIndices = titleIndices.filter(entryIndexIsInTrack);
1702
- this.drawEventTitles(context, timelineData, filteredTitleIndices, canvasWidth);
1703
- context.restore();
1704
- return {
1705
- top: groupOffsets[trackIndex],
1706
- height: nextOffset - groupTop,
1707
- visibleEntries: new Set(allFilteredIndexes),
1708
- };
1709
- }
1710
-
1711
1653
  private handleKeyboardGroupNavigation(event: Event): boolean {
1712
1654
  const keyboardEvent = (event as KeyboardEvent);
1713
1655
  let handled = false;
@@ -2595,14 +2537,6 @@ export class FlameChart extends FlameChartBase implements NetworkTimeCalculator.
2595
2537
  return barHeight;
2596
2538
  }
2597
2539
 
2598
- entryWidth(entryIndex: number): number {
2599
- const timelineData = this.timelineData();
2600
- if (!timelineData) {
2601
- return 0;
2602
- }
2603
- return this.#eventBarWidth(timelineData, entryIndex);
2604
- }
2605
-
2606
2540
  #eventBarWidth(timelineData: FlameChartTimelineData, entryIndex: number): number {
2607
2541
  const {entryTotalTimes, entryStartTimes} = timelineData;
2608
2542
  const duration = entryTotalTimes[entryIndex];
@@ -2,7 +2,6 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- import * as BrickBreaker from './BrickBreaker.js';
6
5
  import * as ChartViewport from './ChartViewport.js';
7
6
  import * as FilmStripView from './FilmStripView.js';
8
7
  import * as FlameChart from './FlameChart.js';
@@ -17,7 +16,6 @@ import * as TimelineOverviewCalculator from './TimelineOverviewCalculator.js';
17
16
  import * as TimelineOverviewPane from './TimelineOverviewPane.js';
18
17
 
19
18
  export {
20
- BrickBreaker,
21
19
  ChartViewport,
22
20
  FilmStripView,
23
21
  FlameChart,
@@ -766,12 +766,6 @@ devtools-toolbar {
766
766
  padding: 0 var(--sys-size-1);
767
767
  }
768
768
 
769
- devtools-adorner.fix-perf-icon {
770
- --override-adorner-text-color: transparent;
771
- --override-adorner-border-color: transparent;
772
- --override-adorner-background-color: transparent;
773
- }
774
-
775
769
  devtools-issue-counter.main-toolbar {
776
770
  margin-left: var(--sys-size-1);
777
771
  margin-right: var(--sys-size-1);
@@ -1306,9 +1300,39 @@ devtools-toolbar {
1306
1300
  display: inline-flex;
1307
1301
  align-items: center;
1308
1302
  justify-content: center;
1303
+ font: inherit;
1304
+ font-size: var(--sys-typescale-body4-size);
1309
1305
  gap: var(--sys-size-3);
1310
1306
  padding: var(--sys-size-1) var(--sys-size-3) var(--sys-size-1) var(--sys-size-4);
1311
1307
  border-radius: var(--sys-shape-corner-extra-small);
1312
1308
  border: var(--sys-size-1) solid var(--sys-color-neutral-outline);
1313
1309
  box-sizing: border-box;
1310
+ background: transparent;
1311
+ color: inherit;
1312
+ cursor: pointer;
1313
+
1314
+ &:hover:not(:disabled, [aria-disabled="true"]) {
1315
+ background-color: var(--sys-color-state-hover-on-subtle);
1316
+ }
1317
+
1318
+ &:active:not(:disabled, [aria-disabled="true"]),
1319
+ &[aria-pressed="true"]:not(:disabled, [aria-disabled="true"]) {
1320
+ background-color: var(--sys-color-state-ripple-neutral-on-subtle);
1321
+ }
1322
+
1323
+ &:focus:not(:focus-visible) {
1324
+ outline: none;
1325
+ }
1326
+
1327
+ &:focus-visible:not(:disabled, [aria-disabled="true"]) {
1328
+ outline: var(--sys-size-2) solid var(--sys-color-state-focus-ring);
1329
+ outline-offset: var(--sys-size-2);
1330
+ }
1331
+
1332
+ &:disabled,
1333
+ &[aria-disabled="true"] {
1334
+ color: var(--sys-color-state-disabled);
1335
+ border-color: var(--sys-color-state-disabled);
1336
+ cursor: not-allowed;
1337
+ }
1314
1338
  }
@@ -42,6 +42,7 @@ import * as SoftContextMenu from './SoftContextMenu.js';
42
42
  import * as SoftDropDown from './SoftDropDown.js';
43
43
  import * as SplitWidget from './SplitWidget.js';
44
44
  import * as StackedPane from './StackedPane.js';
45
+ import * as StatusBar from './StatusBar.js';
45
46
  import * as SuggestBox from './SuggestBox.js';
46
47
  import * as TabbedPane from './TabbedPane.js';
47
48
  import * as TargetCrashedScreen from './TargetCrashedScreen.js';
@@ -98,6 +99,7 @@ export {
98
99
  SoftDropDown,
99
100
  SplitWidget,
100
101
  StackedPane,
102
+ StatusBar,
101
103
  SuggestBox,
102
104
  TabbedPane,
103
105
  TargetCrashedScreen,
@@ -0,0 +1,18 @@
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
+ @scope to (devtools-widget > *) {
6
+ :scope {
7
+ flex: none;
8
+ }
9
+
10
+ .status-bar {
11
+ display: flex;
12
+ padding: var(--sys-size-4) var(--sys-size-5);
13
+ justify-content: space-between;
14
+ align-items: center;
15
+ border-top: var(--sys-size-1) solid var(--sys-color-divider);
16
+ background: var(--sys-color-cdt-base-container);
17
+ }
18
+ }
@@ -914,6 +914,7 @@ export const knownContextValues: Set<string> = new Set([
914
914
  'command',
915
915
  'command-editor',
916
916
  'command-input',
917
+ 'comments-status-bar-pill',
917
918
  'comments.toggle-comment-mode',
918
919
  'commit',
919
920
  'compatibility-lookup-link',
@@ -1782,6 +1783,7 @@ export const knownContextValues: Set<string> = new Set([
1782
1783
  'flex-wrap',
1783
1784
  'flex-wrap-nowrap',
1784
1785
  'flex-wrap-wrap',
1786
+ 'flex-wrap-wrap-reverse',
1785
1787
  'flexbox-overlays',
1786
1788
  'float',
1787
1789
  'float-32-bit',
@@ -2,34 +2,34 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- // @ts-expect-error Importing CSS is handled in Rollup.
5
+ // @ts-expect-error Importing CSS is handled during bundling.
6
6
  import commonStyle from './common.css';
7
7
  import {adoptStyleSheet} from './common.js';
8
8
  import {gridStyle} from './highlight_grid_common.js';
9
- // @ts-expect-error Importing CSS is handled in Rollup.
9
+ // @ts-expect-error Importing CSS is handled during bundling.
10
10
  import greenDevAnchorsStyle from './tool_green_dev_anchors.css';
11
11
  import {
12
12
  type GreenDevAnchorsDispatchMessage,
13
13
  GreenDevAnchorsOverlay,
14
14
  type GreenDevAnchorsToolMessage,
15
15
  } from './tool_green_dev_anchors.js';
16
- // @ts-expect-error Importing CSS is handled in Rollup.
16
+ // @ts-expect-error Importing CSS is handled during bundling.
17
17
  import highlightGridStyle from './tool_grid.css';
18
- // @ts-expect-error Importing CSS is handled in Rollup.
18
+ // @ts-expect-error Importing CSS is handled during bundling.
19
19
  import highlightStyle from './tool_highlight.css';
20
20
  import {HighlightOverlay} from './tool_highlight.js';
21
- // @ts-expect-error Importing CSS is handled in Rollup.
21
+ // @ts-expect-error Importing CSS is handled during bundling.
22
22
  import pausedStyle from './tool_paused.css';
23
23
  import {PausedOverlay, type PausedToolMessage} from './tool_paused.js';
24
24
  import {PersistentOverlay, type PersistentToolMessage} from './tool_persistent.js';
25
- // @ts-expect-error Importing CSS is handled in Rollup.
25
+ // @ts-expect-error Importing CSS is handled during bundling.
26
26
  import screenshotStyle from './tool_screenshot.css';
27
27
  import {ScreenshotOverlay, type ScreenshotToolMessage} from './tool_screenshot.js';
28
- // @ts-expect-error Importing CSS is handled in Rollup.
28
+ // @ts-expect-error Importing CSS is handled during bundling.
29
29
  import sourceOrderStyle from './tool_source_order.css';
30
30
  import {SourceOrderOverlay} from './tool_source_order.js';
31
31
  import {ViewportSizeOverlay} from './tool_viewport_size.js';
32
- // @ts-expect-error Importing CSS is handled in Rollup.
32
+ // @ts-expect-error Importing CSS is handled during bundling.
33
33
  import wcoStyle from './tool_window_controls.css';
34
34
  import {WindowControlsOverlay} from './tool_window_controls.js';
35
35
 
package/mcp/mcp.ts CHANGED
@@ -15,7 +15,12 @@ export type * as CDPConnection from '../front_end/core/protocol_client/CDPConnec
15
15
  export {ConnectionTransport} from '../front_end/core/protocol_client/ConnectionTransport.js';
16
16
  export * as ProtocolClient from '../front_end/core/protocol_client/protocol_client.js';
17
17
  export {PuppeteerDevToolsConnection} from '../front_end/core/protocol_client/PuppeteerDevToolsConnection.js';
18
+ export * as CSSMatchedStyles from '../front_end/core/sdk/CSSMatchedStyles.js';
19
+ export * as CSSMetadata from '../front_end/core/sdk/CSSMetadata.js';
18
20
  export * as CSSModel from '../front_end/core/sdk/CSSModel.js';
21
+ export * as CSSProperty from '../front_end/core/sdk/CSSProperty.js';
22
+ export * as CSSRule from '../front_end/core/sdk/CSSRule.js';
23
+ export * as CSSStyleDeclaration from '../front_end/core/sdk/CSSStyleDeclaration.js';
19
24
  export {DebuggerModel, skipAllPausesSettingDescriptor} from '../front_end/core/sdk/DebuggerModel.js';
20
25
  export * as DOMModel from '../front_end/core/sdk/DOMModel.js';
21
26
  export * as NetworkManager from '../front_end/core/sdk/NetworkManager.js';
package/package.json CHANGED
@@ -31,12 +31,9 @@
31
31
  "webtest": "vpython3 third_party/node/node.py --output scripts/npm_test.js",
32
32
  "watch": "npm run build -- --watch",
33
33
  "test": "vpython3 third_party/node/node.py --output scripts/run_on_target.mjs gen/test/run.js",
34
- "test:evals": "npm run test -- test/ai_evals/",
35
34
  "test-health": "node scripts/test_health.ts"
36
35
  },
37
36
  "devDependencies": {
38
- "@rollup/plugin-node-resolve": "16.0.3",
39
- "@rollup/plugin-terser": "1.0.0",
40
37
  "@stylistic/eslint-plugin": "5.10.0",
41
38
  "@types/chai": "5.2.3",
42
39
  "@types/codemirror": "5.60.17",
@@ -51,7 +48,7 @@
51
48
  "@types/yargs-unparser": "2.0.3",
52
49
  "@typescript-eslint/rule-tester": "8.64.0",
53
50
  "@typescript-eslint/utils": "8.64.0",
54
- "@web/rollup-plugin-import-meta-assets": "2.3.3",
51
+ "@typescript/tsc": "npm:typescript@6.0.2",
55
52
  "chai": "6.2.2",
56
53
  "cssnano": "8.0.2",
57
54
  "cssnano-preset-lite": "5.0.1",
@@ -77,21 +74,17 @@
77
74
  "ora": "9.0.0",
78
75
  "postcss": "8.5.25",
79
76
  "puppeteer-core": "25.3.0",
80
- "rollup": "4.60.4",
81
- "rollup-plugin-sourcemaps2": "0.5.4",
82
77
  "sinon": "22.0.0",
83
78
  "source-map-support": "0.5.21",
84
79
  "stylelint": "17.14.0",
85
80
  "stylelint-config-standard": "40.0.0",
86
81
  "svgo": "4.0.2",
87
- "terser": "5.48.0",
88
82
  "ts-lit-plugin": "2.0.2",
89
- "@typescript/tsc": "npm:typescript@6.0.2",
90
83
  "typescript": "npm:@typescript/typescript6@6.0.2",
91
84
  "typescript-eslint": "8.64.0",
92
85
  "uuid": "14.0.0",
93
86
  "webidl2": "24.5.0",
94
87
  "yargs": "17.7.2"
95
88
  },
96
- "version": "1.0.1690531"
89
+ "version": "1.0.1695017"
97
90
  }
@@ -1,52 +0,0 @@
1
- // Copyright 2020 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
- import * as path from 'node:path';
5
-
6
- import {writeIfChanged} from '../../scripts/build/ninja/write-if-changed.js';
7
-
8
- const [, , buildTimestamp, targetGenDir, targetName, ...imageSources] = process.argv;
9
-
10
- /**
11
- * @param fileName
12
- */
13
- function generateCSSVariableDefinition(fileName) {
14
- // The `style` referenced here is the `:root` style rule in the constructed stylesheet down below
15
- return `style.setProperty('--image-file-${
16
- // We have to remove the `src/` part from any SVG file names for the CSS variables, while
17
- // we still use the full URL for the meta.url import. That's because the rollup-plugin-import-meta-assets
18
- // rewrites the image URLs to the new location, but doesn't modify the generated CSS variable name
19
- fileName.replace('src/', '').replace(path.extname(fileName), '')}', 'url(\\"' + new URL('./${
20
- fileName}', import.meta.url).toString() + '\\")');`;
21
- }
22
-
23
- const CURRENT_YEAR = new Date(Number(buildTimestamp) * 1000).getUTCFullYear();
24
- const newContents = `
25
- // Copyright ${CURRENT_YEAR} The Chromium Authors
26
- // Use of this source code is governed by a BSD-style license that can be
27
- // found in the LICENSE file.
28
- const sheet = new CSSStyleSheet();
29
- sheet.replaceSync(':root {}');
30
- const style = sheet.cssRules[0].style;
31
-
32
- ${imageSources.map(generateCSSVariableDefinition).join('\n')}
33
-
34
- document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
35
- `;
36
-
37
- writeIfChanged(path.join(targetGenDir, 'Images.prebundle.js'), newContents);
38
-
39
- const tsconfigContent = `{
40
- "compilerOptions": {
41
- "composite": true
42
- },
43
- "files": [
44
- "Images.js"
45
- ]
46
- }
47
- `;
48
-
49
- writeIfChanged(
50
- path.join(targetGenDir, `${targetName}-tsconfig.json`),
51
- tsconfigContent,
52
- );
@@ -1,36 +0,0 @@
1
- // Copyright 2021 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
- import {importMetaAssets} from '@web/rollup-plugin-import-meta-assets';
5
- import {optimize} from 'svgo';
6
-
7
- export default {
8
- treeshake: false,
9
- output: [{
10
- format: 'esm',
11
- assetFileNames: '[name][extname]',
12
- }],
13
- plugins:
14
- [
15
- importMetaAssets({
16
- async transform(assetBuffer, assetPath) {
17
- if (assetPath.endsWith('.svg')) {
18
- const {data} = await optimize(assetBuffer.toString(), {
19
- plugins: [
20
- {
21
- name: 'preset-default',
22
- params: {
23
- overrides: {
24
- inlineStyles: false,
25
- },
26
- },
27
- },
28
- ],
29
- });
30
- return data;
31
- }
32
- return null;
33
- },
34
- }),
35
- ],
36
- };
@@ -1,107 +0,0 @@
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 * as Common from '../../core/common/common.js';
6
- import type * as Platform from '../../core/platform/platform.js';
7
-
8
- /**
9
- * Returns true if the origin is considered opaque and should be blocked from
10
- * AI assistance to prevent potential data leakage.
11
- *
12
- * @param origin The origin string to check.
13
- * @returns True if the origin is opaque and blocked.
14
- * @see https://crbug.com/513732588
15
- */
16
- export function isOpaqueOrigin(origin: string): boolean {
17
- /**
18
- * Origins starting with 'about' (like about:blank or about:srcdoc) are
19
- * considered opaque. 'about://' is the sentinel used by DevTools
20
- * ParsedURL.securityOrigin() for these.
21
- *
22
- * We also treat empty origins, 'undefined', and 'null' as opaque to prevent
23
- * bypasses when URL parsing fails or variables are uninitialized.
24
- */
25
- const lower = origin.toLowerCase();
26
- return lower === '' || lower === 'null' || lower === 'data:' || lower.startsWith('about') ||
27
- lower.startsWith('detached') || lower.startsWith('undefined');
28
- }
29
-
30
- /**
31
- * Extracts the origin from a context URL or identifier.
32
- * Handles special cases like "detached" nodes, trace identifiers,
33
- * opaque blob URLs, and isolates local file paths.
34
- *
35
- * @param contextURL The context URL or trace/node identifier.
36
- * @returns The extracted origin string.
37
- */
38
- export function extractContextOrigin(contextURL: string): string {
39
- if (isOpaqueOrigin(contextURL)) {
40
- return contextURL;
41
- }
42
- if (contextURL.startsWith('trace-')) {
43
- return contextURL;
44
- }
45
- // If a blob URL has an opaque inner origin (e.g. blob:null/uuid, blob:about:blank),
46
- // it won't contain "://". We classify these as opaque ('null') to prevent cross-origin leaks.
47
- if (/^blob:/i.test(contextURL)) {
48
- const innerURL = contextURL.substring(5);
49
- if (!innerURL.includes('://')) {
50
- return 'null';
51
- }
52
- }
53
- // Local files collapse to a generic "file://" origin by default. We isolate them
54
- // by appending the normalized path, ensuring distinct files are treated as different origins.
55
- if (/^file:\/\//i.test(contextURL)) {
56
- const parsed = Common.ParsedURL.ParsedURL.fromString(contextURL as Platform.DevToolsPath.UrlString);
57
- if (parsed) {
58
- // Include host and port (authority) to preserve server names in Windows UNC paths
59
- // (e.g. file://server/path) so different network shares are isolated.
60
- const authority = parsed.host + (parsed.port ? ':' + parsed.port : '');
61
- return 'file://' + authority + parsed.path;
62
- }
63
- // Fallback to 'null' (opaque) if parsing fails. This prevents malformed file URLs
64
- // from bypassing isolation by collapsing to the same 'file://' string.
65
- return 'null';
66
- }
67
- return Common.ParsedURL.ParsedURL.extractOrigin(contextURL as Platform.DevToolsPath.UrlString);
68
- }
69
-
70
- /**
71
- * Determines if two origins are equivalent and safe to be used together.
72
- * Opaque origins are never equivalent to anything, not even themselves.
73
- */
74
- export function areOriginsEquivalent(origin1: string, origin2: string): boolean {
75
- if (isOpaqueOrigin(origin1) || isOpaqueOrigin(origin2)) {
76
- return false;
77
- }
78
- return origin1 === origin2;
79
- }
80
-
81
- /**
82
- * Validates if the source code contents of a file (identified by targetURL) can be retrieved
83
- * and shared with the AI, based on the origin of the active trace context.
84
- *
85
- * This function handles the following branches:
86
- * 1. **Opaque origins**: If either the trace origin or target file origin is opaque
87
- * (e.g., data URLs, about:blank, sandboxed frames), access is blocked.
88
- * 2. **Fresh Recordings**: For live page recordings, a strict same-origin comparison
89
- * (scheme, host, and port matching) is enforced.
90
- *
91
- * @param targetURL The URL of the file to be read.
92
- * @param traceOrigin The allowed origin of the trace context.
93
- * @returns true if reading the file is permitted; false otherwise.
94
- */
95
- export function canResourceContentsBeReadForTrace(targetURL: string, traceOrigin: string): boolean {
96
- // We explicitly block all file:// URLs. While we want to allow users to debug
97
- // traces on local sites, allowing file:// access poses security risks (e.g.,
98
- // reading local files like /etc/passwd via prompt injection) because file://
99
- // origins are not sufficiently isolated from each other in DevTools' origin model.
100
- if (traceOrigin.startsWith('file://') || targetURL.startsWith('file://')) {
101
- return false;
102
- }
103
-
104
- const targetOrigin = extractContextOrigin(targetURL);
105
-
106
- return areOriginsEquivalent(targetOrigin, traceOrigin);
107
- }
@@ -1,20 +0,0 @@
1
- // Copyright 2024 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 terser from '@rollup/plugin-terser';
6
-
7
- /**
8
- * Checks if an env variable is true.
9
- * @param envVar
10
- * @returns Whether the flag is 'true' or not.
11
- */
12
- function isEnvVarTrue(envVar) {
13
- return envVar === 'true';
14
- }
15
-
16
- export default {
17
- treeshake: true,
18
- output: [{format: 'iife'}],
19
- plugins: isEnvVarTrue(process.env.DEBUG_INJECTED) ? [] : [terser()],
20
- };
@@ -1,20 +0,0 @@
1
- // Copyright 2023 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 terser from '@rollup/plugin-terser';
6
-
7
- /**
8
- * Checks if an env variable is true.
9
- * @param envVar
10
- * @returns Whether the flag is 'true' or not.
11
- */
12
- function isEnvVarTrue(envVar) {
13
- return envVar === 'true';
14
- }
15
-
16
- export default {
17
- treeshake: false,
18
- output: [{format: 'iife'}],
19
- plugins: !isEnvVarTrue(process.env.DEBUG_INJECTED) ? [terser()] : [],
20
- };
@@ -1,6 +0,0 @@
1
- /**
2
- * Copyright 2024 The Chromium Authors
3
- * Use of this source code is governed by a BSD-style license that can be
4
- * found in the LICENSE file.
5
- **/
6
- export const SHOULD_SHOW_EASTER_EGG: boolean;
@@ -1,8 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true
4
- },
5
- "files": [
6
- "EasterEgg.js"
7
- ]
8
- }
@@ -1,20 +0,0 @@
1
- // Copyright 2024 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 * as path from 'node:path';
6
-
7
- import {writeIfChanged} from '../../../scripts/build/ninja/write-if-changed.js';
8
-
9
- const [, , targetGenDir] = process.argv;
10
-
11
- let value = 'false';
12
-
13
- if (process.argv.includes('--should-enable')) {
14
- value = 'true';
15
- }
16
-
17
- await writeIfChanged(
18
- path.join(targetGenDir, 'EasterEgg.js'),
19
- `export const SHOULD_SHOW_EASTER_EGG = ${value};`,
20
- );
@@ -1,8 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true
4
- },
5
- "files": [
6
- "package/lib/main.js"
7
- ]
8
- }