chrome-devtools-frontend 1.0.1736236 → 1.0.1738725

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 (134) hide show
  1. package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +1 -1
  2. package/.agents/skills/version-control/SKILL.md +63 -11
  3. package/docs/devtools-protocol.md +3 -1
  4. package/eslint.config.mjs +0 -6
  5. package/front_end/core/host/AidaClient.ts +14 -36
  6. package/front_end/core/host/AidaGcaTranslation.ts +8 -5
  7. package/front_end/core/root/Runtime.ts +0 -5
  8. package/front_end/design_system_tokens.css +1 -0
  9. package/front_end/entrypoints/main/GlobalAiButton.ts +2 -9
  10. package/front_end/entrypoints/main/MainImpl.ts +0 -4
  11. package/front_end/generated/SupportedCSSProperties.ts +8 -23
  12. package/front_end/models/ai-utils/AiUtils.ts +1 -5
  13. package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -18
  14. package/front_end/models/ai_assistance/contexts/FileContext.ts +1 -2
  15. package/front_end/models/ai_assistance/tools/ListSources.ts +3 -1
  16. package/front_end/models/ai_code_generation/AiCodeGeneration.ts +0 -6
  17. package/front_end/models/javascript_metadata/NativeFunctions.ts +9 -5
  18. package/front_end/models/trace/EventsSerializer.ts +0 -8
  19. package/front_end/models/workspace/UISourceCode.ts +30 -8
  20. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -7
  21. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +15 -34
  22. package/front_end/panels/ai_assistance/components/ChatView.ts +2 -16
  23. package/front_end/panels/ai_assistance/components/chatView.css +0 -32
  24. package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
  25. package/front_end/panels/animation/AnimationTimeline.ts +1 -1
  26. package/front_end/panels/animation/animationTimeline.css +5 -3
  27. package/front_end/panels/application/PrivateVerificationTokensView.ts +114 -26
  28. package/front_end/panels/application/ResourcesPanel.ts +1 -0
  29. package/front_end/panels/application/backgroundServiceView.css +2 -2
  30. package/front_end/panels/application/components/permissionsPolicySection.css +0 -4
  31. package/front_end/panels/application/frameDetailsReportView.css +0 -7
  32. package/front_end/panels/application/indexedDBViews.css +3 -3
  33. package/front_end/panels/application/privateVerificationTokensView.css +6 -0
  34. package/front_end/panels/application/serviceWorkerUpdateCycleView.css +1 -1
  35. package/front_end/panels/application/serviceWorkersView.css +2 -2
  36. package/front_end/panels/comments/CommentsPane.ts +1 -1
  37. package/front_end/panels/comments/commentsPane.css +1 -1
  38. package/front_end/panels/common/common.ts +0 -1
  39. package/front_end/panels/console/ConsoleView.ts +11 -1
  40. package/front_end/panels/console/ConsoleViewMessage.ts +5 -1
  41. package/front_end/panels/console/consolePinPane.css +1 -1
  42. package/front_end/panels/console/consoleView.css +5 -4
  43. package/front_end/panels/elements/DOMTreeWidget.ts +47 -5
  44. package/front_end/panels/elements/layoutPane.css +0 -1
  45. package/front_end/panels/emulation/InspectedPagePlaceholder.ts +1 -0
  46. package/front_end/panels/emulation/deviceModeView.css +0 -1
  47. package/front_end/panels/issues/issuesTree.css +2 -2
  48. package/front_end/panels/layer_viewer/LayerDetailsView.ts +34 -17
  49. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +39 -17
  50. package/front_end/panels/layer_viewer/Layers3DView.ts +34 -13
  51. package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
  52. package/front_end/panels/layer_viewer/layers3DView.css +0 -4
  53. package/front_end/panels/media/playerListView.css +0 -18
  54. package/front_end/panels/media/playerPropertiesView.css +1 -1
  55. package/front_end/panels/network/NetworkWaterfallColumn.ts +22 -10
  56. package/front_end/panels/network/RequestPreviewView.ts +182 -63
  57. package/front_end/panels/network/SignedExchangeInfoView.ts +242 -158
  58. package/front_end/panels/network/networkConfigView.css +1 -1
  59. package/front_end/panels/network/networkLogView.css +2 -1
  60. package/front_end/panels/network/networkPanel.css +0 -5
  61. package/front_end/panels/network/networkTimingTable.css +1 -1
  62. package/front_end/panels/network/signedExchangeInfoView.css +12 -8
  63. package/front_end/panels/performance_monitor/performanceMonitor.css +2 -2
  64. package/front_end/panels/profiler/IsolateSelector.ts +31 -10
  65. package/front_end/panels/profiler/profilesPanel.css +0 -8
  66. package/front_end/panels/protocol_monitor/JSONEditor.css +1 -1
  67. package/front_end/panels/screencast/screencastView.css +2 -2
  68. package/front_end/panels/security/SecurityPanel.ts +474 -418
  69. package/front_end/panels/security/SecurityPanelSidebar.ts +68 -48
  70. package/front_end/panels/security/lockIcon.css +52 -50
  71. package/front_end/panels/security/mainView.css +149 -145
  72. package/front_end/panels/security/originView.css +117 -115
  73. package/front_end/panels/sensors/LocationsSettingsTab.ts +2 -50
  74. package/front_end/panels/sensors/locationsSettingsTab.css +1 -21
  75. package/front_end/panels/settings/AISettingsTab.ts +1 -2
  76. package/front_end/panels/settings/SettingsScreen.ts +1 -1
  77. package/front_end/panels/sources/CallStackSidebarPane.ts +31 -6
  78. package/front_end/panels/sources/NavigatorView.ts +105 -31
  79. package/front_end/panels/sources/breakpointsView.css +2 -1
  80. package/front_end/panels/sources/scopeChainSidebarPane.css +1 -1
  81. package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -0
  82. package/front_end/panels/timeline/TimelineLayersView.ts +108 -46
  83. package/front_end/panels/timeline/TimelinePanel.ts +4 -2
  84. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -1
  85. package/front_end/panels/timeline/components/networkRequestDetails.css +1 -1
  86. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +0 -7
  87. package/front_end/panels/web_audio/webAudio.css +1 -2
  88. package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
  89. package/front_end/panels/whats_new/ReleaseNoteText.ts +6 -6
  90. package/front_end/panels/whats_new/resources/WNDT.md +6 -6
  91. package/front_end/third_party/chromium/README.chromium +1 -1
  92. package/front_end/ui/comments/CommentAnchorResolver.ts +45 -4
  93. package/front_end/ui/comments/CommentOverlayManager.ts +45 -12
  94. package/front_end/ui/components/buttons/FloatingButton.ts +2 -6
  95. package/front_end/ui/components/buttons/button.css +2 -2
  96. package/front_end/ui/components/buttons/floatingButton.css +0 -44
  97. package/front_end/ui/components/icon_button/iconButton.css +1 -1
  98. package/front_end/ui/components/markdown_view/markdownView.css +1 -1
  99. package/front_end/ui/legacy/ContextMenu.ts +7 -5
  100. package/front_end/ui/legacy/InspectorDrawerView.ts +1 -0
  101. package/front_end/ui/legacy/InspectorView.ts +5 -1
  102. package/front_end/ui/legacy/PopoverHelper.ts +1 -0
  103. package/front_end/ui/legacy/RootView.ts +9 -3
  104. package/front_end/ui/legacy/SplitWidget.ts +1 -0
  105. package/front_end/ui/legacy/Treeoutline.ts +9 -0
  106. package/front_end/ui/legacy/UIUtils.ts +1 -1
  107. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +130 -137
  108. package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
  109. package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +1 -0
  110. package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +1 -1
  111. package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +3 -1
  112. package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +7 -6
  113. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -0
  114. package/front_end/ui/legacy/components/perf_ui/pieChart.css +2 -2
  115. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +1 -10
  116. package/front_end/ui/legacy/filter.css +1 -1
  117. package/front_end/ui/legacy/infobar.css +1 -1
  118. package/front_end/ui/legacy/inspectorCommon.css +2 -2
  119. package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +3 -3
  120. package/front_end/ui/legacy/listWidget.css +2 -7
  121. package/front_end/ui/legacy/softDropDownButton.css +1 -1
  122. package/front_end/ui/legacy/tabbedPane.css +2 -1
  123. package/front_end/ui/legacy/treeoutline.css +3 -2
  124. package/front_end/ui/visual_logging/KnownContextValues.ts +133 -0
  125. package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
  126. package/package.json +1 -1
  127. package/front_end/Images/geminiInDevTools.png +0 -0
  128. package/front_end/Images/geminiInDevTools_2x.png +0 -0
  129. package/front_end/generated/InspectorBackendCommands.ts +0 -1690
  130. package/front_end/generated/protocol-mapping.d.ts +0 -5986
  131. package/front_end/generated/protocol-proxy-api.d.ts +0 -5452
  132. package/front_end/generated/protocol.ts +0 -23364
  133. package/front_end/panels/common/GeminiRebrandPromoDialog.ts +0 -193
  134. package/front_end/panels/common/geminiRebrandPromoDialog.css +0 -47
