chrome-devtools-frontend 1.0.1652307 → 1.0.1656291

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 (267) hide show
  1. package/.agents/skills/fixing-skipped-tests/SKILL.md +32 -0
  2. package/.agents/skills/migrate-chromium-test/SKILL.md +144 -0
  3. package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +116 -0
  4. package/.agents/skills/ui-eng-vision-logic-consolidator/SKILL.md +82 -0
  5. package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +123 -0
  6. package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +125 -0
  7. package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +75 -0
  8. package/AUTHORS +1 -0
  9. package/config/owner/COMMON_OWNERS +0 -4
  10. package/docs/get_the_code.md +1 -2
  11. package/docs/playbook.md +1 -1
  12. package/docs/ui_engineering.md +3 -1
  13. package/eslint.config.mjs +0 -5
  14. package/front_end/Tests.js +1 -0
  15. package/front_end/core/common/Settings.ts +47 -30
  16. package/front_end/core/sdk/CPUThrottlingManager.ts +23 -167
  17. package/front_end/core/sdk/CSSMetadata.ts +23 -0
  18. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +8 -4
  19. package/front_end/core/sdk/ConsoleModel.ts +13 -11
  20. package/front_end/core/sdk/DOMDebuggerModel.ts +11 -5
  21. package/front_end/core/sdk/DOMModel.ts +4 -0
  22. package/front_end/core/sdk/EmulationModel.ts +4 -0
  23. package/front_end/core/sdk/EventBreakpointsModel.ts +9 -5
  24. package/front_end/core/sdk/IsolateManager.ts +6 -6
  25. package/front_end/core/sdk/ResourceTreeModel.ts +8 -5
  26. package/front_end/core/sdk/TargetManager.ts +17 -0
  27. package/front_end/entrypoints/devtools_app/devtools_app.ts +0 -1
  28. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +459 -74
  29. package/front_end/entrypoints/main/MainImpl.ts +12 -42
  30. package/front_end/foundation/Universe.ts +116 -3
  31. package/front_end/generated/InspectorBackendCommands.ts +11 -6
  32. package/front_end/generated/SupportedCSSProperties.js +124 -34
  33. package/front_end/generated/protocol-mapping.d.ts +8 -0
  34. package/front_end/generated/protocol-proxy-api.d.ts +15 -0
  35. package/front_end/generated/protocol.ts +94 -1
  36. package/front_end/models/ai_assistance/AiConversation.ts +2 -7
  37. package/front_end/models/ai_assistance/README.md +4 -3
  38. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
  39. package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +1 -1
  40. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
  41. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +13 -320
  42. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -24
  43. package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -358
  44. package/front_end/models/ai_assistance/ai_assistance.ts +6 -8
  45. package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +295 -0
  46. package/front_end/models/ai_assistance/contexts/RequestContext.snapshot.txt +0 -1
  47. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +0 -2
  48. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +10 -10
  49. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +12 -11
  50. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -6
  51. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -14
  52. package/front_end/models/ai_assistance/skills/accessibility.md +4 -2
  53. package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +142 -0
  54. package/front_end/models/ai_assistance/tools/GetStyles.ts +1 -1
  55. package/front_end/models/ai_assistance/tools/README.md +21 -1
  56. package/front_end/models/ai_assistance/tools/{ResolveLighthousePath.ts → ResolveDevtoolsNodePath.ts} +18 -17
  57. package/front_end/models/ai_assistance/tools/Tool.ts +6 -1
  58. package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -2
  59. package/front_end/models/autofill_manager/AutofillManager.ts +6 -15
  60. package/front_end/models/bindings/NetworkProject.ts +4 -8
  61. package/front_end/models/breakpoints/BreakpointManager.ts +9 -9
  62. package/front_end/models/emulation/DeviceModeModel.ts +24 -0
  63. package/front_end/models/emulation/EmulatedDevices.ts +108 -0
  64. package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +36 -0
  65. package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +8 -0
  66. package/front_end/models/issues_manager/IssuesManager.ts +10 -6
  67. package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +4 -5
  68. package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
  69. package/front_end/models/live-metrics/LiveMetrics.ts +6 -6
  70. package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +5 -5
  71. package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +3 -3
  72. package/front_end/models/logs/LogManager.ts +25 -10
  73. package/front_end/models/logs/NetworkLog.ts +24 -19
  74. package/front_end/models/persistence/AutomaticFileSystemManager.ts +14 -13
  75. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +26 -14
  76. package/front_end/models/persistence/IsolatedFileSystem.ts +9 -11
  77. package/front_end/models/persistence/IsolatedFileSystemManager.ts +22 -11
  78. package/front_end/models/persistence/NetworkPersistenceManager.ts +73 -44
  79. package/front_end/models/persistence/PersistenceImpl.ts +4 -5
  80. package/front_end/models/project_settings/ProjectSettingsModel.ts +12 -11
  81. package/front_end/models/trace/EntityMapper.ts +1 -1
  82. package/front_end/models/trace/handlers/ScreenshotsHandler.ts +14 -59
  83. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +12 -38
  84. package/front_end/panels/ai_assistance/ExportConversation.ts +4 -1
  85. package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
  86. package/front_end/panels/application/DeviceBoundSessionsView.ts +15 -3
  87. package/front_end/panels/application/FrameDetailsView.ts +2 -1
  88. package/front_end/panels/application/IndexedDBViews.ts +38 -36
  89. package/front_end/panels/application/ServiceWorkersView.ts +23 -16
  90. package/front_end/panels/application/components/AdsView.ts +4 -0
  91. package/front_end/panels/autofill/AutofillView.ts +1 -1
  92. package/front_end/panels/autofill/autofill-meta.ts +3 -2
  93. package/front_end/panels/common/CPUThrottlingOption.ts +142 -0
  94. package/front_end/panels/common/ThrottlingUtils.ts +9 -4
  95. package/front_end/panels/common/common.ts +1 -1
  96. package/front_end/panels/console/ConsoleViewMessage.ts +45 -0
  97. package/front_end/panels/elements/AccessibilityTreeUtils.ts +26 -15
  98. package/front_end/panels/elements/AccessibilityTreeView.ts +12 -9
  99. package/front_end/panels/elements/ElementsPanel.ts +0 -74
  100. package/front_end/panels/elements/ElementsTreeOutline.ts +5 -4
  101. package/front_end/panels/emulation/DeviceModeToolbar.ts +46 -45
  102. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +118 -68
  103. package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
  104. package/front_end/panels/layer_viewer/layerTreeOutline.css +20 -13
  105. package/front_end/panels/layers/LayersPanel.ts +1 -1
  106. package/front_end/panels/mobile_throttling/CalibrationController.ts +6 -5
  107. package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +1 -1
  108. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +40 -13
  109. package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +13 -17
  110. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +79 -30
  111. package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +5 -0
  112. package/front_end/panels/network/LinkPreloadGenerator.ts +101 -0
  113. package/front_end/panels/network/NetworkLogView.ts +28 -9
  114. package/front_end/panels/network/NetworkPanel.ts +1 -63
  115. package/front_end/panels/network/RequestInitiatorView.ts +29 -4
  116. package/front_end/panels/network/components/HeaderSectionRow.css +9 -7
  117. package/front_end/panels/network/components/HeaderSectionRow.ts +20 -1
  118. package/front_end/panels/network/components/RequestHeaderSection.css +5 -3
  119. package/front_end/panels/network/components/RequestHeaderSection.ts +1 -2
  120. package/front_end/panels/network/components/RequestHeadersView.css +1 -1
  121. package/front_end/panels/network/network.ts +2 -0
  122. package/front_end/panels/profiler/HeapSnapshotView.ts +121 -33
  123. package/front_end/panels/profiler/ModuleUIStrings.ts +4 -0
  124. package/front_end/panels/security/SecurityPanel.ts +36 -23
  125. package/front_end/panels/settings/SettingsScreen.ts +18 -103
  126. package/front_end/panels/settings/settings-meta.ts +0 -24
  127. package/front_end/panels/timeline/TimelineController.ts +3 -2
  128. package/front_end/panels/timeline/TimelineHistoryManager.ts +38 -37
  129. package/front_end/panels/timeline/TimelinePanel.ts +52 -11
  130. package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +20 -18
  131. package/front_end/panels/timeline/components/LiveMetricsView.ts +38 -38
  132. package/front_end/panels/timeline/components/MetricCard.ts +18 -18
  133. package/front_end/panels/timeline/components/liveMetricsView.css +6 -6
  134. package/front_end/panels/timeline/components/metricCard.css +4 -4
  135. package/front_end/panels/timeline/timelineFlamechartPopover.css +2 -0
  136. package/front_end/panels/utils/utils.ts +25 -24
  137. package/front_end/panels/whats_new/ReleaseNoteText.ts +3 -3
  138. package/front_end/panels/whats_new/resources/WNDT.md +1 -1
  139. package/front_end/third_party/chromium/README.chromium +1 -1
  140. package/front_end/third_party/puppeteer/README.chromium +2 -2
  141. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +34 -55
  142. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +96 -83
  143. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +10 -1
  144. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
  146. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
  147. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
  149. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.d.ts.map +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.js.map +1 -1
  151. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts +3 -2
  152. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts.map +1 -1
  153. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.js.map +1 -1
  154. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js.map +1 -1
  156. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.d.ts +1 -1
  157. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.js +1 -1
  158. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts.map +1 -1
  159. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
  161. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +2 -1
  162. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
  163. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.d.ts.map +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.js.map +1 -1
  165. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +2 -2
  166. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
  167. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +5 -2
  168. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
  169. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +1 -1
  170. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
  171. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +23 -13
  173. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts.map +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js +4 -1
  176. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Input.js +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.d.ts.map +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.js.map +1 -1
  180. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts.map +1 -1
  181. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
  182. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts +3 -41
  183. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
  184. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  187. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +4 -2
  188. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
  189. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts +5 -0
  190. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +1 -1
  192. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +1 -1
  193. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts +1 -1
  194. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts.map +1 -1
  195. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js +5 -5
  196. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js.map +1 -1
  197. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
  199. package/front_end/third_party/puppeteer/package/lib/types.d.ts +34 -55
  200. package/front_end/third_party/puppeteer/package/package.json +4 -4
  201. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +13 -1
  202. package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +2 -3
  203. package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +3 -1
  204. package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +3 -2
  205. package/front_end/third_party/puppeteer/package/src/api/Realm.ts +1 -2
  206. package/front_end/third_party/puppeteer/package/src/api/Target.ts +1 -1
  207. package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +1 -2
  208. package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +3 -1
  209. package/front_end/third_party/puppeteer/package/src/bidi/core/Realm.ts +1 -3
  210. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +13 -3
  211. package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +1 -1
  212. package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +24 -13
  213. package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +4 -1
  214. package/front_end/third_party/puppeteer/package/src/cdp/Input.ts +1 -1
  215. package/front_end/third_party/puppeteer/package/src/cdp/LifecycleWatcher.ts +1 -4
  216. package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +2 -4
  217. package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +7 -76
  218. package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +1 -4
  219. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +4 -1
  220. package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +5 -0
  221. package/front_end/third_party/puppeteer/package/src/revisions.ts +1 -1
  222. package/front_end/third_party/puppeteer/package/src/util/httpUtils.ts +5 -5
  223. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  224. package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -1
  225. package/front_end/ui/components/dialogs/Dialog.ts +3 -0
  226. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +0 -7
  227. package/front_end/ui/helpers/OpenInNewTab.ts +15 -7
  228. package/front_end/ui/legacy/InspectorDrawerView.ts +7 -5
  229. package/front_end/ui/legacy/ListWidget.ts +12 -0
  230. package/front_end/ui/legacy/SplitWidget.ts +12 -11
  231. package/front_end/ui/legacy/TabbedPane.ts +1 -108
  232. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +9 -0
  233. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +192 -139
  234. package/front_end/ui/legacy/components/data_grid/DataGridExporter.ts +89 -0
  235. package/front_end/ui/legacy/components/data_grid/dataGrid.css +10 -0
  236. package/front_end/ui/legacy/components/data_grid/data_grid.ts +3 -1
  237. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +8 -1
  238. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +110 -17
  239. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +89 -40
  240. package/front_end/ui/legacy/treeoutline.css +1 -1
  241. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  242. package/package.json +4 -3
  243. package/front_end/Images/navigationControls.png +0 -0
  244. package/front_end/Images/navigationControls_2x.png +0 -0
  245. package/front_end/Images/popoverArrows.png +0 -0
  246. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +0 -746
  247. package/front_end/entrypoints/greendev_floaty/floaty.css +0 -301
  248. package/front_end/entrypoints/greendev_floaty/floaty.html +0 -38
  249. package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -415
  250. package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +0 -834
  251. package/front_end/models/ai_assistance/agents/GreenDevAgentAntigravityCliSocketClient.ts +0 -53
  252. package/front_end/models/ai_assistance/agents/GreenDevAgentGeminiCliSocketClient.ts +0 -117
  253. package/front_end/models/annotations/AnnotationRepository.ts +0 -238
  254. package/front_end/models/annotations/AnnotationType.ts +0 -10
  255. package/front_end/models/annotations/README.md +0 -7
  256. package/front_end/models/annotations/annotations.ts +0 -6
  257. package/front_end/models/greendev/Prototypes.ts +0 -68
  258. package/front_end/models/greendev/README.md +0 -5
  259. package/front_end/models/greendev/greendev.ts +0 -5
  260. package/front_end/panels/common/Annotation.ts +0 -184
  261. package/front_end/panels/common/AnnotationManager.ts +0 -208
  262. package/front_end/panels/common/annotation.css +0 -40
  263. package/front_end/panels/greendev/GreenDevPanel.css +0 -282
  264. package/front_end/panels/greendev/GreenDevPanel.ts +0 -364
  265. package/front_end/panels/greendev/GreenDevShared.ts +0 -13
  266. package/front_end/panels/greendev/greendev-meta.ts +0 -52
  267. package/front_end/panels/greendev/greendev.ts +0 -9
