chrome-devtools-frontend 1.0.1695017 → 1.0.1696961

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 (247) hide show
  1. package/eslint.config.mjs +4 -1
  2. package/front_end/core/common/Base64.ts +14 -4
  3. package/front_end/core/common/Gzip.ts +1 -1
  4. package/front_end/core/common/Object.ts +0 -1
  5. package/front_end/core/platform/Size.ts +43 -0
  6. package/front_end/core/platform/api/HostRuntime.ts +14 -0
  7. package/front_end/core/platform/browser/HostRuntime.ts +66 -0
  8. package/front_end/core/platform/node/HostRuntime.ts +12 -3
  9. package/front_end/core/platform/platform.ts +1 -0
  10. package/front_end/core/sdk/AccessibilityModel.ts +2 -2
  11. package/front_end/core/sdk/CSSMatchedStyles.ts +2 -0
  12. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +29 -0
  13. package/front_end/core/sdk/CSSStyleSheetHeader.ts +2 -2
  14. package/front_end/core/sdk/ConsoleModel.ts +3 -3
  15. package/front_end/core/sdk/DOMModel.ts +10 -6
  16. package/front_end/core/sdk/DebuggerModel.ts +6 -0
  17. package/front_end/core/sdk/NetworkRequest.ts +19 -19
  18. package/front_end/core/sdk/RuntimeModel.ts +5 -0
  19. package/front_end/core/sdk/Script.ts +2 -2
  20. package/front_end/core/sdk/ServerTiming.ts +6 -6
  21. package/front_end/core/sdk/SourceMap.ts +112 -14
  22. package/front_end/core/sdk/SourceMapRangeMappings.ts +43 -0
  23. package/front_end/core/sdk/SourceMapScopeChainEntry.ts +15 -10
  24. package/front_end/core/sdk/SourceMapScopesInfo.ts +92 -10
  25. package/front_end/core/sdk/sdk.ts +2 -0
  26. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +1 -1
  27. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +6 -6
  28. package/front_end/entrypoints/main/MainImpl.ts +1 -1
  29. package/front_end/generated/InspectorBackendCommands.ts +6 -3
  30. package/front_end/generated/protocol-mapping.d.ts +7 -0
  31. package/front_end/generated/protocol-proxy-api.d.ts +5 -0
  32. package/front_end/generated/protocol.ts +36 -3
  33. package/front_end/models/ai_assistance/AiAgent2.ts +27 -27
  34. package/front_end/models/ai_assistance/agents/AiAgent.ts +4 -0
  35. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
  36. package/front_end/models/ai_assistance/contexts/AccessibilityContext.ts +1 -0
  37. package/front_end/models/ai_assistance/contexts/DOMNodeContext.ts +5 -4
  38. package/front_end/models/ai_assistance/contexts/FileContext.ts +1 -0
  39. package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +1 -0
  40. package/front_end/models/ai_assistance/contexts/RequestContext.ts +1 -0
  41. package/front_end/models/ai_assistance/contexts/StorageContext.ts +1 -0
  42. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +5 -5
  43. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -6
  44. package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +5 -8
  45. package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +4 -8
  46. package/front_end/models/ai_assistance/tools/GetSourceContent.ts +7 -5
  47. package/front_end/models/ai_assistance/tools/GetStyles.ts +10 -6
  48. package/front_end/models/ai_assistance/tools/ListSources.ts +26 -7
  49. package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +5 -10
  50. package/front_end/models/ai_assistance/tools/Tool.ts +8 -1
  51. package/front_end/models/bindings/FileUtils.ts +18 -40
  52. package/front_end/models/bindings/TempFile.ts +5 -12
  53. package/front_end/models/comment_manager/CommentManager.ts +30 -6
  54. package/front_end/models/crux-manager/CrUXManager.ts +8 -5
  55. package/front_end/models/emulation/DeviceModeModel.ts +55 -105
  56. package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +1 -1
  57. package/front_end/models/issues_manager/CookieIssue.ts +1 -1
  58. package/front_end/models/issues_manager/DeprecationIssue.ts +2 -2
  59. package/front_end/models/javascript_metadata/NativeFunctions.ts +1 -5
  60. package/front_end/models/live-metrics/LiveMetrics.ts +1 -1
  61. package/front_end/models/persistence/IsolatedFileSystem.ts +16 -23
  62. package/front_end/models/trace/insights/DuplicatedJavaScript.ts +1 -1
  63. package/front_end/models/trace/insights/INPBreakdown.ts +1 -1
  64. package/front_end/models/trace/insights/ImageDelivery.ts +3 -3
  65. package/front_end/models/trace/insights/LCPDiscovery.ts +2 -2
  66. package/front_end/models/trace/insights/NetworkDependencyTree.ts +3 -3
  67. package/front_end/models/trace/insights/Viewport.ts +1 -1
  68. package/front_end/models/trace/types/Overlays.ts +2 -2
  69. package/front_end/panels/accessibility/AccessibilityNodeView.ts +2 -2
  70. package/front_end/panels/accessibility/AccessibilitySubPane.ts +0 -1
  71. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +74 -18
  72. package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +14 -3
  73. package/front_end/panels/ai_assistance/components/ChatInput.ts +1 -1
  74. package/front_end/panels/ai_assistance/components/ChatMessage.ts +1 -1
  75. package/front_end/panels/animation/AnimationUI.ts +1 -1
  76. package/front_end/panels/application/AppManifestView.ts +9 -11
  77. package/front_end/panels/application/ApplicationPanelSidebar.ts +9 -9
  78. package/front_end/panels/application/BackgroundServiceView.ts +1 -1
  79. package/front_end/panels/application/CookieItemsView.ts +1 -1
  80. package/front_end/panels/application/DOMStorageItemsView.ts +1 -1
  81. package/front_end/panels/application/DeviceBoundSessionsView.ts +2 -2
  82. package/front_end/panels/application/FrameDetailsView.ts +5 -5
  83. package/front_end/panels/application/IndexedDBViews.ts +2 -2
  84. package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -2
  85. package/front_end/panels/application/ReportingApiView.ts +1 -1
  86. package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +1 -1
  87. package/front_end/panels/application/ServiceWorkersView.ts +1 -1
  88. package/front_end/panels/application/StorageBucketsTreeElement.ts +1 -1
  89. package/front_end/panels/application/WebMCPView.ts +1 -1
  90. package/front_end/panels/application/components/AdsView.ts +136 -7
  91. package/front_end/panels/application/components/BackForwardCacheStrings.ts +116 -117
  92. package/front_end/panels/application/components/BackForwardCacheView.ts +7 -7
  93. package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +2 -2
  94. package/front_end/panels/application/components/PermissionsPolicySection.ts +2 -2
  95. package/front_end/panels/application/components/ProtocolHandlersView.ts +1 -1
  96. package/front_end/panels/application/components/ReportsGrid.ts +1 -1
  97. package/front_end/panels/application/components/StorageMetadataView.ts +1 -1
  98. package/front_end/panels/application/components/TrustTokensView.ts +3 -3
  99. package/front_end/panels/application/components/adScriptsTable.css +22 -0
  100. package/front_end/panels/application/preloading/PreloadingView.ts +20 -22
  101. package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +9 -9
  102. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +31 -33
  103. package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +23 -23
  104. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +4 -4
  105. package/front_end/panels/application/preloading/components/PreloadingString.ts +161 -161
  106. package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -6
  107. package/front_end/panels/application/preloading/components/RuleSetGrid.ts +8 -8
  108. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +32 -32
  109. package/front_end/panels/application/resourcesPanel.css +17 -17
  110. package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +1 -1
  111. package/front_end/panels/changes/ChangesView.ts +1 -1
  112. package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +1 -1
  113. package/front_end/panels/common/CPUThrottlingOption.ts +0 -1
  114. package/front_end/panels/common/GdpSignUpDialog.ts +3 -4
  115. package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
  116. package/front_end/panels/console/ConsoleInsightTeaser.ts +1 -1
  117. package/front_end/panels/console/ConsolePinPane.ts +0 -1
  118. package/front_end/panels/console/ConsoleView.ts +2 -3
  119. package/front_end/panels/console/ConsoleViewMessage.ts +2 -3
  120. package/front_end/panels/coverage/CoverageListView.ts +6 -6
  121. package/front_end/panels/coverage/CoverageView.ts +7 -7
  122. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +1 -1
  123. package/front_end/panels/elements/CSSRuleValidator.ts +10 -10
  124. package/front_end/panels/elements/ElementsPanel.ts +3 -3
  125. package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
  126. package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
  127. package/front_end/panels/elements/LayoutPane.ts +1 -1
  128. package/front_end/panels/elements/StylePropertyTreeElement.ts +85 -2
  129. package/front_end/panels/elements/StylesSidebarPane.ts +3 -3
  130. package/front_end/panels/elements/stylePropertiesTreeOutline.css +2 -1
  131. package/front_end/panels/emulation/DeviceModeView.ts +1 -1
  132. package/front_end/panels/event_listeners/EventListenersView.ts +57 -89
  133. package/front_end/panels/explain/components/ConsoleInsight.ts +4 -4
  134. package/front_end/panels/issues/AffectedPartitioningBlobURLView.ts +3 -3
  135. package/front_end/panels/issues/IssuesPane.ts +1 -1
  136. package/front_end/panels/layer_viewer/Layers3DView.ts +4 -4
  137. package/front_end/panels/layers/LayerTreeModel.ts +1 -1
  138. package/front_end/panels/lighthouse/LighthouseController.ts +4 -4
  139. package/front_end/panels/lighthouse/LighthouseStatusView.ts +10 -10
  140. package/front_end/panels/lighthouse/LighthouseTimespanView.ts +2 -2
  141. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +1 -1
  142. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +1 -1
  143. package/front_end/panels/media/MainView.ts +2 -2
  144. package/front_end/panels/mobile_throttling/CalibrationController.ts +4 -1
  145. package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +1 -1
  146. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +10 -0
  147. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +3 -3
  148. package/front_end/panels/network/NetworkConfigView.ts +26 -16
  149. package/front_end/panels/network/NetworkItemView.ts +1 -1
  150. package/front_end/panels/network/NetworkLogView.ts +4 -5
  151. package/front_end/panels/network/NetworkPanel.ts +1 -1
  152. package/front_end/panels/network/RequestConditionsDrawer.ts +3 -3
  153. package/front_end/panels/network/RequestCookiesView.ts +2 -2
  154. package/front_end/panels/network/RequestPayloadView.ts +0 -2
  155. package/front_end/panels/network/RequestTimingView.ts +1 -1
  156. package/front_end/panels/network/ResourceChunkView.ts +1 -1
  157. package/front_end/panels/network/components/HeaderSectionRow.ts +2 -2
  158. package/front_end/panels/network/components/RequestHeaderSection.ts +1 -1
  159. package/front_end/panels/network/components/RequestTrustTokensView.ts +7 -7
  160. package/front_end/panels/network/components/ResponseHeaderSection.ts +3 -4
  161. package/front_end/panels/network/network-meta.ts +1 -1
  162. package/front_end/panels/profiler/HeapDetachedElementsView.ts +1 -1
  163. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +10 -10
  164. package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
  165. package/front_end/panels/profiler/IsolateSelector.ts +4 -4
  166. package/front_end/panels/profiler/ModuleUIStrings.ts +1 -1
  167. package/front_end/panels/profiler/ProfilesPanel.ts +2 -3
  168. package/front_end/panels/recorder/RecorderPanel.ts +1 -1
  169. package/front_end/panels/search/SearchView.ts +6 -6
  170. package/front_end/panels/security/SecurityModel.ts +4 -4
  171. package/front_end/panels/security/SecurityPanel.ts +83 -54
  172. package/front_end/panels/security/SecurityPanelSidebar.ts +41 -5
  173. package/front_end/panels/security/sidebar.css +9 -10
  174. package/front_end/panels/sensors/SensorsView.ts +1 -1
  175. package/front_end/panels/settings/AISettingsTab.ts +9 -9
  176. package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
  177. package/front_end/panels/settings/KeybindsSettingsTab.ts +2 -2
  178. package/front_end/panels/settings/SettingsScreen.ts +156 -109
  179. package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
  180. package/front_end/panels/settings/components/SyncSection.ts +3 -3
  181. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +13 -13
  182. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
  183. package/front_end/panels/snippets/SnippetsQuickOpen.ts +1 -1
  184. package/front_end/panels/sources/CSSPlugin.ts +3 -3
  185. package/front_end/panels/sources/DebuggerPlugin.ts +4 -4
  186. package/front_end/panels/sources/NavigatorView.ts +3 -3
  187. package/front_end/panels/sources/OutlineQuickOpen.ts +1 -1
  188. package/front_end/panels/sources/PersistenceActions.ts +2 -2
  189. package/front_end/panels/sources/SourcesNavigator.ts +5 -5
  190. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
  191. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +0 -1
  192. package/front_end/panels/sources/components/HeadersView.ts +1 -1
  193. package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +1 -1
  194. package/front_end/panels/timeline/TimelinePaintProfilerView.ts +1 -1
  195. package/front_end/panels/timeline/TimelineUIUtils.ts +0 -1
  196. package/front_end/panels/timeline/components/ExportTraceOptions.ts +2 -2
  197. package/front_end/panels/timeline/components/FieldSettingsDialog.ts +4 -4
  198. package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -1
  199. package/front_end/panels/timeline/components/LiveMetricsView.ts +7 -7
  200. package/front_end/panels/timeline/components/MetricCard.ts +3 -3
  201. package/front_end/panels/timeline/components/MetricCompareStrings.ts +12 -14
  202. package/front_end/panels/timeline/components/OriginMap.ts +3 -3
  203. package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +4 -4
  204. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +6 -0
  205. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +1 -1
  206. package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +3 -1
  207. package/front_end/panels/timeline/timelineMiniMap.css +9 -9
  208. package/front_end/panels/timeline/timelineStatusDialog.css +9 -9
  209. package/front_end/panels/web_audio/WebAudioView.ts +1 -1
  210. package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
  211. package/front_end/third_party/chromium/README.chromium +1 -1
  212. package/front_end/ui/comments/CommentAnchorResolver.ts +114 -3
  213. package/front_end/ui/comments/CommentOverlayManager.ts +95 -16
  214. package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +1 -1
  215. package/front_end/ui/components/markdown_view/codeBlock.css +3 -8
  216. package/front_end/ui/components/markdown_view/markdownView.css +2 -7
  217. package/front_end/ui/components/panel_feedback/PanelFeedback.ts +2 -2
  218. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
  219. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
  220. package/front_end/ui/components/text_editor/AiCodeCompletionTeaser.ts +4 -4
  221. package/front_end/ui/components/text_editor/AiCodeGenerationTeaser.ts +3 -3
  222. package/front_end/{models → ui}/geometry/GeometryImpl.ts +4 -40
  223. package/front_end/ui/legacy/GlassPane.ts +1 -1
  224. package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +2 -2
  225. package/front_end/ui/legacy/SoftDropDown.ts +1 -1
  226. package/front_end/ui/legacy/SplitWidget.ts +1 -1
  227. package/front_end/ui/legacy/SuggestBox.ts +1 -1
  228. package/front_end/ui/legacy/TabbedPane.ts +1 -1
  229. package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -2
  230. package/front_end/ui/legacy/Treeoutline.ts +5 -1
  231. package/front_end/ui/legacy/UIUtils.ts +1 -1
  232. package/front_end/ui/legacy/Widget.ts +1 -1
  233. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
  234. package/front_end/ui/legacy/components/inline_editor/AnimationTimingModel.ts +1 -1
  235. package/front_end/ui/legacy/components/inline_editor/AnimationTimingUI.ts +1 -1
  236. package/front_end/ui/legacy/components/inline_editor/BezierUI.ts +1 -1
  237. package/front_end/ui/legacy/components/inline_editor/CSSAngleUtils.ts +1 -1
  238. package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
  239. package/front_end/ui/legacy/components/inline_editor/PositionAreaEditor.ts +204 -17
  240. package/front_end/ui/legacy/components/inline_editor/positionAreaEditor.css +6 -0
  241. package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +1 -1
  242. package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +1 -1
  243. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +7 -9
  244. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -1
  245. package/front_end/ui/visual_logging/KnownContextValues.ts +12 -0
  246. package/package.json +7 -4
  247. /package/front_end/{models → ui}/geometry/geometry.ts +0 -0