@@ -1,19 +1,22 @@
1
1
  // Copyright 2018 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
- /* eslint-disable @devtools/no-imperative-dom-api */
5
4
 
5
+ import '../../ui/kit/kit.js';
6
+
7
+ import * as Common from '../../core/common/common.js';
6
8
  import * as Host from '../../core/host/host.js';
7
9
  import * as i18n from '../../core/i18n/i18n.js';
8
10
  import type * as SDK from '../../core/sdk/sdk.js';
9
11
  import * as Protocol from '../../generated/protocol.js';
10
- import {Icon, Link} from '../../ui/kit/kit.js';
11
- import * as Components from '../../ui/legacy/components/utils/utils.js';
12
12
  import * as UI from '../../ui/legacy/legacy.js';
13
+ import {Directives, html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
13
14
 
14
15
  import signedExchangeInfoTreeStyles from './signedExchangeInfoTree.css.js';
15
16
  import signedExchangeInfoViewStyles from './signedExchangeInfoView.css.js';
16
17
 
18
+ const {classMap} = Directives;
19
+
17
20
  const UIStrings = {
18
21
  /**
19
22
  * @description Text for errors
@@ -102,178 +105,259 @@ const UIStrings = {
102
105
  } as const;
103
106
  const str_ = i18n.i18n.registerUIStrings('panels/network/SignedExchangeInfoView.ts', UIStrings);
104
107
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
105
- export class SignedExchangeInfoView extends UI.Widget.VBox {
106
- private readonly responseHeadersItem?: UI.TreeOutline.TreeElement;
108
+ export interface ViewInput {
109
+ errors: string[];
110
+ header: {
111
+ requestUrl: string,
112
+ hasRedirectDestination: boolean,
113
+ responseCode: string,
114
+ headerIntegrity: string,
115
+ responseHeaders: Array<{name: string, value: string}>,
116
+ signatures: Array<{
117
+ label: string,
118
+ signature: string,
119
+ hasSignatureError: boolean,
120
+ hasCertUrlError: boolean,
121
+ integrity: string,
122
+ hasIntegrityError: boolean,
123
+ hasCertSha256Error: boolean,
124
+ validityUrl: string,
125
+ hasValidityUrlError: boolean,
126
+ date: string,
127
+ expires: string,
128
+ hasTimestampsError: boolean,
129
+ certUrl?: string,
130
+ certificates?: string[],
131
+ certSha256?: string,
132
+ }>,
133
+ }|null;
134
+ securityDetails: {
135
+ subjectName: string,
136
+ validFrom: string,
137
+ validUntil: string,
138
+ issuer: string,
139
+ }|null;
140
+ onViewRequest: () => void;
141
+ onViewCertificate: (certificates: string[]) => void;
142
+ }
107
143
 
108
- constructor(request: SDK.NetworkRequest.NetworkRequest, element?: HTMLElement) {
109
- super(element);
110
- this.registerRequiredCSS(signedExchangeInfoViewStyles);
111
- console.assert(request.signedExchangeInfo() !== null);
112
- const signedExchangeInfo = (request.signedExchangeInfo() as Protocol.Network.SignedExchangeInfo);
144
+ export type View = (input: ViewInput|null, output: undefined, target: HTMLElement) => void;
113
145
 
114
- this.element.classList.add('signed-exchange-info-view');
146
+ export const DEFAULT_VIEW: View = (input, _output, target) => {
147
+ if (!input) {
148
+ render(nothing, target);
149
+ return;
150
+ }
151
+ const {formatHeader, formatHeaderForHexData} = SignedExchangeInfoView;
152
+ const renderLeaf = (content: LitTemplate): LitTemplate =>
153
+ html`<li role="treeitem" selectable="false">${content}</li>`;
154
+ const renderCategory = (title: LitTemplate|string, children: LitTemplate|LitTemplate[]): LitTemplate => html`
155
+ <li role="treeitem" toggle-on-click open selectable="false">
156
+ ${title}
157
+ <ul role="group">${children}</ul>
158
+ </li>`;
115
159
 
116
- const root = new UI.TreeOutline.TreeOutlineInShadow();
117
- root.registerRequiredCSS(signedExchangeInfoTreeStyles);
118
- root.element.classList.add('signed-exchange-info-tree');
119
- root.setFocusable(false);
120
- root.setDense(true);
121
- root.expandTreeElementsWhenArrowing = true;
122
- this.element.appendChild(root.element);
160
+ // clang-format off
161
+ render(
162
+ html`
163
+ <style>${signedExchangeInfoViewStyles}</style>
164
+ <devtools-tree dense class="signed-exchange-info-tree" .template=${html`
165
+ <style>${signedExchangeInfoTreeStyles}</style>
166
+ <ul role="tree">
167
+ ${input.errors.length ? renderCategory(
168
+ i18nString(UIStrings.errors),
169
+ input.errors.map(errorMessage => renderLeaf(html`
170
+ <devtools-icon name="cross-circle-filled" class="prompt-icon small"></devtools-icon><div
171
+ class="error-log">${errorMessage}</div>`)),
172
+ ) : nothing}
173
+ ${renderCategory(
174
+ html`<div class="header-name">${i18nString(UIStrings.signedHttpExchange)}</div><devtools-link
175
+ href="https://github.com/WICG/webpackage"
176
+ class="header-toggle devtools-link"
177
+ jslogcontext="learn-more">${i18nString(UIStrings.learnmore)}</devtools-link>`,
178
+ input.header ? html`
179
+ ${renderLeaf(html`${formatHeader(i18nString(UIStrings.requestUrl), input.header.requestUrl)}${
180
+ input.header.hasRedirectDestination ? html`<devtools-link
181
+ class="header-toggle devtools-link"
182
+ jslogcontext="redirect-destination-request"
183
+ @click=${input.onViewRequest}>${i18n.i18n.lockedString('View request')}</devtools-link>` : nothing}`)}
184
+ ${renderLeaf(formatHeader(i18nString(UIStrings.responseCode), input.header.responseCode))}
185
+ ${renderLeaf(formatHeader(i18nString(UIStrings.headerIntegrityHash), input.header.headerIntegrity))}
186
+ <li role="treeitem" open selectable="false">
187
+ ${formatHeader(i18nString(UIStrings.responseHeaders), '')}
188
+ ${input.header.responseHeaders.length ? html`
189
+ <ul role="group">
190
+ ${input.header.responseHeaders.map(header => renderLeaf(formatHeader(header.name, header.value)))}
191
+ </ul>
192
+ ` : nothing}
193
+ </li>
194
+ ` : nothing,
195
+ )}
196
+ ${(input.header?.signatures ?? []).map(signature => renderCategory(
197
+ i18nString(UIStrings.signature),
198
+ html`
199
+ ${renderLeaf(formatHeader(i18nString(UIStrings.label), signature.label))}
200
+ ${renderLeaf(formatHeaderForHexData(i18nString(UIStrings.signature), signature.signature, signature.hasSignatureError))}
201
+ ${signature.certUrl ? renderLeaf(html`
202
+ ${formatHeader(i18nString(UIStrings.certificateUrl), signature.certUrl, signature.hasCertUrlError)}${
203
+ signature.certificates ? html`<devtools-link
204
+ class="devtools-link header-toggle"
205
+ jslogcontext="view-certificate"
206
+ @click=${() => input.onViewCertificate(signature.certificates ?? [])}>${
207
+ i18nString(UIStrings.viewCertificate)}</devtools-link>` : nothing}`) : nothing}
208
+ ${renderLeaf(formatHeader(i18nString(UIStrings.integrity), signature.integrity, signature.hasIntegrityError))}
209
+ ${signature.certSha256 ? renderLeaf(formatHeaderForHexData(
210
+ i18nString(UIStrings.certificateSha), signature.certSha256, signature.hasCertSha256Error)) : nothing}
211
+ ${renderLeaf(formatHeader(i18nString(UIStrings.validityUrl), signature.validityUrl, signature.hasValidityUrlError))}
212
+ ${renderLeaf(formatHeader(i18nString(UIStrings.date), signature.date, signature.hasTimestampsError))}
213
+ ${renderLeaf(formatHeader(i18nString(UIStrings.expires), signature.expires, signature.hasTimestampsError))}
214
+ `,
215
+ ))}
216
+ ${input.securityDetails ? renderCategory(
217
+ i18nString(UIStrings.certificate),
218
+ html`
219
+ ${renderLeaf(formatHeader(i18nString(UIStrings.subject), input.securityDetails.subjectName))}
220
+ ${renderLeaf(formatHeader(i18nString(UIStrings.validFrom), input.securityDetails.validFrom))}
221
+ ${renderLeaf(formatHeader(i18nString(UIStrings.validUntil), input.securityDetails.validUntil))}
222
+ ${renderLeaf(formatHeader(i18nString(UIStrings.issuer), input.securityDetails.issuer))}
223
+ `,
224
+ ) : nothing}
225
+ </ul>
226
+ `}></devtools-tree>
227
+ `,
228
+ target,
229
+ {container: {classes: ['signed-exchange-info-view']}},
230
+ );
231
+ // clang-format on
232
+ };
123
233
 
124
- const errorFieldSetMap = new Map<number|undefined, Set<string>>();
234
+ export class SignedExchangeInfoView extends UI.Widget.VBox {
235
+ #request?: SDK.NetworkRequest.NetworkRequest;
236
+ readonly #view: View;
125
237
 
126
- if (signedExchangeInfo.errors?.length) {
127
- const errorMessagesCategory = new Category(root, i18nString(UIStrings.errors));
128
- for (const error of signedExchangeInfo.errors) {
129
- const fragment = document.createDocumentFragment();
130
- const icon = new Icon();
131
- icon.name = 'cross-circle-filled';
132
- icon.classList.add('prompt-icon', 'small');
133
- fragment.appendChild(icon);
134
- fragment.createChild('div', 'error-log').textContent = error.message;
135
- errorMessagesCategory.createLeaf(fragment);
136
- if (error.errorField) {
137
- let errorFieldSet = errorFieldSetMap.get(error.signatureIndex);
138
- if (!errorFieldSet) {
139
- errorFieldSet = new Set();
140
- errorFieldSetMap.set(error.signatureIndex, errorFieldSet);
141
- }
142
- errorFieldSet.add(error.errorField);
143
- }
144
- }
238
+ constructor(
239
+ requestOrElement?: SDK.NetworkRequest.NetworkRequest|HTMLElement,
240
+ elementOrView?: HTMLElement|View,
241
+ view: View = DEFAULT_VIEW,
242
+ ) {
243
+ super(
244
+ requestOrElement instanceof HTMLElement ? requestOrElement :
245
+ elementOrView instanceof HTMLElement ? elementOrView :
246
+ undefined,
247
+ );
248
+ this.#view = typeof elementOrView === 'function' ? elementOrView : view;
249
+ if (requestOrElement && !(requestOrElement instanceof HTMLElement)) {
250
+ this.#request = requestOrElement;
145
251
  }
252
+ }
146
253
 
147
- const titleElement = document.createDocumentFragment();
148
- titleElement.createChild('div', 'header-name').textContent = i18nString(UIStrings.signedHttpExchange);
149
- const learnMoreNode = Link.create(
150
- 'https://github.com/WICG/webpackage', i18nString(UIStrings.learnmore), 'header-toggle', 'learn-more');
151
- titleElement.appendChild(learnMoreNode);
152
- const headerCategory = new Category(root, titleElement);
153
- if (signedExchangeInfo.header) {
154
- const header = signedExchangeInfo.header;
155
- const redirectDestination = request.redirectDestination();
156
- const requestURLElement = this.formatHeader(i18nString(UIStrings.requestUrl), header.requestUrl);
157
- if (redirectDestination) {
158
- const viewRequestLink = Components.Linkifier.Linkifier.linkifyRevealable(
159
- redirectDestination, 'View request', undefined, undefined, undefined, 'redirect-destination-request');
160
- viewRequestLink.classList.add('header-toggle');
161
- requestURLElement.appendChild(viewRequestLink);
162
- }
163
- headerCategory.createLeaf(requestURLElement);
164
- headerCategory.createLeaf(this.formatHeader(i18nString(UIStrings.responseCode), String(header.responseCode)));
165
- headerCategory.createLeaf(this.formatHeader(i18nString(UIStrings.headerIntegrityHash), header.headerIntegrity));
166
-
167
- this.responseHeadersItem =
168
- headerCategory.createLeaf(this.formatHeader(i18nString(UIStrings.responseHeaders), ''));
169
- const responseHeaders = header.responseHeaders;
170
- for (const name in responseHeaders) {
171
- const headerTreeElement = new UI.TreeOutline.TreeElement(this.formatHeader(name, responseHeaders[name]));
172
- headerTreeElement.selectable = false;
173
- this.responseHeadersItem.appendChild(headerTreeElement);
174
- }
175
- this.responseHeadersItem.expand();
176
-
177
- for (let i = 0; i < header.signatures.length; ++i) {
178
- const errorFieldSet = errorFieldSetMap.get(i) || new Set();
179
- const signature = header.signatures[i];
180
- const signatureCategory = new Category(root, i18nString(UIStrings.signature));
181
- signatureCategory.createLeaf(this.formatHeader(i18nString(UIStrings.label), signature.label));
182
- signatureCategory.createLeaf(this.formatHeaderForHexData(
183
- i18nString(UIStrings.signature), signature.signature,
184
- errorFieldSet.has(Protocol.Network.SignedExchangeErrorField.SignatureSig)));
254
+ get request(): SDK.NetworkRequest.NetworkRequest|undefined {
255
+ return this.#request;
256
+ }
185
257
 
186
- if (signature.certUrl) {
187
- const certURLElement = this.formatHeader(
188
- i18nString(UIStrings.certificateUrl), signature.certUrl,
189
- errorFieldSet.has(Protocol.Network.SignedExchangeErrorField.SignatureCertUrl));
190
- if (signature.certificates) {
191
- const viewCertLink = certURLElement.createChild('span', 'devtools-link header-toggle');
192
- viewCertLink.textContent = i18nString(UIStrings.viewCertificate);
193
- viewCertLink.addEventListener(
194
- 'click',
195
- Host.InspectorFrontendHost.InspectorFrontendHostInstance.showCertificateViewer.bind(
196
- null, signature.certificates),
197
- false);
198
- }
199
- signatureCategory.createLeaf(certURLElement);
200
- }
201
- signatureCategory.createLeaf(this.formatHeader(
202
- i18nString(UIStrings.integrity), signature.integrity,
203
- errorFieldSet.has(Protocol.Network.SignedExchangeErrorField.SignatureIntegrity)));
204
- if (signature.certSha256) {
205
- signatureCategory.createLeaf(this.formatHeaderForHexData(
206
- i18nString(UIStrings.certificateSha), signature.certSha256,
207
- errorFieldSet.has(Protocol.Network.SignedExchangeErrorField.SignatureCertSha256)));
208
- }
209
- signatureCategory.createLeaf(this.formatHeader(
210
- i18nString(UIStrings.validityUrl), signature.validityUrl,
211
- errorFieldSet.has(Protocol.Network.SignedExchangeErrorField.SignatureValidityUrl)));
212
- signatureCategory.createLeaf().title = this.formatHeader(
213
- i18nString(UIStrings.date), new Date(1000 * signature.date).toUTCString(),
214
- errorFieldSet.has(Protocol.Network.SignedExchangeErrorField.SignatureTimestamps));
215
- signatureCategory.createLeaf().title = this.formatHeader(
216
- i18nString(UIStrings.expires), new Date(1000 * signature.expires).toUTCString(),
217
- errorFieldSet.has(Protocol.Network.SignedExchangeErrorField.SignatureTimestamps));
218
- }
219
- }
220
- if (signedExchangeInfo.securityDetails) {
221
- const securityDetails = signedExchangeInfo.securityDetails;
222
- const securityCategory = new Category(root, i18nString(UIStrings.certificate));
223
- securityCategory.createLeaf(this.formatHeader(i18nString(UIStrings.subject), securityDetails.subjectName));
224
- securityCategory.createLeaf(
225
- this.formatHeader(i18nString(UIStrings.validFrom), new Date(1000 * securityDetails.validFrom).toUTCString()));
226
- securityCategory.createLeaf(
227
- this.formatHeader(i18nString(UIStrings.validUntil), new Date(1000 * securityDetails.validTo).toUTCString()));
228
- securityCategory.createLeaf(this.formatHeader(i18nString(UIStrings.issuer), securityDetails.issuer));
258
+ set request(request: SDK.NetworkRequest.NetworkRequest|undefined) {
259
+ if (this.#request === request) {
260
+ return;
229
261
  }
262
+ this.#request = request;
263
+ this.requestUpdate();
230
264
  }
231
265
 
232
- private formatHeader(name: string, value: string, highlighted?: boolean): DocumentFragment {
233
- const fragment = document.createDocumentFragment();
234
- const nameElement = fragment.createChild('div', 'header-name');
235
- nameElement.textContent = name + ': ';
236
- fragment.createChild('span', 'header-separator');
237
- const valueElement = fragment.createChild('div', 'header-value source-code');
238
- valueElement.textContent = value;
239
- if (highlighted) {
240
- nameElement.classList.add('error-field');
241
- valueElement.classList.add('error-field');
242
- }
243
- return fragment;
266
+ override wasShown(): void {
267
+ super.wasShown();
268
+ this.requestUpdate();
244
269
  }
245
270
 
246
- private formatHeaderForHexData(name: string, value: string, highlighted?: boolean): DocumentFragment {
247
- const fragment = document.createDocumentFragment();
248
- const nameElement = fragment.createChild('div', 'header-name');
249
- nameElement.textContent = name + ': ';
250
- fragment.createChild('span', 'header-separator');
251
- const valueElement = fragment.createChild('div', 'header-value source-code hex-data');
252
- valueElement.textContent = value.replace(/(.{2})/g, '$1 ');
253
- if (highlighted) {
254
- nameElement.classList.add('error-field');
255
- valueElement.classList.add('error-field');
271
+ override performUpdate(): void {
272
+ const signedExchangeInfo = this.#request?.signedExchangeInfo();
273
+ if (!this.#request || !signedExchangeInfo) {
274
+ this.#view(null, undefined, this.contentElement);
275
+ return;
256
276
  }
257
- return fragment;
258
- }
259
- }
277
+ const request = this.#request;
260
278
 
261
- export class Category extends UI.TreeOutline.TreeElement {
262
- override toggleOnClick: boolean;
263
- override expanded: boolean;
279
+ const errorFieldSetMap = new Map<number|undefined, Set<string>>();
280
+ const errors: string[] = [];
281
+ for (const error of signedExchangeInfo.errors ?? []) {
282
+ errors.push(error.message);
283
+ if (error.errorField) {
284
+ const errorFieldSet = errorFieldSetMap.get(error.signatureIndex) ?? new Set<string>();
285
+ errorFieldSet.add(error.errorField);
286
+ errorFieldSetMap.set(error.signatureIndex, errorFieldSet);
287
+ }
288
+ }
289
+
290
+ const headerInfo = signedExchangeInfo.header ? {
291
+ requestUrl: signedExchangeInfo.header.requestUrl,
292
+ hasRedirectDestination: Boolean(request.redirectDestination()),
293
+ responseCode: String(signedExchangeInfo.header.responseCode),
294
+ headerIntegrity: signedExchangeInfo.header.headerIntegrity,
295
+ responseHeaders:
296
+ Object.entries(signedExchangeInfo.header.responseHeaders).map(([name, value]) => ({name, value})),
297
+ signatures: signedExchangeInfo.header.signatures.map((signature, i) => {
298
+ const errorFieldSet = errorFieldSetMap.get(i) ?? new Set<string>();
299
+ return {
300
+ label: signature.label,
301
+ signature: signature.signature,
302
+ hasSignatureError: errorFieldSet.has(Protocol.Network.SignedExchangeErrorField.SignatureSig),
303
+ certUrl: signature.certUrl,
304
+ hasCertUrlError: errorFieldSet.has(Protocol.Network.SignedExchangeErrorField.SignatureCertUrl),
305
+ certificates: signature.certificates,
306
+ integrity: signature.integrity,
307
+ hasIntegrityError: errorFieldSet.has(Protocol.Network.SignedExchangeErrorField.SignatureIntegrity),
308
+ certSha256: signature.certSha256,
309
+ hasCertSha256Error: errorFieldSet.has(Protocol.Network.SignedExchangeErrorField.SignatureCertSha256),
310
+ validityUrl: signature.validityUrl,
311
+ hasValidityUrlError: errorFieldSet.has(Protocol.Network.SignedExchangeErrorField.SignatureValidityUrl),
312
+ date: new Date(1000 * signature.date).toUTCString(),
313
+ expires: new Date(1000 * signature.expires).toUTCString(),
314
+ hasTimestampsError: errorFieldSet.has(Protocol.Network.SignedExchangeErrorField.SignatureTimestamps),
315
+ };
316
+ }),
317
+ } :
318
+ null;
319
+
320
+ const securityDetails = signedExchangeInfo.securityDetails ? {
321
+ subjectName: signedExchangeInfo.securityDetails.subjectName,
322
+ validFrom: new Date(1000 * signedExchangeInfo.securityDetails.validFrom).toUTCString(),
323
+ validUntil: new Date(1000 * signedExchangeInfo.securityDetails.validTo).toUTCString(),
324
+ issuer: signedExchangeInfo.securityDetails.issuer,
325
+ } :
326
+ null;
327
+
328
+ this.#view(
329
+ {
330
+ errors,
331
+ header: headerInfo,
332
+ securityDetails,
333
+ onViewRequest: () => {
334
+ const redirectDestination = request.redirectDestination();
335
+ if (redirectDestination) {
336
+ void Common.Revealer.reveal(redirectDestination);
337
+ }
338
+ },
339
+ onViewCertificate: (certificates: string[]) =>
340
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.showCertificateViewer(certificates),
341
+ },
342
+ undefined,
343
+ this.contentElement,
344
+ );
345
+ }
264
346
 
265
- constructor(root: UI.TreeOutline.TreeOutline, title?: string|Node) {
266
- super(title, true);
267
- this.selectable = false;
268
- this.toggleOnClick = true;
269
- this.expanded = true;
270
- root.appendChild(this);
347
+ static formatHeader(name: string, value: string, highlighted?: boolean): LitTemplate {
348
+ // clang-format off
349
+ return html`<div class=${classMap({'header-name': true, 'error-field': Boolean(highlighted)})}>${name}: </div><span
350
+ class="header-separator"></span><div
351
+ class=${classMap({'header-value': true, 'source-code': true, 'error-field': Boolean(highlighted)})}>${value}</div>`;
352
+ // clang-format on
271
353
  }
272
354
 
273
- createLeaf(title?: string|Node): UI.TreeOutline.TreeElement {
274
- const leaf = new UI.TreeOutline.TreeElement(title);
275
- leaf.selectable = false;
276
- this.appendChild(leaf);
277
- return leaf;
355
+ static formatHeaderForHexData(name: string, value: string, highlighted?: boolean): LitTemplate {
356
+ // clang-format off
357
+ return html`<div class=${classMap({'header-name': true, 'error-field': Boolean(highlighted)})}>${name}: </div><span
358
+ class="header-separator"></span><div
359
+ class=${classMap({'header-value': true, 'source-code': true, 'hex-data': true, 'error-field': Boolean(highlighted)})}>${
360
+ value.replace(/(.{2})/g, '$1 ')}</div>`;
361
+ // clang-format on
278
362
  }
279
363
  }
@@ -108,7 +108,7 @@
108
108
  .user-agent-client-hints-form {
109
109
  display: block;
110
110
  margin-top: var(--sys-size-7);
111
- width: min(100%, 400px);
111
+ width: min(100%, var(--sys-size-32));
112
112
  }
113
113
 
114
114
  .status-text {
@@ -406,7 +406,8 @@ td.time-column {
406
406
  outline: var(--sys-size-1) solid var(--icon-gap-toolbar);
407
407
  left: var(--sys-size-5);
408
408
  position: absolute;
409
- top: 10px;
409
+ /* 16px (.network-log-grid.data-grid.small .icon height) minus 6px (dot height). */
410
+ top: calc(var(--sys-size-8) - var(--sys-size-4));
410
411
  z-index: 1;
411
412
  }
412
413
 
@@ -73,11 +73,6 @@
73
73
  background: var(--sys-color-cdt-base-container);
74
74
  }