@@ -11,9 +11,7 @@ import * as Platform from '../../core/platform/platform.js';
11
11
  import * as Root from '../../core/root/root.js';
12
12
  import * as SDK from '../../core/sdk/sdk.js';
13
13
  import * as AiAssistanceModel from '../../models/ai_assistance/ai_assistance.js';
14
- import * as Annotations from '../../models/annotations/annotations.js';
15
14
  import * as Badges from '../../models/badges/badges.js';
16
- import * as Greendev from '../../models/greendev/greendev.js';
17
15
  import type * as LHModel from '../../models/lighthouse/lighthouse.js';
18
16
  import type * as Trace from '../../models/trace/trace.js';
19
17
  import * as Workspace from '../../models/workspace/workspace.js';
@@ -51,7 +49,6 @@ import {ExploreWidget} from './components/ExploreWidget.js';
51
49
  import {MarkdownRendererWithCodeBlock} from './components/MarkdownRendererWithCodeBlock.js';
52
50
  import {OptInChangeDialog} from './components/OptInChangeDialog.js';
53
51
  import {PerformanceAgentMarkdownRenderer} from './components/PerformanceAgentMarkdownRenderer.js';
54
- import {StylingAgentMarkdownRenderer} from './components/StylingAgentMarkdownRenderer.js';
55
52
  import {
56
53
  WalkthroughView,
57
54
  } from './components/WalkthroughView.js';
