chrome-devtools-frontend 1.0.1576287 → 1.0.1577886
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.
- package/front_end/core/sdk/DebuggerModel.ts +0 -24
- package/front_end/generated/InspectorBackendCommands.ts +3 -2
- package/front_end/generated/SupportedCSSProperties.js +42 -8
- package/front_end/generated/protocol-mapping.d.ts +9 -0
- package/front_end/generated/protocol-proxy-api.d.ts +7 -0
- package/front_end/generated/protocol.ts +16 -0
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +9 -7
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +33 -58
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -52
- package/front_end/models/javascript_metadata/NativeFunctions.js +8 -0
- package/front_end/models/stack_trace/StackTrace.ts +14 -19
- package/front_end/models/workspace/WorkspaceImpl.ts +1 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +5 -1
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +2 -0
- package/front_end/panels/css_overview/cssOverviewCompletedView.css +5 -0
- package/front_end/panels/network/RequestPayloadView.ts +42 -91
- package/front_end/panels/network/ShowMoreDetailsWidget.ts +96 -0
- package/front_end/panels/network/network.ts +2 -0
- package/front_end/panels/recorder/components/RecordingView.ts +15 -0
- package/front_end/panels/sources/CallStackSidebarPane.ts +98 -152
- package/front_end/panels/sources/DebuggerPlugin.ts +19 -22
- package/front_end/panels/sources/SourcesPanel.ts +6 -24
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/report_view/ReportView.ts +2 -2
- package/front_end/ui/components/report_view/report.css +1 -0
- package/front_end/ui/legacy/ContextMenu.ts +12 -7
- package/front_end/ui/visual_logging/Debugging.ts +2 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
|
@@ -65,39 +65,34 @@ export interface EventTypes {
|
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* A small wrapper around a DebuggableFrame usable as a UI.Context flavor.
|
|
68
|
-
* This is necessary as
|
|
69
|
-
*
|
|
68
|
+
* This is necessary as DebuggableFrame are just interfaces and the impl classes are hidden.
|
|
69
|
+
*
|
|
70
|
+
* Moreover, re-translation creates a new DebuggableFrame instance even though the
|
|
71
|
+
* translation result stays the same, in which case we don't need a new instance for the flavor.
|
|
70
72
|
*/
|
|
71
|
-
export class DebuggableFrameFlavor
|
|
73
|
+
export class DebuggableFrameFlavor {
|
|
72
74
|
static #last?: DebuggableFrameFlavor;
|
|
73
75
|
|
|
74
|
-
readonly
|
|
75
|
-
readonly uiSourceCode?: Workspace.UISourceCode.UISourceCode;
|
|
76
|
-
readonly name?: string;
|
|
77
|
-
readonly line: number;
|
|
78
|
-
readonly column: number;
|
|
79
|
-
readonly missingDebugInfo?: MissingDebugInfo;
|
|
80
|
-
readonly sdkFrame: SDK.DebuggerModel.CallFrame;
|
|
76
|
+
readonly frame: DebuggableFrame;
|
|
81
77
|
|
|
82
78
|
/** Use the static {@link for}. Only public to satisfy the `setFlavor` Ctor type */
|
|
83
79
|
constructor(frame: DebuggableFrame) {
|
|
84
|
-
this.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
this.
|
|
89
|
-
this.missingDebugInfo = frame.missingDebugInfo;
|
|
90
|
-
this.sdkFrame = frame.sdkFrame;
|
|
80
|
+
this.frame = frame;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
get sdkFrame(): SDK.DebuggerModel.CallFrame {
|
|
84
|
+
return this.frame.sdkFrame;
|
|
91
85
|
}
|
|
92
86
|
|
|
93
87
|
/** @returns the same instance of DebuggableFrameFlavor for repeated calls with the same (i.e. deep equal) DebuggableFrame */
|
|
94
88
|
static for(frame: DebuggableFrame): DebuggableFrameFlavor {
|
|
95
89
|
function equals(a: DebuggableFrame, b: DebuggableFrame): boolean {
|
|
96
90
|
return a.url === b.url && a.uiSourceCode === b.uiSourceCode && a.name === b.name && a.line === b.line &&
|
|
97
|
-
a.column === b.column && a.sdkFrame === b.sdkFrame
|
|
91
|
+
a.column === b.column && a.sdkFrame === b.sdkFrame &&
|
|
92
|
+
JSON.stringify(a.missingDebugInfo) === JSON.stringify(b.missingDebugInfo);
|
|
98
93
|
}
|
|
99
94
|
|
|
100
|
-
if (!DebuggableFrameFlavor.#last || !equals(DebuggableFrameFlavor.#last, frame)) {
|
|
95
|
+
if (!DebuggableFrameFlavor.#last || !equals(DebuggableFrameFlavor.#last.frame, frame)) {
|
|
101
96
|
DebuggableFrameFlavor.#last = new DebuggableFrameFlavor(frame);
|
|
102
97
|
}
|
|
103
98
|
return DebuggableFrameFlavor.#last;
|
|
@@ -268,7 +268,7 @@ export class WorkspaceImpl extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
268
268
|
return [...this.#projects.values()];
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
projectsForType(type:
|
|
271
|
+
projectsForType(type: projectTypes): Project[] {
|
|
272
272
|
function filterByType(project: Project): boolean {
|
|
273
273
|
return project.type() === type;
|
|
274
274
|
}
|
|
@@ -110,6 +110,10 @@ const UIStringsNotTranslate = {
|
|
|
110
110
|
* @description The generic name of the AI agent (do not translate)
|
|
111
111
|
*/
|
|
112
112
|
ai: 'AI',
|
|
113
|
+
/**
|
|
114
|
+
* @description Gemini (do not translate)
|
|
115
|
+
*/
|
|
116
|
+
gemini: 'Gemini',
|
|
113
117
|
/**
|
|
114
118
|
* @description The fallback text when we can't find the user full name
|
|
115
119
|
*/
|
|
@@ -306,7 +310,7 @@ export const DEFAULT_VIEW = (input: ChatMessageViewInput, output: ViewOutput, ta
|
|
|
306
310
|
<div class="message-info">
|
|
307
311
|
<devtools-icon name=${icon}></devtools-icon>
|
|
308
312
|
<div class="message-name">
|
|
309
|
-
<h2>${lockedString(UIStringsNotTranslate.ai)}</h2>
|
|
313
|
+
<h2>${AiAssistanceModel.AiUtils.isGeminiBranding() ? lockedString(UIStringsNotTranslate.gemini) : lockedString(UIStringsNotTranslate.ai)}</h2>
|
|
310
314
|
</div>
|
|
311
315
|
</div>
|
|
312
316
|
${Lit.Directives.repeat(
|
|
@@ -77,6 +77,8 @@ export const DEFAULT_VIEW: View = (input, _output, target): void => {
|
|
|
77
77
|
<div class="title">Gemini 3 Flash in DevTools</div>
|
|
78
78
|
<div class="close-button">
|
|
79
79
|
<devtools-button
|
|
80
|
+
aria-hidden="true"
|
|
81
|
+
tabindex="-1"
|
|
80
82
|
.iconName=${'cross'}
|
|
81
83
|
.variant=${Buttons.Button.Variant.ICON}
|
|
82
84
|
.size=${Buttons.Button.Size.REGULAR}
|
|
@@ -49,8 +49,10 @@ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
|
49
49
|
|
|
50
50
|
import requestPayloadTreeStyles from './requestPayloadTree.css.js';
|
|
51
51
|
import requestPayloadViewStyles from './requestPayloadView.css.js';
|
|
52
|
+
import {ShowMoreDetailsWidget} from './ShowMoreDetailsWidget.js';
|
|
52
53
|
|
|
53
54
|
const {classMap} = Directives;
|
|
55
|
+
const {widgetConfig} = UI.Widget;
|
|
54
56
|
const UIStrings = {
|
|
55
57
|
/**
|
|
56
58
|
* @description A context menu item Payload View of the Network panel to copy a parsed value.
|
|
@@ -77,10 +79,6 @@ const UIStrings = {
|
|
|
77
79
|
* @description Text in Request Payload View of the Network panel
|
|
78
80
|
*/
|
|
79
81
|
formData: 'Form Data',
|
|
80
|
-
/**
|
|
81
|
-
* @description Text to show more content
|
|
82
|
-
*/
|
|
83
|
-
showMore: 'Show more',
|
|
84
82
|
/**
|
|
85
83
|
* @description Text for toggling the view of payload data (e.g. query string parameters) from source to parsed in the payload tab
|
|
86
84
|
*/
|
|
@@ -134,7 +132,7 @@ export class RequestPayloadView extends UI.Widget.VBox {
|
|
|
134
132
|
|
|
135
133
|
this.queryStringCategory = new Category(root, 'query-string');
|
|
136
134
|
this.formDataCategory = new Category(root, 'form-data');
|
|
137
|
-
this.requestPayloadCategory = new Category(root, 'request-payload'
|
|
135
|
+
this.requestPayloadCategory = new Category(root, 'request-payload');
|
|
138
136
|
}
|
|
139
137
|
|
|
140
138
|
override wasShown(): void {
|
|
@@ -200,45 +198,16 @@ export class RequestPayloadView extends UI.Widget.VBox {
|
|
|
200
198
|
}
|
|
201
199
|
}
|
|
202
200
|
|
|
203
|
-
private populateTreeElementWithSourceText(treeElement: UI.TreeOutline.TreeElement,
|
|
204
|
-
const
|
|
205
|
-
const text = (sourceText || '').trim();
|
|
206
|
-
const trim = text.length > MAX_LENGTH;
|
|
207
|
-
|
|
208
|
-
const sourceTextElement = document.createElement('span');
|
|
209
|
-
sourceTextElement.classList.add('payload-value');
|
|
210
|
-
sourceTextElement.classList.add('source-code');
|
|
211
|
-
sourceTextElement.textContent = trim ? text.substr(0, MAX_LENGTH) : text;
|
|
212
|
-
|
|
213
|
-
const sourceTreeElement = new UI.TreeOutline.TreeElement(sourceTextElement);
|
|
201
|
+
private populateTreeElementWithSourceText(treeElement: UI.TreeOutline.TreeElement, text: string): void {
|
|
202
|
+
const sourceTreeElement = new UI.TreeOutline.TreeElement();
|
|
214
203
|
|
|
215
204
|
treeElement.removeChildren();
|
|
216
205
|
treeElement.appendChild(sourceTreeElement);
|
|
217
206
|
this.addEntryContextMenuHandler(sourceTreeElement, i18nString(UIStrings.copyPayload), 'copy-payload', () => text);
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
const showMoreButton = new Buttons.Button.Button();
|
|
223
|
-
showMoreButton.data = {variant: Buttons.Button.Variant.OUTLINED, jslogContext: 'show-more'};
|
|
224
|
-
showMoreButton.innerText = i18nString(UIStrings.showMore);
|
|
225
|
-
showMoreButton.classList.add('request-payload-show-more-button');
|
|
226
|
-
|
|
227
|
-
function showMore(): void {
|
|
228
|
-
showMoreButton.remove();
|
|
229
|
-
sourceTextElement.textContent = text;
|
|
230
|
-
sourceTreeElement.listItemElement.removeEventListener('contextmenu', onContextMenuShowMore);
|
|
231
|
-
}
|
|
232
|
-
showMoreButton.addEventListener('click', showMore);
|
|
233
|
-
|
|
234
|
-
function onContextMenuShowMore(event: Event): void {
|
|
235
|
-
const contextMenu = new UI.ContextMenu.ContextMenu(event);
|
|
236
|
-
const section = contextMenu.newSection();
|
|
237
|
-
section.appendItem(i18nString(UIStrings.showMore), showMore, {jslogContext: 'show-more'});
|
|
238
|
-
void contextMenu.show();
|
|
239
|
-
}
|
|
240
|
-
sourceTreeElement.listItemElement.addEventListener('contextmenu', onContextMenuShowMore);
|
|
241
|
-
sourceTextElement.appendChild(showMoreButton);
|
|
207
|
+
render(
|
|
208
|
+
html`<devtools-widget class='payload-value source-code'
|
|
209
|
+
.widgetConfig=${widgetConfig(ShowMoreDetailsWidget, {text})}></devtools-widget>`,
|
|
210
|
+
sourceTreeElement.listItemElement);
|
|
242
211
|
}
|
|
243
212
|
|
|
244
213
|
private refreshParams(
|
|
@@ -306,7 +275,7 @@ export class RequestPayloadView extends UI.Widget.VBox {
|
|
|
306
275
|
|
|
307
276
|
paramsTreeElement.removeChildren();
|
|
308
277
|
if (shouldViewSource) {
|
|
309
|
-
this.populateTreeElementWithSourceText(paramsTreeElement, sourceText);
|
|
278
|
+
this.populateTreeElementWithSourceText(paramsTreeElement, (sourceText ?? '').trim());
|
|
310
279
|
paramsTreeElement.listItemElement.addEventListener('contextmenu', viewParsedContextMenu);
|
|
311
280
|
} else {
|
|
312
281
|
this.populateTreeElementWithParsedParameters(paramsTreeElement, params);
|
|
@@ -363,25 +332,6 @@ export class RequestPayloadView extends UI.Widget.VBox {
|
|
|
363
332
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
364
333
|
private refreshRequestJSONPayload(parsedObject: any, sourceText: string): void {
|
|
365
334
|
const rootListItem = this.requestPayloadCategory;
|
|
366
|
-
rootListItem.removeChildren();
|
|
367
|
-
|
|
368
|
-
const rootListItemElement = rootListItem.listItemElement;
|
|
369
|
-
rootListItemElement.removeChildren();
|
|
370
|
-
rootListItemElement.createChild('div', 'selection fill');
|
|
371
|
-
UI.UIUtils.createTextChild(rootListItemElement, this.requestPayloadCategory.title.toString());
|
|
372
|
-
|
|
373
|
-
if (viewSourceForItems.has(rootListItem)) {
|
|
374
|
-
this.appendJSONPayloadSource(rootListItem, parsedObject, sourceText);
|
|
375
|
-
} else {
|
|
376
|
-
this.appendJSONPayloadParsed(rootListItem, parsedObject, sourceText);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
|
|
381
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
382
|
-
private appendJSONPayloadSource(rootListItem: Category, parsedObject: any, sourceText: string): void {
|
|
383
|
-
const rootListItemElement = rootListItem.listItemElement;
|
|
384
|
-
this.populateTreeElementWithSourceText(rootListItem, sourceText);
|
|
385
335
|
|
|
386
336
|
const viewParsed = function(this: RequestPayloadView, event: Event): void {
|
|
387
337
|
rootListItemElement.removeEventListener('contextmenu', viewParsedContextMenu);
|
|
@@ -390,9 +340,6 @@ export class RequestPayloadView extends UI.Widget.VBox {
|
|
|
390
340
|
event.consume();
|
|
391
341
|
};
|
|
392
342
|
|
|
393
|
-
const viewParsedButton = this.createViewSourceToggle(/* viewSource */ true, viewParsed.bind(this));
|
|
394
|
-
rootListItemElement.appendChild(viewParsedButton);
|
|
395
|
-
|
|
396
343
|
const viewParsedContextMenu = (event: Event): void => {
|
|
397
344
|
if (!rootListItem.expanded) {
|
|
398
345
|
return;
|
|
@@ -403,27 +350,6 @@ export class RequestPayloadView extends UI.Widget.VBox {
|
|
|
403
350
|
void contextMenu.show();
|
|
404
351
|
};
|
|
405
352
|
|
|
406
|
-
rootListItemElement.addEventListener('contextmenu', viewParsedContextMenu);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
|
|
410
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
411
|
-
private appendJSONPayloadParsed(rootListItem: Category, parsedObject: any, sourceText: string): void {
|
|
412
|
-
const object = (SDK.RemoteObject.RemoteObject.fromLocalObject(parsedObject) as SDK.RemoteObject.LocalJSONObject);
|
|
413
|
-
const section =
|
|
414
|
-
new ObjectUI.ObjectPropertiesSection.RootElement(new ObjectUI.ObjectPropertiesSection.ObjectTree(object));
|
|
415
|
-
section.title = (object.description);
|
|
416
|
-
section.expand();
|
|
417
|
-
// `editable` is not a valid property for `ObjectUI.ObjectPropertiesSection.RootElement`. Only for
|
|
418
|
-
// `ObjectUI.ObjectPropertiesSection.ObjectPropertiesSection`. We do not know if this assignment is
|
|
419
|
-
// safe to delete.
|
|
420
|
-
// @ts-expect-error
|
|
421
|
-
section.editable = false;
|
|
422
|
-
rootListItem.childrenListElement.classList.add('source-code', 'object-properties-section');
|
|
423
|
-
|
|
424
|
-
rootListItem.appendChild(section);
|
|
425
|
-
const rootListItemElement = rootListItem.listItemElement;
|
|
426
|
-
|
|
427
353
|
const viewSource = function(this: RequestPayloadView, event: Event): void {
|
|
428
354
|
rootListItemElement.removeEventListener('contextmenu', viewSourceContextMenu);
|
|
429
355
|
|
|
@@ -442,16 +368,41 @@ export class RequestPayloadView extends UI.Widget.VBox {
|
|
|
442
368
|
void contextMenu.show();
|
|
443
369
|
};
|
|
444
370
|
|
|
445
|
-
const
|
|
446
|
-
rootListItemElement.
|
|
371
|
+
const showSource = viewSourceForItems.has(rootListItem);
|
|
372
|
+
const rootListItemElement = rootListItem.listItemElement;
|
|
373
|
+
render(
|
|
374
|
+
html`<div class="selection fill"></div>${i18nString(UIStrings.requestPayload)}${
|
|
375
|
+
this.createViewSourceToggle(showSource, showSource ? viewParsed.bind(this) : viewSource.bind(this))}`,
|
|
376
|
+
rootListItemElement);
|
|
377
|
+
|
|
378
|
+
rootListItem.removeChildren();
|
|
379
|
+
if (showSource) {
|
|
380
|
+
this.populateTreeElementWithSourceText(rootListItem, sourceText);
|
|
381
|
+
rootListItemElement.addEventListener('contextmenu', viewParsedContextMenu);
|
|
382
|
+
} else {
|
|
383
|
+
rootListItem.childrenListElement.classList.add('source-code', 'object-properties-section');
|
|
384
|
+
this.populateTreeElementWithObject(rootListItem, parsedObject);
|
|
385
|
+
rootListItemElement.addEventListener('contextmenu', viewSourceContextMenu);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
447
388
|
|
|
448
|
-
|
|
389
|
+
private populateTreeElementWithObject(rootListItem: Category, parsedObject: object): void {
|
|
390
|
+
const object = new SDK.RemoteObject.LocalJSONObject(parsedObject);
|
|
391
|
+
const section =
|
|
392
|
+
new ObjectUI.ObjectPropertiesSection.RootElement(new ObjectUI.ObjectPropertiesSection.ObjectTree(object));
|
|
393
|
+
section.title = (object.description);
|
|
394
|
+
section.expand();
|
|
395
|
+
rootListItem.appendChild(section);
|
|
449
396
|
}
|
|
450
397
|
|
|
451
|
-
private createViewSourceToggle(viewSource: boolean, handler: (arg0: Event) => void):
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
398
|
+
private createViewSourceToggle(viewSource: boolean, handler: (arg0: Event) => void): LitTemplate {
|
|
399
|
+
return html`<devtools-button
|
|
400
|
+
class=payload-toggle
|
|
401
|
+
jslogi=${VisualLogging.action().track({click: true}).context('source-parse')}
|
|
402
|
+
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
403
|
+
@click=${handler}>
|
|
404
|
+
${viewSource ? i18nString(UIStrings.viewParsed) : i18nString(UIStrings.viewSource)}
|
|
405
|
+
</devtools-button>`;
|
|
455
406
|
}
|
|
456
407
|
|
|
457
408
|
private toggleURLDecoding(event: Event): void {
|
|
@@ -0,0 +1,96 @@
|
|
|
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 i18n from '../../core/i18n/i18n.js';
|
|
6
|
+
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
7
|
+
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
|
+
import * as Lit from '../../ui/lit/lit.js';
|
|
9
|
+
const UIStrings = {
|
|
10
|
+
/**
|
|
11
|
+
* @description Text to show more content
|
|
12
|
+
*/
|
|
13
|
+
showMore: 'Show more',
|
|
14
|
+
} as const;
|
|
15
|
+
const str_ = i18n.i18n.registerUIStrings('panels/network/ShowMoreDetailsWidget.ts', UIStrings);
|
|
16
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
17
|
+
|
|
18
|
+
const {render, html} = Lit;
|
|
19
|
+
interface ViewInput {
|
|
20
|
+
text: string;
|
|
21
|
+
showMore: boolean;
|
|
22
|
+
onToggle: () => void;
|
|
23
|
+
copy: CopyMenuItem|null;
|
|
24
|
+
}
|
|
25
|
+
type View = (input: ViewInput, output: object, target: HTMLElement) => void;
|
|
26
|
+
const MAX_LENGTH = 3000;
|
|
27
|
+
|
|
28
|
+
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
29
|
+
const onContextMenuShowMore = (event: Event): void => {
|
|
30
|
+
const contextMenu = new UI.ContextMenu.ContextMenu(event);
|
|
31
|
+
if (input.copy) {
|
|
32
|
+
contextMenu.clipboardSection().appendItem(input.copy.menuItem, input.copy.handler);
|
|
33
|
+
}
|
|
34
|
+
if (!input.showMore) {
|
|
35
|
+
contextMenu.newSection().appendItem(i18nString(UIStrings.showMore), input.onToggle, {jslogContext: 'show-more'});
|
|
36
|
+
}
|
|
37
|
+
void contextMenu.show();
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
render(html`<span
|
|
41
|
+
@contextmenu=${onContextMenuShowMore}
|
|
42
|
+
>${input.showMore ? input.text : input.text.substr(0, MAX_LENGTH)}</span>
|
|
43
|
+
${
|
|
44
|
+
!input.showMore && input.text.length > MAX_LENGTH ? html`<devtools-button
|
|
45
|
+
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
46
|
+
.jslogContext=${'show-more'}
|
|
47
|
+
@click=${input.onToggle}>
|
|
48
|
+
${i18nString(UIStrings.showMore)}
|
|
49
|
+
</devtools-button>` :
|
|
50
|
+
Lit.nothing}`,
|
|
51
|
+
target);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
interface CopyMenuItem {
|
|
55
|
+
menuItem: UI.ContextMenu.Item;
|
|
56
|
+
handler: () => void;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export class ShowMoreDetailsWidget extends UI.Widget.Widget {
|
|
60
|
+
readonly #view: View;
|
|
61
|
+
#text = '';
|
|
62
|
+
#showMore = false;
|
|
63
|
+
#copy: CopyMenuItem|null = null;
|
|
64
|
+
constructor(target?: HTMLElement, view = DEFAULT_VIEW) {
|
|
65
|
+
super(target);
|
|
66
|
+
this.#view = view;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
get text(): string {
|
|
70
|
+
return this.#text;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
set text(text: string) {
|
|
74
|
+
this.#text = text;
|
|
75
|
+
this.requestUpdate();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
set copy(copy: CopyMenuItem) {
|
|
79
|
+
this.#copy = copy;
|
|
80
|
+
this.requestUpdate();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
override performUpdate(): void {
|
|
84
|
+
this.#view(
|
|
85
|
+
{
|
|
86
|
+
copy: this.#copy,
|
|
87
|
+
text: this.#text,
|
|
88
|
+
showMore: this.#showMore,
|
|
89
|
+
onToggle: () => {
|
|
90
|
+
this.#showMore = true;
|
|
91
|
+
this.requestUpdate();
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{}, this.contentElement);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -52,6 +52,7 @@ import * as RequestResponseView from './RequestResponseView.js';
|
|
|
52
52
|
import * as RequestTimingView from './RequestTimingView.js';
|
|
53
53
|
import * as ResourceDirectSocketChunkView from './ResourceDirectSocketChunkView.js';
|
|
54
54
|
import * as ResourceWebSocketFrameView from './ResourceWebSocketFrameView.js';
|
|
55
|
+
import * as ShowMoreDetailsWidget from './ShowMoreDetailsWidget.js';
|
|
55
56
|
import * as SignedExchangeInfoView from './SignedExchangeInfoView.js';
|
|
56
57
|
|
|
57
58
|
export {
|
|
@@ -79,5 +80,6 @@ export {
|
|
|
79
80
|
RequestTimingView,
|
|
80
81
|
ResourceDirectSocketChunkView,
|
|
81
82
|
ResourceWebSocketFrameView,
|
|
83
|
+
ShowMoreDetailsWidget,
|
|
82
84
|
SignedExchangeInfoView,
|
|
83
85
|
};
|
|
@@ -140,6 +140,14 @@ const UIStrings = {
|
|
|
140
140
|
* @description The title of the button that open current recording in Performance panel.
|
|
141
141
|
*/
|
|
142
142
|
performancePanel: 'Performance panel',
|
|
143
|
+
/**
|
|
144
|
+
* @description The announcement when the code sidebar is opened.
|
|
145
|
+
*/
|
|
146
|
+
codeSidebarOpened: 'Code sidebar opened',
|
|
147
|
+
/**
|
|
148
|
+
* @description The announcement when the code sidebar is closed.
|
|
149
|
+
*/
|
|
150
|
+
codeSidebarClosed: 'Code sidebar closed'
|
|
143
151
|
} as const;
|
|
144
152
|
const str_ = i18n.i18n.registerUIStrings(
|
|
145
153
|
'panels/recorder/components/RecordingView.ts',
|
|
@@ -1189,6 +1197,13 @@ export class RecordingView extends UI.Widget.Widget {
|
|
|
1189
1197
|
|
|
1190
1198
|
showCodeToggle = (): void => {
|
|
1191
1199
|
this.#showCodeView = !this.#showCodeView;
|
|
1200
|
+
|
|
1201
|
+
if (this.#showCodeView) {
|
|
1202
|
+
UI.ARIAUtils.LiveAnnouncer.alert(i18nString(UIStrings.codeSidebarOpened));
|
|
1203
|
+
} else {
|
|
1204
|
+
UI.ARIAUtils.LiveAnnouncer.alert(i18nString(UIStrings.codeSidebarClosed));
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1192
1207
|
void this.#convertToCode();
|
|
1193
1208
|
};
|
|
1194
1209
|
|