75
75
 
76
- .network-item-preview-toolbar {
77
- border-top: var(--sys-size-1) solid var(--sys-color-divider);
78
- background-color: var(--sys-color-surface1);
79
- }
80
-
81
76
  .resource-timing-view {
82
77
  display: block;
83
78
  margin: var(--sys-size-4);
@@ -22,7 +22,7 @@
22
22
 
23
23
  .network-timing-table-header td,
24
24
  .network-timing-footer td {
25
- border-top: 10px solid transparent;
25
+ border-top: var(--sys-size-5) solid transparent;
26
26
  }
27
27
 
28
28
  .network-timing-table-header td {
@@ -4,13 +4,17 @@
4
4
  * found in the LICENSE file.
5
5
  */
6
6
 
7
- .signed-exchange-info-view {
8
- user-select: text;
9
- overflow: auto;
10
- }
7
+ @scope to (devtools-widget > *) {
8
+ :scope,
9
+ .signed-exchange-info-view {
10
+ user-select: text;
11
+ overflow: auto;
12
+ }
11
13
 
12
- .signed-exchange-info-tree {
13
- flex-grow: 1;
14
- overflow-y: auto;
15
- margin: 0;
14
+ .signed-exchange-info-tree {
15
+ display: block;
16
+ flex-grow: 1;
17
+ overflow-y: auto;
18
+ margin: 0;
19
+ }
16
20
  }
@@ -62,11 +62,11 @@
62
62
  }
63
63
 
64
64
  .perfmon-indicator {
65
- padding: 3px 9px;
65
+ padding: var(--sys-size-2) var(--sys-size-5);
66
66
  margin: calc(-1 * var(--sys-size-1)) 0;
67
67
  display: flex;
68
68
  flex-shrink: 0;
69
- width: 210px;
69
+ width: var(--sys-size-26);
70
70
  }
71
71
 
72
72
  .perfmon-indicator-value {
@@ -6,10 +6,10 @@ import * as Common from '../../core/common/common.js';
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
7
  import * as SDK from '../../core/sdk/sdk.js';
8
8
  import * as UI from '../../ui/legacy/legacy.js';
9
- import {Directives, html, render} from '../../ui/lit/lit.js';
9
+ import {Directives, html, nothing, render} from '../../ui/lit/lit.js';
10
10
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
11
11
 
12
- const {classMap, ifDefined, repeat} = Directives;
12
+ const {classMap, ifDefined, ref, repeat} = Directives;
13
13
 
14
14
  const UIStrings = {
15
15
  /**
@@ -69,6 +69,7 @@ export interface TrendInfo {
69
69
 
70
70
  export interface IsolateItemInfo {
71
71
  id: string;
72
+ optionId: string;
72
73
  heapText: string;
73
74
  trend: TrendInfo;
74
75
  titles: string[];
@@ -80,12 +81,17 @@ export interface ViewInput {
80
81
  trendIntervalMinutes: number;
81
82
  totalText: string;
82
83
  trend: TrendInfo;
83
- onSelect: (index: number) => void;
84
+ onSelect: (index: number, scrollIntoView?: boolean) => void;
84
85
  }
85
86
 
86
- export type View = (input: ViewInput, _output: undefined, target: HTMLElement) => void;
87
+ export interface ViewOutput {
88
+ scrollSelectedIntoView?: () => void;
89
+ }
90
+
91
+ export type View = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
87
92
 
88
- export const DEFAULT_VIEW: View = (input, _output, target) => {
93
+ export const DEFAULT_VIEW: View = (input, output, target) => {
94
+ output.scrollSelectedIntoView = undefined;
89
95
  const onKeyDown = (event: KeyboardEvent): void => {
90
96
  if (!input.items.length) {
91
97
  return;
@@ -112,7 +118,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
112
118
  }
113
119
  event.consume(true);
114
120
  if (nextIndex !== -1 && nextIndex !== selectedIndex) {
115
- input.onSelect(nextIndex);
121
+ input.onSelect(nextIndex, true);
116
122
  }
117
123
  };
118
124
 
@@ -122,12 +128,14 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
122
128
  <div class="javascript-vm-instances-list"
123
129
  role="listbox"
124
130
  aria-label=${i18nString(UIStrings.javascriptVmInstances)}
131
+ aria-activedescendant=${ifDefined(input.items[input.selectedIndex]?.optionId)}
125
132
  tabindex=${input.items.length ? 0 : -1}
126
133
  @keydown=${onKeyDown}>
127
134
  ${repeat(input.items, item => item.id, (item, index) => {
128
135
  const isSelected = index === input.selectedIndex;
129
136
  return html`
130
- <div class=${classMap({
137
+ <div id=${item.optionId}
138
+ class=${classMap({
131
139
  'profile-memory-usage-item': true,
132
140
  hbox: true,
133
141
  selected: isSelected,
@@ -141,7 +149,12 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
141
149
  resize: true,
142
150
  keydown: 'ArrowUp|ArrowDown|PageUp|PageDown|Home|End',
143
151
  })}
144
- @click=${() => input.onSelect(index)}>
152
+ @click=${() => input.onSelect(index)}
153
+ ${isSelected ? ref(el => {
154
+ if (el instanceof HTMLElement) {
155
+ output.scrollSelectedIntoView = () => el.scrollIntoViewIfNeeded(false);
156
+ }
157
+ }) : nothing}>
145
158
  <div class="profile-memory-usage-item-size"
146
159
  title=${i18nString(UIStrings.heapSizeInUseByLiveJsObjects)}>
147
160
  ${item.heapText}
@@ -227,9 +240,11 @@ function getIsolateTitles(isolate: SDK.IsolateManager.Isolate): string[] {
227
240
 
228
241
  export class IsolateSelector extends UI.Widget.VBox implements SDK.IsolateManager.Observer {
229
242
  readonly #view: View;
243
+ readonly #viewOutput: ViewOutput = {};
230
244
  readonly #isolates: SDK.IsolateManager.Isolate[] = [];
231
245
  readonly #itemStates = new Map<SDK.IsolateManager.Isolate, IsolateItemInfo>();
232
246
  #selectedIsolate: SDK.IsolateManager.Isolate|null = null;
247
+ #pendingScrollToSelected = false;
233
248
  #totalText = '';
234
249
  #totalTrend: TrendInfo = {text: '', increasing: false};
235
250
 
@@ -252,14 +267,19 @@ export class IsolateSelector extends UI.Widget.VBox implements SDK.IsolateManage
252
267
  trendIntervalMinutes,
253
268
  totalText: this.#totalText,
254
269
  trend: this.#totalTrend,
255
- onSelect: index => {
270
+ onSelect: (index, scrollIntoView = false) => {
256
271
  const isolate = this.#isolates[index];
257
272
  if (isolate) {
273
+ this.#pendingScrollToSelected = scrollIntoView;
258
274
  this.#selectIsolate(isolate);
259
275
  }
260
276
  },
261
277
  },
262
- undefined, this.contentElement);
278
+ this.#viewOutput, this.contentElement);
279
+ if (this.#pendingScrollToSelected) {
280
+ this.#pendingScrollToSelected = false;
281
+ this.#viewOutput.scrollSelectedIntoView?.();
282
+ }
263
283
  }
264
284
 
265
285
  override wasShown(): void {
@@ -289,6 +309,7 @@ export class IsolateSelector extends UI.Widget.VBox implements SDK.IsolateManage
289
309
  isolateAdded(isolate: SDK.IsolateManager.Isolate): void {
290
310
  const item: IsolateItemInfo = {
291
311
  id: isolate.id(),
312
+ optionId: UI.ARIAUtils.nextId('isolate-option-'),
292
313
  heapText: '',
293
314
  trend: {text: '', increasing: false},
294
315
  titles: getIsolateTitles(isolate),
@@ -124,14 +124,6 @@
124
124
  flex: 0 0 var(--sys-size-19) !important; /* stylelint-disable-line declaration-no-important */
125
125
  }
126
126
 
127
- .profile-text-view {
128
- padding: 10px;
129
- overflow: auto;
130
- margin: 0;
131
- user-select: text;
132
- cursor: text;
133
- }
134
-
135
127
  .empty-landing-page {
136
128
  position: absolute;
137
129
  background-color: var(--sys-color-cdt-base-container);