@@ -60,7 +60,7 @@ export const UIStrings = {
60
60
  /**
61
61
  * @description Text to indicate the status of a heap snapshot in the Performance panel.
62
62
  */
63
- finishedProcessing: 'Finished processing.',
63
+ finishedProcessing: 'Finished processing',
64
64
  /**
65
65
  * @description Text to indicate the status of a heap snapshot in the Performance panel.
66
66
  */
@@ -34,7 +34,6 @@ import * as Common from '../../core/common/common.js';
34
34
  import * as i18n from '../../core/i18n/i18n.js';
35
35
  import * as SDK from '../../core/sdk/sdk.js';
36
36
  import {createIcon} from '../../ui/kit/kit.js';
37
- // eslint-disable-next-line @devtools/es-modules-import
38
37
  import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
39
38
  import * as UI from '../../ui/legacy/legacy.js';
40
39
  import {render} from '../../ui/lit/lit.js';
@@ -75,7 +74,7 @@ const UIStrings = {
75
74
  /**
76
75
  * @description Error message when trying to load a profile while a recording is currently active.
77
76
  */
78
- cantLoadProfileWhileAnother: 'Can’t load profile while another profile is being recorded.',
77
+ cantLoadProfileWhileAnother: 'Can’t load profile while another profile is being recorded',
79
78
  /**
80
79
  * @description Error header when loading a profile file fails.
81
80
  */
@@ -84,7 +83,7 @@ const UIStrings = {
84
83
  * @description Detailed error reason string shown when profile loading fails.
85
84
  * @example {cannot open file} PH1
86
85
  */
87
- failReason: 'Reason: {PH1}.',
86
+ failReason: 'Reason: {PH1}',
88
87
  /**
89
88
  * @description Header for a profile run iteration in the Profiles sidebar.
90
89
  * @example {2} PH1
@@ -131,7 +131,7 @@ const UIStrings = {
131
131
  /**
132
132
  * @description Text to explain the usage of the Recorder panel.
133
133
  */
134
- recordingDescription: 'Use recordings to create automated end-to-end tests or performance traces.',
134
+ recordingDescription: 'Use recordings to create automated end-to-end tests or performance traces',
135
135
  /**
136
136
  * @description Link text to forward to a documentation page on the Recorder panel.
137
137
  */
@@ -62,22 +62,22 @@ const UIStrings = {
62
62
  /**
63
63
  * @description Text in the search view of the Search panel when indexing is interrupted.
64
64
  */
65
- indexingInterrupted: 'Indexing interrupted.',
65
+ indexingInterrupted: 'Indexing interrupted',
66
66
  /**
67
67
  * @description Message element text content for search results in the search view of the Search panel.
68
68
  */
69
- foundMatchingLineInFile: 'Found 1 matching line in 1 file.',
69
+ foundMatchingLineInFile: 'Found 1 matching line in 1 file',
70
70
  /**
71
71
  * @description Message element text content for search results in the search view of the Search panel.
72
72
  * @example {2} PH1
73
73
  */
74
- foundDMatchingLinesInFile: 'Found {PH1} matching lines in 1 file.',
74
+ foundDMatchingLinesInFile: 'Found {PH1} matching lines in 1 file',
75
75
  /**
76
76
  * @description Message element text content for search results in the search view of the Search panel.
77
77
  * @example {2} PH1
78
78
  * @example {2} PH2
79
79
  */
80
- foundDMatchingLinesInDFiles: 'Found {PH1} matching lines in {PH2} files.',
80
+ foundDMatchingLinesInDFiles: 'Found {PH1} matching lines in {PH2} files',
81
81
  /**
82
82
  * @description Message element text content for search results in the search view of the Search panel.
83
83
  */
@@ -89,11 +89,11 @@ const UIStrings = {
89
89
  /**
90
90
  * @description Text in the search view of the Search panel when search finishes.
91
91
  */
92
- searchFinished: 'Search finished.',
92
+ searchFinished: 'Search finished',
93
93
  /**
94
94
  * @description Text in the search view of the Search panel when search is interrupted.
95
95
  */
96
- searchInterrupted: 'Search interrupted.',
96
+ searchInterrupted: 'Search interrupted',
97
97
  /**
98
98
  * @description Text in the search view of the Search panel if the user hasn’t started a search.
99
99
  * @example {Enter} PH1
@@ -11,19 +11,19 @@ const UIStrings = {
11
11
  /**
12
12
  * @description Summary text displayed in the overview of the Security panel when the page's security state is unknown.
13
13
  */
14
- theSecurityOfThisPageIsUnknown: 'The security of this page is unknown.',
14
+ theSecurityOfThisPageIsUnknown: 'The security of this page is unknown',
15
15
  /**
16
16
  * @description Summary text displayed in the overview of the Security panel when the page isn't secure.
17
17
  */
18
- thisPageIsNotSecure: 'This page isn’t secure.',
18
+ thisPageIsNotSecure: 'This page isn’t secure',
19
19
  /**
20
20
  * @description Summary text displayed in the overview of the Security panel when the page is secure with valid HTTPS.
21
21
  */
22
- thisPageIsSecureValidHttps: 'This page is secure (valid HTTPS).',
22
+ thisPageIsSecureValidHttps: 'This page is secure (valid HTTPS)',
23
23
  /**
24
24
  * @description Summary text displayed in the overview of the Security panel when the page isn't secure due to broken HTTPS.
25
25
  */
26
- thisPageIsNotSecureBrokenHttps: 'This page isn’t secure (broken HTTPS).',
26
+ thisPageIsNotSecureBrokenHttps: 'This page isn’t secure (broken HTTPS)',
27
27
  /**
28
28
  * @description Description of an SSL cipher that contains a separate (bulk) cipher and MAC.
29
29
  * @example {AES_256_CBC} PH1
@@ -620,18 +620,6 @@ export class SecurityPanel extends UI.Panel.Panel implements SDK.TargetManager.S
620
620
  return securityPanelInstance;
621
621
  }
622
622
 
623
- static createCertificateViewerButtonForOrigin(text: string, origin: string): Element {
624
- const certificateButton = UI.UIUtils.createTextButton(text, async (e: Event) => {
625
- e.consume();
626
- const names = await SDK.NetworkManager.MultitargetNetworkManager.instance().getCertificate(origin);
627
- if (names.length > 0) {
628
- Host.InspectorFrontendHost.InspectorFrontendHostInstance.showCertificateViewer(names);
629
- }
630
- }, {className: 'origin-button', jslogContext: 'security.view-certificate-for-origin', title: text});
631
- UI.ARIAUtils.markAsButton(certificateButton);
632
- return certificateButton;
633
- }
634
-
635
623
  static createCertificateViewerButtonForCert(text: string, names: string[]): Element {
636
624
  const certificateButton = UI.UIUtils.createTextButton(text, e => {
637
625
  e.consume();
@@ -1319,12 +1307,16 @@ export class SecurityMainView extends UI.Widget.VBox {
1319
1307
 
1320
1308
  const SAN_NUM_SHOWN_WHEN_TRUNCATED = 2;
1321
1309
 
1322
- function renderSan(sanList: string[], isSanListTruncatable: boolean, isSanListTruncated: boolean,
1323
- onToggleTruncation: () => void): TemplateResult {
1310
+ function isSanListTruncatable(sanList: string[]): boolean {
1311
+ return sanList.length > SAN_NUM_SHOWN_WHEN_TRUNCATED + 1;
1312
+ }
1313
+
1314
+ function renderSan(sanList: string[], isSanListTruncated: boolean, onToggleTruncation: () => void): TemplateResult {
1324
1315
  if (sanList.length === 0) {
1325
1316
  return html`<div class="san empty-san">${i18nString(UIStrings.na)}</div>`;
1326
1317
  }
1327
1318
 
1319
+ const isTruncatable = isSanListTruncatable(sanList);
1328
1320
  const toggleButtonText =
1329
1321
  isSanListTruncated ? i18nString(UIStrings.showMoreSTotal, {PH1: sanList.length}) : i18nString(UIStrings.showLess);
1330
1322
 
@@ -1335,10 +1327,10 @@ function renderSan(sanList: string[], isSanListTruncatable: boolean, isSanListTr
1335
1327
  return html`
1336
1328
  <span class=${Directives.classMap({
1337
1329
  'san-entry': true,
1338
- 'truncated-entry': isSanListTruncatable && index >= SAN_NUM_SHOWN_WHEN_TRUNCATED,
1330
+ 'truncated-entry': isTruncatable && index >= SAN_NUM_SHOWN_WHEN_TRUNCATED,
1339
1331
  })}>${san}</span>`;
1340
1332
  })}
1341
- ${isSanListTruncatable ? html`
1333
+ ${isTruncatable ? html`
1342
1334
  <devtools-button
1343
1335
  .variant=${Buttons.Button.Variant.OUTLINED}
1344
1336
  .accessibleLabel=${toggleButtonText}
@@ -1351,8 +1343,8 @@ function renderSan(sanList: string[], isSanListTruncatable: boolean, isSanListTr
1351
1343
  }
1352
1344
 
1353
1345
  interface DetailsTableRow {
1354
- key: string;
1355
- value: string;
1346
+ key?: string;
1347
+ value: string|TemplateResult;
1356
1348
  }
1357
1349
 
1358
1350
  function renderDetailsTable(rows: DetailsTableRow[]): TemplateResult {
@@ -1361,7 +1353,7 @@ function renderDetailsTable(rows: DetailsTableRow[]): TemplateResult {
1361
1353
  <table class="details-table">
1362
1354
  ${rows.map(row => html`
1363
1355
  <tr class="details-table-row">
1364
- <td>${row.key}</td>
1356
+ <td>${row.key ?? nothing}</td>
1365
1357
  <td>${row.value}</td>
1366
1358
  </tr>`)}
1367
1359
  </table>`;
@@ -1451,6 +1443,55 @@ function renderTitleSection(origin: Platform.DevToolsPath.UrlString, securitySta
1451
1443
  // clang-format on
1452
1444
  }
1453
1445
 
1446
+ interface CertificateSectionInput {
1447
+ securityDetails: Protocol.Network.SecurityDetails;
1448
+ isSanListTruncated: boolean;
1449
+ onToggleSanTruncation: () => void;
1450
+ onViewCertificate: (event: Event) => void;
1451
+ }
1452
+
1453
+ function buildCertificateDetailsRows(input: CertificateSectionInput): DetailsTableRow[] {
1454
+ const {
1455
+ securityDetails,
1456
+ isSanListTruncated,
1457
+ onToggleSanTruncation,
1458
+ onViewCertificate,
1459
+ } = input;
1460
+ const certificateButtonText = i18nString(UIStrings.openFullCertificateDetails);
1461
+
1462
+ // clang-format off
1463
+ return [
1464
+ {key: i18nString(UIStrings.subject), value: securityDetails.subjectName},
1465
+ {
1466
+ key: i18n.i18n.lockedString('SAN'),
1467
+ value: renderSan(securityDetails.sanList, isSanListTruncated, onToggleSanTruncation),
1468
+ },
1469
+ {key: i18nString(UIStrings.validFrom), value: new Date(1000 * securityDetails.validFrom).toUTCString()},
1470
+ {key: i18nString(UIStrings.validUntil), value: new Date(1000 * securityDetails.validTo).toUTCString()},
1471
+ {key: i18nString(UIStrings.issuer), value: securityDetails.issuer},
1472
+ {
1473
+ value: html`
1474
+ <devtools-button
1475
+ class="origin-button"
1476
+ title=${certificateButtonText}
1477
+ .variant=${Buttons.Button.Variant.OUTLINED}
1478
+ .jslogContext=${'security.view-certificate-for-origin'}
1479
+ @click=${onViewCertificate}>${certificateButtonText}</devtools-button>`,
1480
+ },
1481
+ ];
1482
+ // clang-format on
1483
+ }
1484
+
1485
+ function renderCertificateSection(input: CertificateSectionInput): TemplateResult {
1486
+ const rows = buildCertificateDetailsRows(input);
1487
+
1488
+ // clang-format off
1489
+ return html`
1490
+ <div class="origin-view-section-title" role="heading" aria-level="2">${i18nString(UIStrings.certificate)}</div>
1491
+ ${renderDetailsTable(rows)}`;
1492
+ // clang-format on
1493
+ }
1494
+
1454
1495
  export class SecurityOriginView extends UI.Widget.VBox {
1455
1496
  readonly #origin: Platform.DevToolsPath.UrlString;
1456
1497
  readonly #titleSection: HTMLElement;
@@ -1471,11 +1512,7 @@ export class SecurityOriginView extends UI.Widget.VBox {
1471
1512
  // eslint-disable-next-line @devtools/no-lit-render-outside-of-view
1472
1513
  render(renderConnectionSection(originState.securityDetails), connectionSection);
1473
1514
 
1474
- // Create the certificate section outside the callback, so that it appears in the right place.
1475
- const certificateSection = this.element.createChild('div', 'origin-view-section');
1476
- const certificateDiv = certificateSection.createChild('div', 'origin-view-section-title');
1477
- certificateDiv.textContent = i18nString(UIStrings.certificate);
1478
- UI.ARIAUtils.markAsHeading(certificateDiv, 2);
1515
+ this.#createCertificateSection(originState.securityDetails);
1479
1516
 
1480
1517
  const sctListLength = originState.securityDetails.signedCertificateTimestampList.length;
1481
1518
  const ctCompliance = originState.securityDetails.certificateTransparencyCompliance;
@@ -1488,23 +1525,6 @@ export class SecurityOriginView extends UI.Widget.VBox {
1488
1525
  UI.ARIAUtils.markAsHeading(sctDiv, 2);
1489
1526
  }
1490
1527
 
1491
- const sanDiv = this.#createSanDiv(originState.securityDetails.sanList);
1492
- const validFromString = new Date(1000 * originState.securityDetails.validFrom).toUTCString();
1493
- const validUntilString = new Date(1000 * originState.securityDetails.validTo).toUTCString();
1494
-
1495
- const table = new SecurityDetailsTable();
1496
- certificateSection.appendChild(table.element());
1497
- table.addRow(i18nString(UIStrings.subject), originState.securityDetails.subjectName);
1498
- table.addRow(i18n.i18n.lockedString('SAN'), sanDiv);
1499
- table.addRow(i18nString(UIStrings.validFrom), validFromString);
1500
- table.addRow(i18nString(UIStrings.validUntil), validUntilString);
1501
- table.addRow(i18nString(UIStrings.issuer), originState.securityDetails.issuer);
1502
-
1503
- table.addRow(
1504
- '',
1505
- SecurityPanel.createCertificateViewerButtonForOrigin(
1506
- i18nString(UIStrings.openFullCertificateDetails), origin));
1507
-
1508
1528
  if (!sctSection) {
1509
1529
  return;
1510
1530
  }
@@ -1600,25 +1620,34 @@ export class SecurityOriginView extends UI.Widget.VBox {
1600
1620
  }
1601
1621
  }
1602
1622
 
1603
- #createSanDiv(sanList: string[]): Element {
1604
- const container = document.createElement('div');
1605
- const isSanListTruncatable = sanList.length > SAN_NUM_SHOWN_WHEN_TRUNCATED + 1;
1606
- let isSanListTruncated = isSanListTruncatable;
1607
-
1608
- const onToggleTruncation = (): void => {
1623
+ #createCertificateSection(securityDetails: Protocol.Network.SecurityDetails): void {
1624
+ const certificateSection = this.element.createChild('div', 'origin-view-section certificate-section');
1625
+ let isSanListTruncated = isSanListTruncatable(securityDetails.sanList);
1626
+ const onToggleSanTruncation = (): void => {
1609
1627
  isSanListTruncated = !isSanListTruncated;
1610
- updateSan();
1628
+ updateCertificateSection();
1611
1629
  };
1612
-
1613
- const updateSan = (): void => {
1630
+ const updateCertificateSection = (): void => {
1614
1631
  // eslint-disable-next-line @devtools/no-lit-render-outside-of-view
1615
- render(renderSan(sanList, isSanListTruncatable, isSanListTruncated, onToggleTruncation), container);
1632
+ render(renderCertificateSection({
1633
+ securityDetails,
1634
+ isSanListTruncated,
1635
+ onToggleSanTruncation,
1636
+ onViewCertificate: this.#showCertificateViewer,
1637
+ }),
1638
+ certificateSection);
1616
1639
  };
1617
-
1618
- updateSan();
1619
- return container;
1640
+ updateCertificateSection();
1620
1641
  }
1621
1642
 
1643
+ #showCertificateViewer = async(event: Event): Promise<void> => {
1644
+ event.consume();
1645
+ const names = await SDK.NetworkManager.MultitargetNetworkManager.instance().getCertificate(this.#origin);
1646
+ if (names.length > 0) {
1647
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.showCertificateViewer(names);
1648
+ }
1649
+ };
1650
+
1622
1651
  setSecurityState(newSecurityState: Protocol.Security.SecurityState): void {
1623
1652
  this.#renderTitleSection(newSecurityState);
1624
1653
  }
@@ -8,7 +8,7 @@ import type * as Platform from '../../core/platform/platform.js';
8
8
  import * as Protocol from '../../generated/protocol.js';
9
9
  import type {Icon} from '../../ui/kit/kit.js';
10
10
  import * as UI from '../../ui/legacy/legacy.js';
11
- import {html, nothing, render, type TemplateResult} from '../../ui/lit/lit.js';
11
+ import {Directives, html, nothing, render, type TemplateResult} from '../../ui/lit/lit.js';
12
12
 
13
13
  import lockIconStyles from './lockIcon.css.js';
14
14
  import {
@@ -106,10 +106,12 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
106
106
  }
107
107
  };
108
108
 
109
- const getGroupIcon = (group: OriginGroup, mainOriginState = Protocol.Security.SecurityState.Unknown): Icon|null => {
109
+ const getGroupIcon = (group: OriginGroup, mainOriginState: Protocol.Security.SecurityState|null): Icon|null => {
110
110
  switch (group) {
111
111
  case OriginGroup.MainOrigin:
112
- return getSecurityStateIconForOverview(mainOriginState, `lock-icon lock-icon-${mainOriginState}`);
112
+ return mainOriginState ?
113
+ getSecurityStateIconForOverview(mainOriginState, `lock-icon lock-icon-${mainOriginState}`) :
114
+ null;
113
115
  case OriginGroup.NonSecure:
114
116
  return getSecurityStateIconForDetailedView(Protocol.Security.SecurityState.Insecure,
115
117
  `lock-icon lock-icon-${Protocol.Security.SecurityState.Insecure}`);
@@ -128,7 +130,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
128
130
  originsByGroup.set(group, []);
129
131
  }
130
132
 
131
- let mainOriginState = Protocol.Security.SecurityState.Unknown;
133
+ let mainOriginState: Protocol.Security.SecurityState|null = null;
132
134
  const overviewIcon = getSecurityStateIconForOverview(input.overviewSecurityState,
133
135
  'lock-icon lock-icon-' + input.overviewSecurityState);
134
136
  for (const [origin, state] of input.origins) {
@@ -169,7 +171,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
169
171
  ${i18nString(UIStrings.reloadToViewDetails)}
170
172
  </li>
171
173
  ` : nothing}
172
- ${origins.map(o => renderOrigin(o.origin, o.state))}
174
+ ${Directives.repeat(origins, o => o.origin, o => renderOrigin(o.origin, o.state))}
173
175
  </ul>
174
176
  </li>
175
177
  `;
@@ -179,6 +181,8 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
179
181
  // clang-format off
180
182
  render(html`
181
183
  <devtools-tree class="security-sidebar" navigation-variant .template=${html`
184
+ <style>${sidebarStyles}</style>
185
+ <style>${lockIconStyles}</style>
182
186
  <ul role="tree">
183
187
  <li role="treeitem" class="security-group-list-item" aria-level="3" aria-label=${i18nString(UIStrings.security)}>
184
188
  ${i18nString(UIStrings.security)}
@@ -274,6 +278,38 @@ export class SecurityPanelSidebar extends UI.Widget.VBox {
274
278
  this.requestUpdate();
275
279
  }
276
280
 
281
+ // Used in web tests
282
+ elementsByOrigin(): Map<string, {
283
+ select: (omitFocus?: boolean, selectedByUser?: boolean) => void,
284
+ showElement: () => void,
285
+ origin: () => string,
286
+ securityState: () => Protocol.Security.SecurityState | undefined,
287
+ }> {
288
+ const map = new Map<string, {
289
+ select: (omitFocus?: boolean, selectedByUser?: boolean) => void,
290
+ showElement: () => void,
291
+ origin: () => string,
292
+ securityState: () => Protocol.Security.SecurityState | undefined,
293
+ }>();
294
+ for (const [origin, state] of this.#origins.entries()) {
295
+ const element = {
296
+ select: () => {
297
+ this.#selectedElementId = origin;
298
+ this.#securitySidebarLastItemSetting.set(origin);
299
+ this.requestUpdate();
300
+ this.#onShowOrigin?.(origin);
301
+ },
302
+ showElement: () => {
303
+ this.#onShowOrigin?.(origin);
304
+ },
305
+ origin: () => origin,
306
+ securityState: () => state,
307
+ };
308
+ map.set(origin, element);
309
+ }
310
+ return map;
311
+ }
312
+
277
313
  set selectedOrigin(origin: Platform.DevToolsPath.UrlString|null) {
278
314
  this.#selectedElementId = origin ?? 'overview';
279
315
  this.#securitySidebarLastItemSetting.set(this.#selectedElementId);
@@ -26,17 +26,16 @@
26
26
  color: var(--sys-color-token-subtle);
27
27
  }
28
28
 
29
- .tree-outline li.security-sidebar-origins + .children > li {
30
- &.selected {
31
- .url-scheme-secure {
32
- color: var(--sys-color-green);
33
- }
29
+ .tree-outline li.selected,
30
+ li.security-sidebar-tree-item[selected] {
31
+ .url-scheme-secure {
32
+ color: var(--sys-color-green);
33
+ }
34
34
 
35
- .url-scheme-neutral,
36
- .url-scheme-insecure,
37
- .url-scheme-insecure-broken {
38
- color: var(--sys-color-error);
39
- }
35
+ .url-scheme-neutral,
36
+ .url-scheme-insecure,
37
+ .url-scheme-insecure-broken {
38
+ color: var(--sys-color-error);
40
39
  }
41
40
  }
42
41
 
@@ -7,8 +7,8 @@ import * as Common from '../../core/common/common.js';
7
7
  import * as Host from '../../core/host/host.js';
8
8
  import * as i18n from '../../core/i18n/i18n.js';
9
9
  import * as SDK from '../../core/sdk/sdk.js';
10
- import * as Geometry from '../../models/geometry/geometry.js';
11
10
  import * as Buttons from '../../ui/components/buttons/buttons.js';
11
+ import * as Geometry from '../../ui/geometry/geometry.js';
12
12
  import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
13
13
  import * as UI from '../../ui/legacy/legacy.js';
14
14
  import {Directives, html, render} from '../../ui/lit/lit.js';
@@ -168,12 +168,12 @@ const UIStrings = {
168
168
  * @description Second item in the description of the code suggestions feature.
169
169
  */
170
170
  describeCodeInComment:
171
- 'In Console or Sources, describe the code you need in a comment, then press Ctrl+I to generate it.',
171
+ 'In Console or Sources, describe the code you need in a comment, then press Ctrl+I to generate it',
172
172
  /**
173
173
  * @description Second item in the description of the code suggestions feature for macOS.
174
174
  */
175
175
  describeCodeInCommentForMacOs:
176
- 'In Console or Sources, describe the code you need in a comment, then press Cmd+I to generate it.',
176
+ 'In Console or Sources, describe the code you need in a comment, then press Cmd+I to generate it',
177
177
  /**
178
178
  * @description Explainer for which data is being sent for the code suggestions feature.
179
179
  */
@@ -211,34 +211,34 @@ const UIStrings = {
211
211
  /**
212
212
  * @description Message shown to the user if the age check isn't successful.
213
213
  */
214
- ageRestricted: 'This feature is only available to users 18 years or older.',
214
+ ageRestricted: 'This feature is only available to users 18 years or older',
215
215
  /**
216
216
  * @description The error message when the user isn't logged in to Chrome.
217
217
  */
218
- notLoggedIn: 'This feature is only available when you sign in to Chrome with your Google account.',
218
+ notLoggedIn: 'This feature is only available when you sign in to Chrome with your Google account',
219
219
  /**
220
220
  * @description Message shown when the user is offline.
221
221
  */
222
- offline: 'This feature is only available with an active internet connection.',
222
+ offline: 'This feature is only available with an active internet connection',
223
223
  /**
224
224
  * @description Text informing the user that AI assistance isn't available in Incognito mode or Guest mode.
225
225
  */
226
- notAvailableInIncognitoMode: 'AI assistance isn’t available in Incognito mode or Guest mode.',
226
+ notAvailableInIncognitoMode: 'AI assistance isn’t available in Incognito mode or Guest mode',
227
227
  /**
228
228
  * @description Message shown to the user if the DevTools locale is not
229
229
  * supported.
230
230
  */
231
- wrongLocale: 'To use this feature, set your language preference to English in DevTools settings.',
231
+ wrongLocale: 'To use this feature, set your language preference to English in DevTools settings',
232
232
  /**
233
233
  * @description Message shown to the user if the user's region is not
234
234
  * supported.
235
235
  */
236
- geoRestricted: 'This feature is unavailable in your region.',
236
+ geoRestricted: 'This feature is unavailable in your region',
237
237
  /**
238
238
  * @description Message shown to the user if the enterprise policy does
239
239
  * not allow this feature.
240
240
  */
241
- policyRestricted: 'This setting is managed by your administrator.',
241
+ policyRestricted: 'This setting is managed by your administrator',
242
242
  } as const;
243
243
  const str_ = i18n.i18n.registerUIStrings('panels/settings/AISettingsTab.ts', UIStrings);
244
244
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -26,7 +26,7 @@ const UIStrings = {
26
26
  * @description Checkbox label in Framework Ignore List settings tab of the Settings.
27
27
  */
28
28
  ignoreListingDescription:
29
- 'When enabled, the debugger will skip over ignore-listed scripts and will ignore exceptions that only affect them and the Performance panel will collapse matching flamechart items.',
29
+ 'When enabled, the debugger will skip over ignore-listed scripts and will ignore exceptions that only affect them and the Performance panel will collapse matching flamechart items',
30
30
  /**
31
31
  * @description Text in Framework Ignore List settings tab of the Settings.
32
32
  */
@@ -65,13 +65,13 @@ const UIStrings = {
65
65
  /**
66
66
  * @description Message shown in Settings when the user inputs a modifier-only shortcut such as Ctrl+Shift.
67
67
  */
68
- shortcutsCannotContainOnly: 'Shortcuts can’t contain only modifier keys.',
68
+ shortcutsCannotContainOnly: 'Shortcuts can’t contain only modifier keys',
69
69
  /**
70
70
  * @description Message shown in shortcuts settings when the user inputs a shortcut that is already in use.
71
71
  * @example {Performance} PH1
72
72
  * @example {Start/stop recording} PH2
73
73
  */
74
- thisShortcutIsInUseByS: 'This shortcut is in use by {PH1}: {PH2}.',
74
+ thisShortcutIsInUseByS: 'This shortcut is in use by {PH1}: {PH2}',
75
75
  /**
76
76
  * @description Message shown in Settings when restoring default shortcuts.
77
77
  */