@@ -280,10 +277,6 @@ const lockedString = i18n.i18n.lockedString;
280
277
 
281
278
  function selectedElementFilter(maybeNode: SDK.DOMModel.DOMNode|null): SDK.DOMModel.DOMNode|null {
282
279
  if (maybeNode) {
283
- if (Greendev.Prototypes.instance().isEnabled('emulationCapabilities')) {
284
- return maybeNode;
285
- }
286
-
287
280
  return maybeNode.nodeType() === Node.ELEMENT_NODE ? maybeNode : null;
288
281
  }
289
282
 
@@ -311,12 +304,7 @@ async function getEmptyStateSuggestions(conversation?: AiAssistanceModel.AiConve
311
304
  return [
312
305
  {title: 'What can you help me with?', jslogContext: 'styling-default'},
313
306
  {title: 'Why isn’t this element visible?', jslogContext: 'styling-default'},
314
- {
315
- title: Greendev.Prototypes.instance().isEnabled('emulationCapabilities') ?
316
- 'Are there display issues on this page for people using an Android phone?' :
317
- 'How do I center this element?',
318
- jslogContext: 'styling-default'
319
- },
307
+ {title: 'How do I center this element?', jslogContext: 'styling-default'},
320
308
  ];
321
309
  case AiAssistanceModel.AiHistoryStorage.ConversationType.FILE:
322
310
  return [
@@ -371,7 +359,7 @@ function createV2MarkdownRenderer(conversation?: AiAssistanceModel.AiConversatio
371
359
  const resourceTreeModel = primaryTarget?.model(SDK.ResourceTreeModel.ResourceTreeModel);
372
360
  const context = conversation?.selectedContext;
373
361
 
374
- if (context instanceof AiAssistanceModel.PerformanceAgent.PerformanceTraceContext) {
362
+ if (context instanceof AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext) {
375
363
  const focus = context.getItem();
376
364
  options.mainFrameId = focus.parsedTrace.data.Meta.mainFrameId;
377
365
  options.lookupTraceEvent = focus.lookupEvent.bind(focus);
@@ -400,7 +388,7 @@ function getMarkdownRenderer(conversation?: AiAssistanceModel.AiConversation.AiC
400
388
 
401
389
  const context = conversation?.selectedContext;
402
390
 
403
- if (context instanceof AiAssistanceModel.PerformanceAgent.PerformanceTraceContext) {
391
+ if (context instanceof AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext) {
404
392
  const focus = context.getItem();
405
393
  return new PerformanceAgentMarkdownRenderer(focus.parsedTrace.data.Meta.mainFrameId, focus.lookupEvent.bind(focus));
406
394
  }
@@ -408,14 +396,7 @@ function getMarkdownRenderer(conversation?: AiAssistanceModel.AiConversation.AiC
408
396
  // Handle historical conversations (can't linkify anything).
409
397
  return new PerformanceAgentMarkdownRenderer();
410
398
  }
411
- if (Greendev.Prototypes.instance().isEnabled('emulationCapabilities') &&
412
- conversation?.type === AiAssistanceModel.AiHistoryStorage.ConversationType.STYLING &&
413
- SDK.TargetManager.TargetManager.instance().primaryPageTarget()?.model(SDK.DOMModel.DOMModel)) {
414
- const domModel = SDK.TargetManager.TargetManager.instance().primaryPageTarget()?.model(SDK.DOMModel.DOMModel);
415
- const resourceTreeModel = domModel?.target().model(SDK.ResourceTreeModel.ResourceTreeModel);
416
- const mainFrameId = resourceTreeModel?.mainFrame?.id;
417
- return new StylingAgentMarkdownRenderer(mainFrameId);
418
- }
399
+
419
400
  if (conversation?.type === AiAssistanceModel.AiHistoryStorage.ConversationType.ACCESSIBILITY) {
420
401
  const domModel = SDK.TargetManager.TargetManager.instance().primaryPageTarget()?.model(SDK.DOMModel.DOMModel);
421
402
  const mainDocumentURL = domModel?.existingDocument()?.documentURL;
@@ -640,12 +621,12 @@ function createRequestContext(request: SDK.NetworkRequest.NetworkRequest|
640
621
  return new AiAssistanceModel.RequestContext.RequestContext(request, calculator);
641
622
  }
642
623
 
643
- function createPerformanceTraceContext(focus: AiAssistanceModel.AIContext.AgentFocus|null):
644
- AiAssistanceModel.PerformanceAgent.PerformanceTraceContext|null {
624
+ function createPerformanceTraceContext(focus: AiAssistanceModel.AIContext.AgentFocus|
625
+ null): AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext|null {
645
626
  if (!focus) {
646
627
  return null;
647
628
  }
648
- return new AiAssistanceModel.PerformanceAgent.PerformanceTraceContext(focus);
629
+ return new AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext(focus);
649
630
  }
650
631
 
651
632
  function createStorageContext(item: AiAssistanceModel.StorageItem.StorageItem|null):
@@ -707,7 +688,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
707
688
 
708
689
  #selectedFile: AiAssistanceModel.FileContext.FileContext|null = null;
709
690
  #selectedElement: AiAssistanceModel.DOMNodeContext.DOMNodeContext|null = null;
710
- #selectedPerformanceTrace: AiAssistanceModel.PerformanceAgent.PerformanceTraceContext|null = null;
691
+ #selectedPerformanceTrace: AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext|null = null;
711
692
  #selectedRequest: AiAssistanceModel.RequestContext.RequestContext|null = null;
712
693
 
713
694
  #selectedAccessibility: AiAssistanceModel.AccessibilityContext.AccessibilityContext|null = null;
@@ -1307,7 +1288,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1307
1288
  }
1308
1289
 
1309
1290
  this.#selectedPerformanceTrace =
1310
- Boolean(ev.data) ? new AiAssistanceModel.PerformanceAgent.PerformanceTraceContext(ev.data) : null;
1291
+ Boolean(ev.data) ? new AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext(ev.data) : null;
1311
1292
 
1312
1293
  this.#updateConversationState(this.#conversation);
1313
1294
  };
@@ -1535,7 +1516,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1535
1516
  if (context instanceof AiAssistanceModel.FileContext.FileContext) {
1536
1517
  return Common.Revealer.reveal(context.getItem().uiLocation(0, 0));
1537
1518
  }
1538
- if (context instanceof AiAssistanceModel.PerformanceAgent.PerformanceTraceContext) {
1519
+ if (context instanceof AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext) {
1539
1520
  const focus = context.getItem();
1540
1521
  if (focus.callTree) {
1541
1522
  const event = focus.callTree.selectedNode?.event ?? focus.callTree.rootNode.event;
@@ -1737,9 +1718,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1737
1718
  this.#resetWalkthrough();
1738
1719
  UI.ARIAUtils.LiveAnnouncer.alert(i18nString(UIStrings.newChatCreated));
1739
1720
 
1740
- if (Annotations.AnnotationRepository.annotationsEnabled()) {
1741
- Annotations.AnnotationRepository.instance().deleteAllAnnotations();
1742
- }
1743
1721
  }
1744
1722
 
1745
1723
  #cancel(): void {
@@ -1778,7 +1756,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1778
1756
  this.#selectedElement = data;
1779
1757
  } else if (data instanceof AiAssistanceModel.RequestContext.RequestContext) {
1780
1758
  this.#selectedRequest = data;
1781
- } else if (data instanceof AiAssistanceModel.PerformanceAgent.PerformanceTraceContext) {
1759
+ } else if (data instanceof AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext) {
1782
1760
  this.#selectedPerformanceTrace = data;
1783
1761
 
1784
1762
  } else if (data instanceof AiAssistanceModel.AccessibilityContext.AccessibilityContext) {
@@ -1863,12 +1841,8 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1863
1841
  Badges.UserBadges.instance().recordAction(Badges.BadgeAction.STARTED_AI_CONVERSATION);
1864
1842
  }
1865
1843
 
1866
- const greenDevEmulationEnabled = Greendev.Prototypes.instance().isEnabled('emulationCapabilities');
1867
1844
  let multimodalInput: AiAssistanceModel.AiAgent.MultimodalInput|undefined;
1868
- const pendingInput = this.#conversation.getPendingMultimodalInput();
1869
- if (greenDevEmulationEnabled && pendingInput) {
1870
- multimodalInput = pendingInput;
1871
- } else if (isAiAssistanceMultimodalInputEnabled() && imageInput && multimodalInputType) {
1845
+ if (isAiAssistanceMultimodalInputEnabled() && imageInput && multimodalInputType) {
1872
1846
  multimodalInput = {
1873
1847
  input: imageInput,
1874
1848
  id: crypto.randomUUID(),
@@ -13,7 +13,10 @@ export async function saveToDisk(conversation: AiAssistanceModel.AiConversation.
13
13
  const titleFormatted = Platform.StringUtilities.toSnakeCase(conversation.title || '');
14
14
  const prefix = 'devtools_';
15
15
  const suffix = '.md';
16
- const maxTitleLength = 64 - prefix.length - suffix.length;
16
+ // The Windows save dialog / Chrome wrapper limits the suggested filename
17
+ // to 63 characters (due to a 64-byte null-terminated buffer).
18
+ // Capping the total filename length at 63 avoids truncation of the extension.
19
+ const maxTitleLength = 63 - prefix.length - suffix.length;
17
20
  let finalTitle = titleFormatted || 'conversation';
18
21
  if (finalTitle.length > maxTitleLength) {
19
22
  finalTitle = finalTitle.substring(0, maxTitleLength);
@@ -180,7 +180,7 @@ function getContextRemoveLabel(context: AiAssistanceModel.AiAgent.ConversationCo
180
180
  if (context instanceof AiAssistanceModel.RequestContext.RequestContext) {
181
181
  return lockedString(UIStringsNotTranslate.removeContextRequest);
182
182
  }
183
- if (context instanceof AiAssistanceModel.PerformanceAgent.PerformanceTraceContext) {
183
+ if (context instanceof AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext) {
184
184
  return lockedString(UIStringsNotTranslate.removeContextPerfInsight);
185
185
  }
186
186
  if (context instanceof AiAssistanceModel.StorageAgent.StorageContext) {
@@ -357,7 +357,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
357
357
  PanelUtils.PanelUtils.getIconForSourceFile(input.context.getItem()) :
358
358
  input.context instanceof AiAssistanceModel.AccessibilityContext.AccessibilityContext ?
359
359
  html`<devtools-icon class="icon" name="performance" title="Lighthouse"></devtools-icon>` :
360
- input.context instanceof AiAssistanceModel.PerformanceAgent.PerformanceTraceContext ?
360
+ input.context instanceof AiAssistanceModel.PerformanceTraceContext.PerformanceTraceContext ?
361
361
  html`<devtools-icon class="icon" name="performance" title="Performance"></devtools-icon>` :
362
362
  input.context instanceof AiAssistanceModel.StorageAgent.StorageContext ?
363
363
  html`<devtools-icon class="icon" name="table" title="Storage"></devtools-icon>` :
@@ -218,11 +218,19 @@ const UIStrings = {
218
218
  /**
219
219
  *@description Explanation for an event outcome. Key refers to a cryptographic key.
220
220
  */
221
- keyError: 'Key error',
221
+ signingKeyGenerationError: 'Signing key generation error',
222
+ /**
223
+ *@description Explanation for an event outcome. Key refers to a cryptographic key.
224
+ */
225
+ attestationKeyGenerationError: 'Attestation key generation error',
222
226
  /**
223
227
  *@description Explanation for an event outcome. Signing refers to cryptographic signing.
224
228
  */
225
229
  signingError: 'Signing error',
230
+ /**
231
+ *@description Explanation for an event outcome. Signing refers to cryptographic signing.
232
+ */
233
+ transientSigningError: 'Transient signing error',
226
234
  /**
227
235
  *@description Explanation for an event outcome.
228
236
  */
@@ -942,10 +950,14 @@ function fetchResultToString(fetchResult: Protocol.Network.DeviceBoundSessionFet
942
950
  switch (fetchResult) {
943
951
  case Protocol.Network.DeviceBoundSessionFetchResult.Success:
944
952
  return i18nString(UIStrings.success);
945
- case Protocol.Network.DeviceBoundSessionFetchResult.KeyError:
946
- return i18nString(UIStrings.keyError);
953
+ case Protocol.Network.DeviceBoundSessionFetchResult.SigningKeyGenerationError:
954
+ return i18nString(UIStrings.signingKeyGenerationError);
955
+ case Protocol.Network.DeviceBoundSessionFetchResult.AttestationKeyGenerationError:
956
+ return i18nString(UIStrings.attestationKeyGenerationError);
947
957
  case Protocol.Network.DeviceBoundSessionFetchResult.SigningError:
948
958
  return i18nString(UIStrings.signingError);
959
+ case Protocol.Network.DeviceBoundSessionFetchResult.TransientSigningError:
960
+ return i18nString(UIStrings.transientSigningError);
949
961
  case Protocol.Network.DeviceBoundSessionFetchResult.ServerRequestedTermination:
950
962
  return i18nString(UIStrings.serverRequestedTermination);
951
963
  case Protocol.Network.DeviceBoundSessionFetchResult.InvalidSessionId:
@@ -21,6 +21,7 @@ import * as CspEvaluator from '../../third_party/csp_evaluator/csp_evaluator.js'
21
21
  import * as Buttons from '../../ui/components/buttons/buttons.js';
22
22
  import type * as ExpandableList from '../../ui/components/expandable_list/expandable_list.js';
23
23
  import type * as ReportView from '../../ui/components/report_view/report_view.js';
24
+ import * as UIHelpers from '../../ui/helpers/helpers.js';
24
25
  import * as Components from '../../ui/legacy/components/utils/utils.js';
25
26
  import * as UI from '../../ui/legacy/legacy.js';
26
27
  import {html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
@@ -680,7 +681,7 @@ function renderSingleCSP(cspInfo: Protocol.Network.ContentSecurityPolicyStatus,
680
681
  .accessibleLabel=${i18nString(UIStrings.learnMore)}
681
682
  .variant=${Buttons.Button.Variant.ICON}
682
683
  .size=${Buttons.Button.Size.SMALL}
683
- @click=${()=> {window.location.href = 'https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only';}}
684
+ @click=${()=> {UIHelpers.openInNewTab('https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only');}}
684
685
  jslog=${VisualLogging.link('learn-more.csp-report-only').track({click: true})}
685
686
  ></devtools-button>`}
686
687
  </devtools-report-key>
@@ -262,9 +262,8 @@ export class IDBDataView extends UI.View.SimpleView {
262
262
  private lastKey?: any;
263
263
  private summaryBarElement?: HTMLElement;
264
264
 
265
- constructor(
266
- model: IndexedDBModel, databaseId: DatabaseId, objectStore: ObjectStore, index: Index|null,
267
- refreshObjectStoreCallback: () => void) {
265
+ constructor(model: IndexedDBModel, databaseId: DatabaseId, objectStore: ObjectStore, index: Index|null,
266
+ refreshObjectStoreCallback: () => void) {
268
267
  super({
269
268
  title: i18nString(UIStrings.idb),
270
269
  viewId: 'idb',
@@ -287,8 +286,8 @@ export class IDBDataView extends UI.View.SimpleView {
287
286
  this.deleteSelectedButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, _event => {
288
287
  void this.deleteButtonClicked(null);
289
288
  });
290
- this.deleteSelectedButton.element.setAttribute(
291
- 'jslog', `${VisualLogging.action('delete-selected').track({click: true})}`);
289
+ this.deleteSelectedButton.element.setAttribute('jslog',
290
+ `${VisualLogging.action('delete-selected').track({click: true})}`);
292
291
 
293
292
  this.clearButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.clearObjectStore), 'clear');
294
293
  this.clearButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, () => {
@@ -434,8 +433,8 @@ export class IDBDataView extends UI.View.SimpleView {
434
433
  this.updateData(false);
435
434
  }
436
435
 
437
- private populateContextMenu(
438
- contextMenu: UI.ContextMenu.ContextMenu, gridNode: DataGrid.DataGrid.DataGridNode<unknown>): void {
436
+ private populateContextMenu(contextMenu: UI.ContextMenu.ContextMenu,
437
+ gridNode: DataGrid.DataGrid.DataGridNode<unknown>): void {
439
438
  const node = (gridNode as IDBDataGridNode);
440
439
  if (node.valueObjectPresentation) {
441
440
  contextMenu.revealSection().appendItem(i18nString(UIStrings.expandRecursively), () => {
@@ -510,26 +509,7 @@ export class IDBDataView extends UI.View.SimpleView {
510
509
  function callback(this: IDBDataView, entries: Entry[], hasMore: boolean): void {
511
510
  this.clear();
512
511
  this.entries = entries;
513
- let selectedNode: IDBDataGridNode|null = null;
514
- for (let i = 0; i < entries.length; ++i) {
515
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
516
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
517
- const data: any = {};
518
- data['number'] = i + skipCount;
519
- data['key'] = entries[i].key;
520
- data['primary-key'] = entries[i].primaryKey;
521
- data['value'] = entries[i].value;
522
-
523
- const node = new IDBDataGridNode(data);
524
- this.dataGrid.rootNode().appendChild(node);
525
- if (data['number'] <= selected) {
526
- selectedNode = node;
527
- }
528
- }
529
-
530
- if (selectedNode) {
531
- selectedNode.select();
532
- }
512
+ this.populateDataGrid(entries, skipCount, selected);
533
513
  this.pageBackButton.setEnabled(Boolean(skipCount));
534
514
  this.pageForwardButton.setEnabled(hasMore);
535
515
  this.needsRefresh.setVisible(false);
@@ -539,16 +519,38 @@ export class IDBDataView extends UI.View.SimpleView {
539
519
 
540
520
  const idbKeyRange = key ? window.IDBKeyRange.lowerBound(key) : null;
541
521
  if (this.isIndex && this.index) {
542
- this.model.loadIndexData(
543
- this.databaseId, this.objectStore.name, this.index.name, idbKeyRange, skipCount, pageSize,
544
- callback.bind(this));
522
+ this.model.loadIndexData(this.databaseId, this.objectStore.name, this.index.name, idbKeyRange, skipCount,
523
+ pageSize, callback.bind(this));
545
524
  } else {
546
- this.model.loadObjectStoreData(
547
- this.databaseId, this.objectStore.name, idbKeyRange, skipCount, pageSize, callback.bind(this));
525
+ this.model.loadObjectStoreData(this.databaseId, this.objectStore.name, idbKeyRange, skipCount, pageSize,
526
+ callback.bind(this));
548
527
  }
549
528
  void this.model.getMetadata(this.databaseId, this.objectStore).then(this.updateSummaryBar.bind(this));
550
529
  }
551
530
 
531
+ private populateDataGrid(entries: Entry[], skipCount: number, selected: number): void {
532
+ let selectedNode: IDBDataGridNode|null = null;
533
+ for (let i = 0; i < entries.length; ++i) {
534
+ // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
535
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
536
+ const data: any = {};
537
+ data['number'] = i + skipCount;
538
+ data['key'] = entries[i].key;
539
+ data['primary-key'] = entries[i].primaryKey;
540
+ data['value'] = entries[i].value;
541
+
542
+ const node = new IDBDataGridNode(data);
543
+ this.dataGrid.rootNode().appendChild(node);
544
+ if (data['number'] <= selected) {
545
+ selectedNode = node;
546
+ }
547
+ }
548
+
549
+ if (selectedNode) {
550
+ selectedNode.select();
551
+ }
552
+ }
553
+
552
554
  private updateSummaryBar(metadata: ObjectStoreMetadata|null): void {
553
555
  if (!this.summaryBarElement) {
554
556
  this.summaryBarElement = this.element.createChild('div', 'object-store-summary-bar');
@@ -578,10 +580,10 @@ export class IDBDataView extends UI.View.SimpleView {
578
580
  }
579
581
 
580
582
  private async clearButtonClicked(): Promise<void> {
581
- const ok = await UI.UIUtils.ConfirmDialog.show(
582
- i18nString(UIStrings.objectStoreWillBeCleared),
583
- i18nString(UIStrings.confirmClearObjectStore, {PH1: this.objectStore.name}), this.element,
584
- {jslogContext: 'clear-object-store-confirmation'});
583
+ const ok =
584
+ await UI.UIUtils.ConfirmDialog.show(i18nString(UIStrings.objectStoreWillBeCleared),
585
+ i18nString(UIStrings.confirmClearObjectStore, {PH1: this.objectStore.name}),
586
+ this.element, {jslogContext: 'clear-object-store-confirmation'});
585
587
  if (ok) {
586
588
  this.clearButton.setEnabled(false);
587
589
  this.clearingObjectStore = true;
@@ -220,6 +220,15 @@ export class ServiceWorkersView extends UI.Widget.VBox implements
220
220
 
221
221
  this.sectionToRegistration = new WeakMap();
222
222
 
223
+ this.createOthersOriginView();
224
+ this.setupToolbar();
225
+
226
+ this.eventListeners = new Map();
227
+ SDK.TargetManager.TargetManager.instance().observeModels(SDK.ServiceWorkerManager.ServiceWorkerManager, this);
228
+ this.updateListVisibility();
229
+ }
230
+
231
+ private createOthersOriginView(): void {
223
232
  const othersDiv = this.contentElement.createChild('div', 'service-workers-other-origin');
224
233
  othersDiv.setAttribute('jslog', `${VisualLogging.section('other-origin')}`);
225
234
  // TODO(crbug.com/1156978): Replace UI.ReportView.ReportView with ReportView.ts web component.
@@ -231,7 +240,9 @@ export class ServiceWorkersView extends UI.Widget.VBox implements
231
240
  const seeOthers = Link.create('chrome://serviceworker-internals', i18nString(UIStrings.seeAllRegistrations),
232
241
  undefined, 'view-all', 0, /* allowPrivileged=*/ true);
233
242
  othersSectionRow.appendChild(seeOthers);
243
+ }
234
244
 
245
+ private setupToolbar(): void {
235
246
  this.toolbar.appendToolbarItem(
236
247
  MobileThrottling.ThrottlingManager.throttlingManager().createOfflineToolbarCheckbox());
237
248
  const updateOnReloadSetting =
@@ -246,10 +257,6 @@ export class ServiceWorkersView extends UI.Widget.VBox implements
246
257
  const fallbackToNetwork = new UI.Toolbar.ToolbarSettingCheckbox(
247
258
  bypassServiceWorkerSetting, i18nString(UIStrings.bypassTheServiceWorkerAndLoad));
248
259
  this.toolbar.appendToolbarItem(fallbackToNetwork);
249
-
250
- this.eventListeners = new Map();
251
- SDK.TargetManager.TargetManager.instance().observeModels(SDK.ServiceWorkerManager.ServiceWorkerManager, this);
252
- this.updateListVisibility();
253
260
  }
254
261
 
255
262
  modelAdded(serviceWorkerManager: SDK.ServiceWorkerManager.ServiceWorkerManager): void {
@@ -453,13 +460,13 @@ export class Section {
453
460
  private readonly networkRequests: Buttons.Button.Button;
454
461
  private readonly updateButton: Buttons.Button.Button;
455
462
  private readonly deleteButton: Buttons.Button.Button;
456
- private sourceField: Element;
457
- private readonly statusField: Element;
458
- private readonly clientsField: Element;
463
+ private sourceField: HTMLElement;
464
+ private readonly statusField: HTMLElement;
465
+ private readonly clientsField: HTMLElement;
459
466
  private readonly clientInfoCache: Map<string, Protocol.Target.TargetInfo>;
460
467
  private readonly throttler: Common.Throttler.Throttler;
461
- private updateCycleField?: Element;
462
- private routerField?: Element;
468
+ private updateCycleField?: HTMLElement;
469
+ private routerField?: HTMLElement;
463
470
 
464
471
  constructor(
465
472
  manager: SDK.ServiceWorkerManager.ServiceWorkerManager, section: UI.ReportView.Section,
@@ -542,10 +549,10 @@ export class Section {
542
549
 
543
550
  scheduleUpdate(): void {
544
551
  if (throttleDisabledForDebugging) {
545
- void this.update();
552
+ void this.performUpdate();
546
553
  return;
547
554
  }
548
- void this.throttler.schedule(this.update.bind(this));
555
+ void this.throttler.schedule(this.performUpdate.bind(this));
549
556
  }
550
557
 
551
558
  private addVersion(versionsStack: Element, icon: string, label: string): Element {
@@ -561,7 +568,7 @@ export class Section {
561
568
  this.clientsField.removeChildren();
562
569
  this.section.setFieldVisible(i18nString(UIStrings.clients), Boolean(version.controlledClients.length));
563
570
  for (const client of version.controlledClients) {
564
- const clientLabelText = this.clientsField.createChild('div', 'service-worker-client');
571
+ const clientLabelText = this.clientsField.createChild('div', 'service-worker-client') as HTMLElement;
565
572
  const info = this.clientInfoCache.get(client);
566
573
  if (info) {
567
574
  this.updateClientInfo(clientLabelText, info);
@@ -601,7 +608,7 @@ export class Section {
601
608
  }
602
609
  }
603
610
 
604
- private update(): Promise<void> {
611
+ private performUpdate(): Promise<void> {
605
612
  const fingerprint = this.registration.fingerprint();
606
613
  if (fingerprint === this.fingerprint) {
607
614
  return Promise.resolve();
@@ -740,7 +747,7 @@ export class Section {
740
747
  void this.manager.dispatchPeriodicSyncEvent(this.registration.id, tag);
741
748
  }
742
749
 
743
- private onClientInfo(element: Element, targetInfoResponse: Protocol.Target.GetTargetInfoResponse): void {
750
+ private onClientInfo(element: HTMLElement, targetInfoResponse: Protocol.Target.GetTargetInfoResponse): void {
744
751
  const targetInfo = targetInfoResponse.targetInfo;
745
752
  if (!targetInfo) {
746
753
  return;
@@ -749,7 +756,7 @@ export class Section {
749
756
  this.updateClientInfo(element, targetInfo);
750
757
  }
751
758
 
752
- private updateClientInfo(element: Element, targetInfo: Protocol.Target.TargetInfo): void {
759
+ private updateClientInfo(element: HTMLElement, targetInfo: Protocol.Target.TargetInfo): void {
753
760
  if (targetInfo.type !== 'page' && targetInfo.type === 'iframe') {
754
761
  const clientString = element.createChild('span', 'service-worker-client-string');
755
762
  UI.UIUtils.createTextChild(clientString, i18nString(UIStrings.workerS, {PH1: targetInfo.url}));
@@ -788,7 +795,7 @@ export class Section {
788
795
  void this.manager.stopWorker(versionId);
789
796
  }
790
797
 
791
- private wrapWidget(container: Element): Element {
798
+ private wrapWidget(container: Element): HTMLElement {
792
799
  const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(container, {
793
800
  cssFile: [
794
801
  serviceWorkersViewStyles,
@@ -141,6 +141,8 @@ export class AdsView extends UI.Widget.Widget {
141
141
  averageViewportAdCount: 0,
142
142
  totalAdCpuTime: 0,
143
143
  totalAdNetworkBytes: 0,
144
+ updateAdFrames: [],
145
+ removeAdFrames: [],
144
146
  };
145
147
  this.requestUpdate();
146
148
  }
@@ -209,6 +211,8 @@ export class AdsView extends UI.Widget.Widget {
209
211
  averageViewportAdCount: 0,
210
212
  totalAdCpuTime: 0,
211
213
  totalAdNetworkBytes: 0,
214
+ updateAdFrames: [],
215
+ removeAdFrames: [],
212
216
  };
213
217
  this.requestUpdate();
214
218
  }
@@ -298,7 +298,7 @@ export class AutofillView extends UI.Widget.VBox {
298
298
  #matches: AutofillManager.AutofillManager.Match[] = [];
299
299
  #highlightedMatches: AutofillManager.AutofillManager.Match[] = [];
300
300
 
301
- constructor(autofillManager = AutofillManager.AutofillManager.AutofillManager.instance(), view = DEFAULT_VIEW) {
301
+ constructor(autofillManager: AutofillManager.AutofillManager.AutofillManager, view = DEFAULT_VIEW) {
302
302
  super({useShadowDom: true});
303
303
  this.#autofillManager = autofillManager;
304
304
  this.#view = view;
@@ -36,8 +36,9 @@ UI.ViewManager.registerViewExtension({
36
36
  commandPrompt: i18nLazyString(UIStrings.showAutofill),
37
37
  order: 100,
38
38
  persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
39
- async loadView() {
39
+ async loadView(universe) {
40
40
  const Autofill = await loadAutofillModule();
41
- return new Autofill.AutofillView.AutofillView();
41
+ const {autofillManager} = universe;
42
+ return new Autofill.AutofillView.AutofillView(autofillManager);
42
43
  },
43
44
  });
@@ -0,0 +1,142 @@
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 * as i18n from '../../core/i18n/i18n.js';
7
+
8
+ const UIStrings = {
9
+ /**
10
+ * @description Text label for a menu item indicating that no throttling is applied.
11
+ */
12
+ noThrottling: 'No throttling',
13
+ /**
14
+ * @description Text label for a menu item indicating that a specific slowdown multiplier is applied.
15
+ * @example {2} PH1
16
+ */
17
+ dSlowdown: '{PH1}× slowdown',
18
+ /**
19
+ * @description Text label for a menu item indicating an average mobile device.
20
+ */
21
+ calibratedMidTierMobile: 'Mid-tier mobile',
22
+ /**
23
+ * @description Text label for a menu item indicating a below-average mobile device.
24
+ */
25
+ calibratedLowTierMobile: 'Low-tier mobile',
26
+ /**
27
+ * @description Text label indicating why an option is not available, because the user's device is not fast enough to emulate a device.
28
+ */
29
+ calibrationErrorDeviceTooWeak: 'Device is not powerful enough',
30
+ } as const;
31
+ const str_ = i18n.i18n.registerUIStrings('panels/common/CPUThrottlingOption.ts', UIStrings);
32
+ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
33
+ const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
34
+
35
+ export enum CPUThrottlingRates {
36
+ NO_THROTTLING = 1,
37
+ MID_TIER_MOBILE = 4,
38
+ LOW_TIER_MOBILE = 6,
39
+ EXTRA_SLOW = 20,
40
+
41
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Used by web_tests.
42
+ MidTierMobile = MID_TIER_MOBILE,
43
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Used by web_tests.
44
+ LowEndMobile = LOW_TIER_MOBILE,
45
+ }
46
+
47
+ export type CalibratedDeviceType = 'low-tier-mobile'|'mid-tier-mobile';
48
+
49
+ export interface CPUThrottlingOption {
50
+ title: () => string;
51
+ rate: () => number;
52
+ calibratedDeviceType?: CalibratedDeviceType;
53
+ jslogContext: string;
54
+ }
55
+
56
+ function makeFixedPresetThrottlingOption(rate: CPUThrottlingRates): CPUThrottlingOption {
57
+ return {
58
+ title: rate === 1 ? i18nLazyString(UIStrings.noThrottling) : i18nLazyString(UIStrings.dSlowdown, {PH1: rate}),
59
+ rate: () => rate,
60
+ jslogContext: rate === 1 ? 'cpu-no-throttling' : `cpu-throttled-${rate}`,
61
+ };
62
+ }
63
+
64
+ export const NoThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.NO_THROTTLING);
65
+ export const MidTierThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.MID_TIER_MOBILE);
66
+ export const LowTierThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.LOW_TIER_MOBILE);
67
+ export const ExtraSlowThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.EXTRA_SLOW);
68
+
69
+ function makeCalibratedThrottlingOption(calibratedDeviceType: CalibratedDeviceType): CPUThrottlingOption {
70
+ const getSettingValue = (): number|CalibrationError|null => {
71
+ const setting = Common.Settings.Settings.instance().createSetting<CalibratedCPUThrottling>(
72
+ 'calibrated-cpu-throttling', {}, Common.Settings.SettingStorageType.GLOBAL);
73
+ const value = setting.get();
74
+ if (calibratedDeviceType === 'low-tier-mobile') {
75
+ return value.low ?? null;
76
+ }
77
+ if (calibratedDeviceType === 'mid-tier-mobile') {
78
+ return value.mid ?? null;
79
+ }
80
+ return null;
81
+ };
82
+
83
+ return {
84
+ title(): string {
85
+ const typeString = calibratedDeviceType === 'low-tier-mobile' ? i18nString(UIStrings.calibratedLowTierMobile) :
86
+ i18nString(UIStrings.calibratedMidTierMobile);
87
+
88
+ const value = getSettingValue();
89
+ if (typeof value === 'number') {
90
+ return `${typeString} – ${value.toFixed(1)}×`;
91
+ }
92
+
93
+ return typeString;
94
+ },
95
+ rate(): number {
96
+ const value = getSettingValue();
97
+ if (typeof value === 'number') {
98
+ return value;
99
+ }
100
+ return 0;
101
+ },
102
+ calibratedDeviceType,
103
+ jslogContext: `cpu-throttled-calibrated-${calibratedDeviceType}`,
104
+ };
105
+ }
106
+
107
+ export const CalibratedLowTierMobileThrottlingOption = makeCalibratedThrottlingOption('low-tier-mobile');
108
+ export const CalibratedMidTierMobileThrottlingOption = makeCalibratedThrottlingOption('mid-tier-mobile');
109
+
110
+ export interface CalibratedCPUThrottling {
111
+ /** Either the CPU multiplier, or an error code for why it could not be determined. */
112
+ low?: number|CalibrationError;
113
+ mid?: number|CalibrationError;
114
+ }
115
+
116
+ export enum CalibrationError {
117
+ DEVICE_TOO_WEAK = 'DEVICE_TOO_WEAK',
118
+ }
119
+
120
+ export function calibrationErrorToString(error: CalibrationError): string {
121
+ if (error === CalibrationError.DEVICE_TOO_WEAK) {
122
+ return i18nString(UIStrings.calibrationErrorDeviceTooWeak);
123
+ }
124
+
125
+ return error;
126
+ }
127
+
128
+ export const cpuThrottlingPresets: CPUThrottlingOption[] = [
129
+ NoThrottlingOption,
130
+ MidTierThrottlingOption,
131
+ LowTierThrottlingOption,
132
+ ExtraSlowThrottlingOption,
133
+ CalibratedLowTierMobileThrottlingOption,
134
+ CalibratedMidTierMobileThrottlingOption,
135
+ ];
136
+
137
+ export function determineOptionFromRate(rate: number, currentOption?: CPUThrottlingOption): CPUThrottlingOption {
138
+ if (currentOption && currentOption.rate() === rate) {
139
+ return currentOption;
140
+ }
141
+ return cpuThrottlingPresets.find(o => o.rate() === rate) || NoThrottlingOption;
142
+ }