chrome-devtools-frontend 1.0.1537268 → 1.0.1537860
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/.env.template +9 -0
- package/docs/get_the_code.md +27 -0
- package/front_end/core/common/SettingRegistration.ts +10 -7
- package/front_end/core/common/Settings.ts +3 -0
- package/front_end/core/sdk/sdk-meta.ts +8 -2
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +4 -3
- package/front_end/generated/SupportedCSSProperties.js +1 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +23 -7
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +110 -5
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +50 -45
- package/front_end/models/cpu_profile/ProfileTreeModel.ts +7 -7
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +1 -1
- package/front_end/panels/application/StorageView.ts +3 -2
- package/front_end/panels/application/components/BackForwardCacheView.ts +34 -51
- package/front_end/panels/application/components/OriginTrialTreeView.ts +83 -80
- package/front_end/panels/application/components/backForwardCacheView.css +4 -0
- package/front_end/panels/application/components/badge.css +8 -0
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +27 -0
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +11 -9
- package/front_end/panels/coverage/CoverageView.ts +1 -2
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +1 -1
- package/front_end/panels/elements/ElementStatePaneWidget.ts +1 -1
- package/front_end/panels/elements/EventListenersWidget.ts +1 -2
- package/front_end/panels/elements/PropertiesWidget.ts +1 -1
- package/front_end/panels/network/NetworkConfigView.ts +2 -1
- package/front_end/panels/network/NetworkPanel.ts +5 -4
- package/front_end/panels/network/RequestCookiesView.ts +2 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +3 -2
- package/front_end/panels/sensors/SensorsView.ts +4 -3
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +8 -6
- package/front_end/panels/settings/KeybindsSettingsTab.ts +3 -2
- package/front_end/panels/settings/SettingsScreen.ts +2 -1
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +2 -1
- package/front_end/panels/sources/SourcesPanel.ts +2 -1
- package/front_end/panels/sources/sources-meta.ts +8 -1
- package/front_end/panels/timeline/TimelinePanel.ts +4 -3
- package/front_end/panels/timeline/TimelineUIUtils.ts +4 -20
- package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -0
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +2 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/adorners/Adorner.ts +2 -1
- package/front_end/ui/components/buttons/Button.docs.ts +195 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +49 -14
- package/front_end/ui/components/settings/settingCheckbox.css +6 -1
- package/front_end/ui/components/spinners/Spinners.docs.ts +13 -0
- package/front_end/ui/components/tooltips/Tooltip.docs.ts +76 -0
- package/front_end/ui/legacy/FilterBar.ts +1 -2
- package/front_end/ui/legacy/RadioButton.docs.ts +41 -0
- package/front_end/ui/legacy/SelectMenu.docs.ts +98 -0
- package/front_end/ui/legacy/Toolbar.ts +4 -6
- package/front_end/ui/legacy/UIUtils.ts +114 -1
- package/front_end/ui/legacy/Widget.ts +62 -34
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +125 -0
- package/front_end/ui/legacy/components/settings_ui/settings_ui.ts +8 -0
- package/front_end/ui/legacy/legacy.ts +0 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/package.json +1 -1
- package/front_end/models/trace/lantern/testing/MetricTestUtils.ts +0 -62
- package/front_end/models/trace/lantern/testing/testing.ts +0 -5
- package/front_end/ui/components/docs/button/basic.html +0 -44
- package/front_end/ui/components/docs/button/basic.ts +0 -175
- package/front_end/ui/components/docs/radio_button/basic.html +0 -23
- package/front_end/ui/components/docs/radio_button/basic.ts +0 -50
- package/front_end/ui/components/docs/select_menu/basic.html +0 -19
- package/front_end/ui/components/docs/select_menu/basic.ts +0 -95
- package/front_end/ui/components/docs/select_menu/wide-option.html +0 -38
- package/front_end/ui/components/docs/select_menu/wide-option.ts +0 -43
- package/front_end/ui/components/docs/spinners/basic.html +0 -17
- package/front_end/ui/components/docs/spinners/basic.ts +0 -22
- package/front_end/ui/components/docs/tooltip/basic.html +0 -20
- package/front_end/ui/components/docs/tooltip/basic.ts +0 -82
- package/front_end/ui/legacy/SettingsUI.ts +0 -240
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import '../../../ui/components/chrome_link/chrome_link.js';
|
|
6
6
|
import '../../../ui/components/expandable_list/expandable_list.js';
|
|
7
7
|
import '../../../ui/components/report_view/report_view.js';
|
|
8
|
-
import '../../../ui/
|
|
8
|
+
import '../../../ui/legacy/legacy.js';
|
|
9
9
|
|
|
10
10
|
import * as Common from '../../../core/common/common.js';
|
|
11
11
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
@@ -15,7 +15,6 @@ import * as Protocol from '../../../generated/protocol.js';
|
|
|
15
15
|
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
|
16
16
|
import type * as ExpandableList from '../../../ui/components/expandable_list/expandable_list.js';
|
|
17
17
|
import type * as ReportView from '../../../ui/components/report_view/report_view.js';
|
|
18
|
-
import type * as TreeOutline from '../../../ui/components/tree_outline/tree_outline.js';
|
|
19
18
|
import * as Components from '../../../ui/legacy/components/utils/utils.js';
|
|
20
19
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
21
20
|
import {html, type LitTemplate, nothing, render, type TemplateResult} from '../../../ui/lit/lit.js';
|
|
@@ -213,22 +212,23 @@ function maybeRenderFrameTree(
|
|
|
213
212
|
return nothing;
|
|
214
213
|
}
|
|
215
214
|
|
|
216
|
-
function
|
|
215
|
+
function renderFrameTreeNode(node: FrameTreeNodeData): TemplateResult {
|
|
217
216
|
// clang-format off
|
|
218
217
|
return html`
|
|
219
|
-
<
|
|
220
|
-
${node.
|
|
221
|
-
<devtools-icon class="inline-icon extra-large" .name=${node.
|
|
218
|
+
<li role="treeitem" class="text-ellipsis">
|
|
219
|
+
${node.iconName ? html`
|
|
220
|
+
<devtools-icon class="inline-icon extra-large" .name=${node.iconName} style="margin-bottom: -3px;">
|
|
222
221
|
</devtools-icon>
|
|
223
222
|
` : nothing}
|
|
224
|
-
${node.
|
|
225
|
-
|
|
223
|
+
${node.text}
|
|
224
|
+
${node.children?.length ? html`
|
|
225
|
+
<ul role="group" hidden>
|
|
226
|
+
${node.children.map(child => renderFrameTreeNode(child))}
|
|
227
|
+
</ul>` : nothing}
|
|
228
|
+
</li>`;
|
|
226
229
|
// clang-format on
|
|
227
230
|
}
|
|
228
231
|
|
|
229
|
-
const frameTreeNode = buildFrameTree(frameTreeData.node);
|
|
230
|
-
// Override the icon for the outermost frame.
|
|
231
|
-
frameTreeNode.treeNodeData.iconName = 'frame';
|
|
232
232
|
let title = '';
|
|
233
233
|
// The translation pipeline does not support nested plurals. We avoid this
|
|
234
234
|
// here by pulling out the logic for one of the plurals into code instead.
|
|
@@ -237,49 +237,31 @@ function maybeRenderFrameTree(
|
|
|
237
237
|
} else {
|
|
238
238
|
title = i18nString(UIStrings.issuesInMultipleFrames, {n: frameTreeData.issueCount, m: frameTreeData.frameCount});
|
|
239
239
|
}
|
|
240
|
-
const root: TreeOutline.TreeOutlineUtils.TreeNode<FrameTreeNodeData> = {
|
|
241
|
-
treeNodeData: {
|
|
242
|
-
text: title,
|
|
243
|
-
},
|
|
244
|
-
id: 'root',
|
|
245
|
-
children: () => Promise.resolve([frameTreeNode]),
|
|
246
|
-
};
|
|
247
|
-
|
|
248
240
|
// clang-format off
|
|
249
241
|
return html`
|
|
250
242
|
<devtools-report-key jslog=${VisualLogging.section('frames')}>${i18nString(UIStrings.framesTitle)}</devtools-report-key>
|
|
251
243
|
<devtools-report-value>
|
|
252
|
-
<devtools-tree
|
|
253
|
-
tree
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
244
|
+
<devtools-tree .template=${html`
|
|
245
|
+
<ul role="tree">
|
|
246
|
+
<li role="treeitem" class="text-ellipsis">
|
|
247
|
+
${title}
|
|
248
|
+
<ul role="group">
|
|
249
|
+
${renderFrameTreeNode(frameTreeData.node)}
|
|
250
|
+
</ul>
|
|
251
|
+
</li>
|
|
252
|
+
</ul>
|
|
253
|
+
`}>
|
|
254
|
+
</devtools-tree>
|
|
258
255
|
</devtools-report-value>`;
|
|
259
256
|
// clang-format on
|
|
260
257
|
}
|
|
261
258
|
|
|
262
|
-
let nextNodeId = 0;
|
|
263
|
-
|
|
264
|
-
function buildFrameTree(data: FrameTreeNodeData): TreeOutline.TreeOutlineUtils.TreeNode<FrameTreeNodeData> {
|
|
265
|
-
const children = data.children;
|
|
266
|
-
const node = {
|
|
267
|
-
treeNodeData: {
|
|
268
|
-
text: data.text,
|
|
269
|
-
...(data.iconName ? {iconName: data.iconName} : {}),
|
|
270
|
-
},
|
|
271
|
-
...(children?.length ? {children: () => Promise.resolve(children.map(child => buildFrameTree(child)))} : {}),
|
|
272
|
-
id: String(nextNodeId++),
|
|
273
|
-
};
|
|
274
|
-
return node;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
259
|
function renderBackForwardCacheStatus(status: boolean|undefined): TemplateResult {
|
|
278
260
|
switch (status) {
|
|
279
261
|
case true:
|
|
280
262
|
// clang-format off
|
|
281
263
|
return html`
|
|
282
|
-
<devtools-report-section
|
|
264
|
+
<devtools-report-section autofocus tabindex="-1">
|
|
283
265
|
<div class="status extra-large">
|
|
284
266
|
<devtools-icon class="inline-icon extra-large" name="check-circle" style="color: var(--icon-checkmark-green);">
|
|
285
267
|
</devtools-icon>
|
|
@@ -290,7 +272,7 @@ function renderBackForwardCacheStatus(status: boolean|undefined): TemplateResult
|
|
|
290
272
|
case false:
|
|
291
273
|
// clang-format off
|
|
292
274
|
return html`
|
|
293
|
-
<devtools-report-section
|
|
275
|
+
<devtools-report-section autofocus tabindex="-1">
|
|
294
276
|
<div class="status">
|
|
295
277
|
<devtools-icon class="inline-icon extra-large" name="clear">
|
|
296
278
|
</devtools-icon>
|
|
@@ -301,7 +283,7 @@ function renderBackForwardCacheStatus(status: boolean|undefined): TemplateResult
|
|
|
301
283
|
}
|
|
302
284
|
// clang-format off
|
|
303
285
|
return html`
|
|
304
|
-
<devtools-report-section
|
|
286
|
+
<devtools-report-section autofocus tabindex="-1">
|
|
305
287
|
${i18nString(UIStrings.unknown)}
|
|
306
288
|
</devtools-report-section>`;
|
|
307
289
|
// clang-format on
|
|
@@ -477,7 +459,7 @@ export class BackForwardCacheView extends UI.Widget.Widget {
|
|
|
477
459
|
#view: View;
|
|
478
460
|
|
|
479
461
|
constructor(view = DEFAULT_VIEW) {
|
|
480
|
-
super({useShadowDom: true});
|
|
462
|
+
super({useShadowDom: true, delegatesFocus: true});
|
|
481
463
|
this.#view = view;
|
|
482
464
|
this.#getMainResourceTreeModel()?.addEventListener(
|
|
483
465
|
SDK.ResourceTreeModel.Events.PrimaryPageChanged, this.requestUpdate, this);
|
|
@@ -497,13 +479,17 @@ export class BackForwardCacheView extends UI.Widget.Widget {
|
|
|
497
479
|
|
|
498
480
|
override async performUpdate(): Promise<void> {
|
|
499
481
|
const reasonToFramesMap = new Map<Protocol.Page.BackForwardCacheNotRestoredReason, string[]>();
|
|
500
|
-
const
|
|
482
|
+
const frame = this.#getMainFrame();
|
|
483
|
+
const explanationTree = frame?.backForwardCacheDetails?.explanationsTree;
|
|
501
484
|
if (explanationTree) {
|
|
502
485
|
this.#buildReasonToFramesMap(explanationTree, {blankCount: 1}, reasonToFramesMap);
|
|
503
486
|
}
|
|
487
|
+
const frameTreeData = this.#buildFrameTreeDataRecursive(explanationTree, {blankCount: 1});
|
|
488
|
+
// Override the icon for the outermost frame.
|
|
489
|
+
frameTreeData.node.iconName = 'frame';
|
|
504
490
|
const viewInput: ViewInput = {
|
|
505
|
-
frame
|
|
506
|
-
frameTreeData
|
|
491
|
+
frame,
|
|
492
|
+
frameTreeData,
|
|
507
493
|
reasonToFramesMap,
|
|
508
494
|
screenStatus: this.#screenStatus,
|
|
509
495
|
navigateAwayAndBack: this.#navigateAwayAndBack.bind(this),
|
|
@@ -519,10 +505,7 @@ export class BackForwardCacheView extends UI.Widget.Widget {
|
|
|
519
505
|
this.requestUpdate();
|
|
520
506
|
void this.updateComplete.then(() => {
|
|
521
507
|
UI.ARIAUtils.LiveAnnouncer.alert(i18nString(UIStrings.testCompleted));
|
|
522
|
-
|
|
523
|
-
if (resultsSection) {
|
|
524
|
-
resultsSection.focus();
|
|
525
|
-
}
|
|
508
|
+
this.contentElement.focus();
|
|
526
509
|
});
|
|
527
510
|
}
|
|
528
511
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
6
6
|
|
|
7
7
|
import '../../../ui/components/icon_button/icon_button.js';
|
|
8
|
-
import '../../../ui/
|
|
8
|
+
import '../../../ui/legacy/legacy.js';
|
|
9
9
|
|
|
10
10
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
11
11
|
import * as Protocol from '../../../generated/protocol.js';
|
|
@@ -78,6 +78,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
78
78
|
export interface BadgeData {
|
|
79
79
|
badgeContent: string;
|
|
80
80
|
style: 'error'|'success'|'secondary';
|
|
81
|
+
additionalClass?: string;
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
function createBadge(data: BadgeData): Adorners.Adorner.Adorner {
|
|
@@ -89,6 +90,9 @@ function createBadge(data: BadgeData): Adorners.Adorner.Adorner {
|
|
|
89
90
|
content: adornerContent,
|
|
90
91
|
};
|
|
91
92
|
adorner.classList.add(`badge-${data.style}`);
|
|
93
|
+
if (data.additionalClass) {
|
|
94
|
+
adorner.classList.add(data.additionalClass);
|
|
95
|
+
}
|
|
92
96
|
return adorner;
|
|
93
97
|
}
|
|
94
98
|
|
|
@@ -103,48 +107,46 @@ type TreeNode<DataType> = TreeOutline.TreeOutlineUtils.TreeNode<DataType>;
|
|
|
103
107
|
**/
|
|
104
108
|
export type OriginTrialTreeNodeData = Protocol.Page.OriginTrial|Protocol.Page.OriginTrialTokenWithStatus|string;
|
|
105
109
|
|
|
106
|
-
function constructOriginTrialTree(originTrial: Protocol.Page.OriginTrial):
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
originTrial.tokensWithStatus.map(constructTokenNode) :
|
|
112
|
-
constructTokenDetailsNodes(originTrial.tokensWithStatus[0]),
|
|
113
|
-
renderer: (node: TreeNode<OriginTrialTreeNodeData>) => {
|
|
114
|
-
const trial = node.treeNodeData as Protocol.Page.OriginTrial;
|
|
115
|
-
const tokenCountBadge = createBadge({
|
|
116
|
-
badgeContent: i18nString(UIStrings.tokens, {PH1: trial.tokensWithStatus.length}),
|
|
117
|
-
style: 'secondary',
|
|
118
|
-
});
|
|
110
|
+
function constructOriginTrialTree(originTrial: Protocol.Page.OriginTrial): Lit.LitTemplate {
|
|
111
|
+
const tokenCountBadge = createBadge({
|
|
112
|
+
badgeContent: i18nString(UIStrings.tokens, {PH1: originTrial.tokensWithStatus.length}),
|
|
113
|
+
style: 'secondary',
|
|
114
|
+
});
|
|
119
115
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
// clang-format off
|
|
117
|
+
return html`
|
|
118
|
+
<li role="treeitem">
|
|
119
|
+
${originTrial.trialName}
|
|
120
|
+
<style>${badgeStyles}</style>
|
|
121
|
+
${createBadge({
|
|
122
|
+
badgeContent: originTrial.status,
|
|
123
|
+
style: originTrial.status === Protocol.Page.OriginTrialStatus.Enabled ? 'success' : 'error',
|
|
126
124
|
})}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
${originTrial.tokensWithStatus.length > 1 ? tokenCountBadge : Lit.nothing}
|
|
126
|
+
<ul role="group" hidden>
|
|
127
|
+
${originTrial.tokensWithStatus.length > 1 ?
|
|
128
|
+
originTrial.tokensWithStatus.map(constructTokenNode) :
|
|
129
|
+
constructTokenDetailsNodes(originTrial.tokensWithStatus[0])}
|
|
130
|
+
</ul>
|
|
131
|
+
</li>`;
|
|
132
|
+
// clang-format on
|
|
131
133
|
}
|
|
132
134
|
|
|
133
|
-
function constructTokenNode(token: Protocol.Page.OriginTrialTokenWithStatus):
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
135
|
+
function constructTokenNode(token: Protocol.Page.OriginTrialTokenWithStatus): Lit.LitTemplate {
|
|
136
|
+
const statusBadge = createBadge({
|
|
137
|
+
badgeContent: token.status,
|
|
138
|
+
style: token.status === Protocol.Page.OriginTrialTokenStatus.Success ? 'success' : 'error',
|
|
139
|
+
additionalClass: 'token-status-badge',
|
|
140
|
+
});
|
|
141
|
+
// Only display token status for convenience when the node is not expanded.
|
|
142
|
+
// clang-format off
|
|
143
|
+
return html`
|
|
144
|
+
<li role="treeitem">
|
|
145
|
+
${i18nString(UIStrings.token)} ${statusBadge}
|
|
146
|
+
<ul role="group" hidden>
|
|
147
|
+
${constructTokenDetailsNodes(token)}
|
|
148
|
+
</ul>
|
|
149
|
+
</li>`;
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
interface TokenField {
|
|
@@ -152,46 +154,38 @@ interface TokenField {
|
|
|
152
154
|
value: Lit.TemplateResult;
|
|
153
155
|
}
|
|
154
156
|
|
|
155
|
-
function renderTokenDetails(
|
|
157
|
+
function renderTokenDetails(token: Protocol.Page.OriginTrialTokenWithStatus): Lit.TemplateResult {
|
|
156
158
|
return html`
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
<li role="treeitem">
|
|
160
|
+
<devtools-resources-origin-trial-token-rows .data=${token}>
|
|
161
|
+
</devtools-resources-origin-trial-token-rows>
|
|
162
|
+
</li>`;
|
|
160
163
|
}
|
|
161
164
|
|
|
162
165
|
function constructTokenDetailsNodes(token: Protocol.Page.OriginTrialTokenWithStatus):
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
constructRawTokenTextNode(token.rawTokenText),
|
|
171
|
-
];
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function constructRawTokenTextNode(tokenText: string): TreeNode<OriginTrialTreeNodeData> {
|
|
175
|
-
return {
|
|
176
|
-
treeNodeData: i18nString(UIStrings.rawTokenText),
|
|
177
|
-
id: 'TokenRawTextContainerNode#' + tokenText,
|
|
178
|
-
children: async () => [{
|
|
179
|
-
treeNodeData: tokenText,
|
|
180
|
-
id: 'TokenRawTextNode#' + tokenText,
|
|
181
|
-
renderer: (data: TreeNode<OriginTrialTreeNodeData>) => {
|
|
182
|
-
const tokenText = data.treeNodeData as string;
|
|
183
|
-
return html`
|
|
184
|
-
<div style="overflow-wrap: break-word;">
|
|
185
|
-
${tokenText}
|
|
186
|
-
</div>
|
|
187
|
-
`;
|
|
188
|
-
},
|
|
189
|
-
}],
|
|
190
|
-
};
|
|
166
|
+
Lit.LitTemplate {
|
|
167
|
+
// clang-format off
|
|
168
|
+
return html`
|
|
169
|
+
${renderTokenDetails(token)}
|
|
170
|
+
${constructRawTokenTextNode(token.rawTokenText)}
|
|
171
|
+
`;
|
|
172
|
+
// clang-format on
|
|
191
173
|
}
|
|
192
174
|
|
|
193
|
-
function
|
|
194
|
-
|
|
175
|
+
function constructRawTokenTextNode(tokenText: string): Lit.LitTemplate {
|
|
176
|
+
// clang-format off
|
|
177
|
+
return html`
|
|
178
|
+
<li role="treeitem">
|
|
179
|
+
${i18nString(UIStrings.rawTokenText)}
|
|
180
|
+
<ul role="group" hidden>
|
|
181
|
+
<li role="treeitem">
|
|
182
|
+
<div style="overflow-wrap: break-word;">
|
|
183
|
+
${tokenText}
|
|
184
|
+
</div>
|
|
185
|
+
</li>
|
|
186
|
+
</ul>
|
|
187
|
+
</li>`;
|
|
188
|
+
// clang-format on
|
|
195
189
|
}
|
|
196
190
|
|
|
197
191
|
export interface OriginTrialTokenRowsData {
|
|
@@ -207,8 +201,8 @@ export class OriginTrialTokenRows extends HTMLElement {
|
|
|
207
201
|
{dateStyle: 'long', timeStyle: 'long'},
|
|
208
202
|
);
|
|
209
203
|
|
|
210
|
-
set data(data:
|
|
211
|
-
this.#tokenWithStatus = data
|
|
204
|
+
set data(data: Protocol.Page.OriginTrialTokenWithStatus) {
|
|
205
|
+
this.#tokenWithStatus = data;
|
|
212
206
|
this.#setTokenFields();
|
|
213
207
|
}
|
|
214
208
|
|
|
@@ -216,6 +210,14 @@ export class OriginTrialTokenRows extends HTMLElement {
|
|
|
216
210
|
this.#render();
|
|
217
211
|
}
|
|
218
212
|
|
|
213
|
+
override cloneNode(): HTMLElement {
|
|
214
|
+
const clone = UI.UIUtils.cloneCustomElement(this);
|
|
215
|
+
if (this.#tokenWithStatus) {
|
|
216
|
+
clone.data = this.#tokenWithStatus;
|
|
217
|
+
}
|
|
218
|
+
return clone;
|
|
219
|
+
}
|
|
220
|
+
|
|
219
221
|
#renderTokenField = (fieldValue: string, hasError?: boolean): Lit.TemplateResult => html`
|
|
220
222
|
<div class=${ifDefined(hasError ? 'error-text' : undefined)}>
|
|
221
223
|
${fieldValue}
|
|
@@ -327,11 +329,12 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
327
329
|
<style>
|
|
328
330
|
${originTrialTreeViewStyles}
|
|
329
331
|
</style>
|
|
330
|
-
<devtools-tree
|
|
331
|
-
tree
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
332
|
+
<devtools-tree .template=${html`
|
|
333
|
+
<ul role="tree">
|
|
334
|
+
${input.trials.map(constructOriginTrialTree)}
|
|
335
|
+
</ul>
|
|
336
|
+
`}>
|
|
337
|
+
</devtools-tree>
|
|
335
338
|
`, target);
|
|
336
339
|
// clang-format on
|
|
337
340
|
};
|
|
@@ -16,7 +16,7 @@ import type * as UI from '../../../../ui/legacy/legacy.js';
|
|
|
16
16
|
import * as Lit from '../../../../ui/lit/lit.js';
|
|
17
17
|
|
|
18
18
|
import preloadingGridStyles from './preloadingGrid.css.js';
|
|
19
|
-
import {capitalizedAction, composedStatus, ruleSetTagOrLocationShort} from './PreloadingString.js';
|
|
19
|
+
import {capitalizedAction, composedStatus, ruleSetTagOrLocationShort, sortOrder} from './PreloadingString.js';
|
|
20
20
|
|
|
21
21
|
const {PreloadingStatus} = SDK.PreloadingModel;
|
|
22
22
|
|
|
@@ -100,7 +100,7 @@ export class PreloadingGrid extends LegacyWrapper.LegacyWrapper.WrappableCompone
|
|
|
100
100
|
<td title=${attempt.key.url}>${this.#urlShort(row, securityOrigin)}</td>
|
|
101
101
|
<td>${capitalizedAction(attempt.action)}</td>
|
|
102
102
|
<td>${row.ruleSets.length === 0 ? '' : ruleSetTagOrLocationShort(row.ruleSets[0], pageURL)}</td>
|
|
103
|
-
<td>
|
|
103
|
+
<td data-value=${sortOrder(attempt)}>
|
|
104
104
|
<div style=${styleMap({color: hasWarning ? 'var(--sys-color-orange-bright)'
|
|
105
105
|
: hasError ? 'var(--sys-color-error)'
|
|
106
106
|
: 'var(--sys-color-on-surface)'})}>
|
|
@@ -741,6 +741,33 @@ export function capitalizedAction(action: Protocol.Preload.SpeculationAction): C
|
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
743
|
|
|
744
|
+
export function sortOrder(attempt: SDK.PreloadingModel.PreloadingAttempt): number {
|
|
745
|
+
switch (attempt.status) {
|
|
746
|
+
case SDK.PreloadingModel.PreloadingStatus.NOT_TRIGGERED:
|
|
747
|
+
return 0;
|
|
748
|
+
case SDK.PreloadingModel.PreloadingStatus.NOT_SUPPORTED:
|
|
749
|
+
return 1;
|
|
750
|
+
case SDK.PreloadingModel.PreloadingStatus.PENDING:
|
|
751
|
+
return 2;
|
|
752
|
+
case SDK.PreloadingModel.PreloadingStatus.RUNNING:
|
|
753
|
+
return 3;
|
|
754
|
+
case SDK.PreloadingModel.PreloadingStatus.READY:
|
|
755
|
+
return 4;
|
|
756
|
+
case SDK.PreloadingModel.PreloadingStatus.SUCCESS:
|
|
757
|
+
return 5;
|
|
758
|
+
case SDK.PreloadingModel.PreloadingStatus.FAILURE: {
|
|
759
|
+
switch (attempt.action) {
|
|
760
|
+
case Protocol.Preload.SpeculationAction.Prefetch:
|
|
761
|
+
return 6;
|
|
762
|
+
case Protocol.Preload.SpeculationAction.Prerender:
|
|
763
|
+
return 7;
|
|
764
|
+
case Protocol.Preload.SpeculationAction.PrerenderUntilScript:
|
|
765
|
+
return 8;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
|
|
744
771
|
export function status(status: SDK.PreloadingModel.PreloadingStatus): string {
|
|
745
772
|
// See content/public/browser/preloading.h PreloadingAttemptOutcome.
|
|
746
773
|
switch (status) {
|
|
@@ -20,7 +20,7 @@ import autofillViewStyles from './autofillView.css.js';
|
|
|
20
20
|
|
|
21
21
|
const {html, render, Directives: {styleMap}} = Lit;
|
|
22
22
|
const {FillingStrategy} = Protocol.Autofill;
|
|
23
|
-
const {bindToSetting} = UI.
|
|
23
|
+
const {bindToSetting} = UI.UIUtils;
|
|
24
24
|
|
|
25
25
|
const UIStrings = {
|
|
26
26
|
/**
|
|
@@ -51,6 +51,7 @@ import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
|
51
51
|
import * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js';
|
|
52
52
|
// eslint-disable-next-line @devtools/es-modules-import
|
|
53
53
|
import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
|
|
54
|
+
import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
|
|
54
55
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
55
56
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
56
57
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
@@ -470,29 +471,30 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
470
471
|
const preserveConsoleLogSetting = Common.Settings.Settings.instance().moduleSetting('preserve-console-log');
|
|
471
472
|
const userActivationEvalSetting = Common.Settings.Settings.instance().moduleSetting('console-user-activation-eval');
|
|
472
473
|
settingsPane.append(
|
|
473
|
-
|
|
474
|
+
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
474
475
|
i18nString(UIStrings.hideNetwork), this.filter.hideNetworkMessagesSetting,
|
|
475
476
|
this.filter.hideNetworkMessagesSetting.title()),
|
|
476
|
-
|
|
477
|
-
|
|
477
|
+
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
478
|
+
i18nString(UIStrings.logXMLHttpRequests), monitoringXHREnabledSetting),
|
|
479
|
+
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
478
480
|
i18nString(UIStrings.preserveLog), preserveConsoleLogSetting,
|
|
479
481
|
i18nString(UIStrings.doNotClearLogOnPageReload)),
|
|
480
|
-
|
|
482
|
+
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
481
483
|
consoleEagerEvalSetting.title(), consoleEagerEvalSetting,
|
|
482
484
|
i18nString(UIStrings.eagerlyEvaluateTextInThePrompt)),
|
|
483
|
-
|
|
485
|
+
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
484
486
|
i18nString(UIStrings.selectedContextOnly), this.filter.filterByExecutionContextSetting,
|
|
485
487
|
i18nString(UIStrings.onlyShowMessagesFromTheCurrentContext)),
|
|
486
|
-
|
|
488
|
+
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
487
489
|
this.consoleHistoryAutocompleteSetting.title(), this.consoleHistoryAutocompleteSetting,
|
|
488
490
|
i18nString(UIStrings.autocompleteFromHistory)),
|
|
489
|
-
|
|
491
|
+
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
490
492
|
this.groupSimilarSetting.title(), this.groupSimilarSetting,
|
|
491
493
|
i18nString(UIStrings.groupSimilarMessagesInConsole)),
|
|
492
|
-
|
|
494
|
+
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
493
495
|
userActivationEvalSetting.title(), userActivationEvalSetting,
|
|
494
496
|
i18nString(UIStrings.treatEvaluationAsUserActivation)),
|
|
495
|
-
|
|
497
|
+
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
496
498
|
this.showCorsErrorsSetting.title(), this.showCorsErrorsSetting,
|
|
497
499
|
i18nString(UIStrings.showCorsErrorsInConsole)),
|
|
498
500
|
);
|
|
@@ -126,8 +126,7 @@ const str_ = i18n.i18n.registerUIStrings('panels/coverage/CoverageView.ts', UISt
|
|
|
126
126
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
127
127
|
const i18nTemplate = unboundI18nTemplate.bind(undefined, str_);
|
|
128
128
|
const {ref} = Directives;
|
|
129
|
-
const {bindToAction} = UI.UIUtils;
|
|
130
|
-
const {bindToSetting} = UI.SettingsUI;
|
|
129
|
+
const {bindToAction, bindToSetting} = UI.UIUtils;
|
|
131
130
|
const {widgetConfig} = UI.Widget;
|
|
132
131
|
|
|
133
132
|
let coverageViewInstance: CoverageView|undefined;
|
|
@@ -129,7 +129,7 @@ export class CSSOverviewSidebarPanel extends UI.Widget.VBox {
|
|
|
129
129
|
this.requestUpdate();
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
#select(id: string, shouldFocus = false): Promise<
|
|
132
|
+
#select(id: string, shouldFocus = false): Promise<void> {
|
|
133
133
|
this.#selectedId = id;
|
|
134
134
|
this.requestUpdate();
|
|
135
135
|
this.#onItemSelected(id, shouldFocus);
|
|
@@ -17,7 +17,7 @@ import {DeveloperResourcesListView} from './DeveloperResourcesListView.js';
|
|
|
17
17
|
import developerResourcesViewStyles from './developerResourcesView.css.js';
|
|
18
18
|
|
|
19
19
|
const {widgetConfig} = UI.Widget;
|
|
20
|
-
const {bindToSetting} = UI.
|
|
20
|
+
const {bindToSetting} = UI.UIUtils;
|
|
21
21
|
|
|
22
22
|
const UIStrings = {
|
|
23
23
|
/**
|
|
@@ -12,7 +12,7 @@ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
|
12
12
|
import {ElementsPanel} from './ElementsPanel.js';
|
|
13
13
|
import elementStatePaneWidgetStyles from './elementStatePaneWidget.css.js';
|
|
14
14
|
|
|
15
|
-
const {bindToSetting} = UI.
|
|
15
|
+
const {bindToSetting} = UI.UIUtils;
|
|
16
16
|
|
|
17
17
|
const UIStrings = {
|
|
18
18
|
/**
|
|
@@ -39,8 +39,7 @@ import {html, render} from '../../ui/lit/lit.js';
|
|
|
39
39
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
40
40
|
import * as EventListeners from '../event_listeners/event_listeners.js';
|
|
41
41
|
|
|
42
|
-
const {bindToSetting} = UI.
|
|
43
|
-
const {bindToAction} = UI.UIUtils;
|
|
42
|
+
const {bindToAction, bindToSetting} = UI.UIUtils;
|
|
44
43
|
|
|
45
44
|
const UIStrings = {
|
|
46
45
|
/**
|
|
@@ -8,6 +8,7 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
8
8
|
import * as Platform from '../../core/platform/platform.js';
|
|
9
9
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
10
10
|
import * as Protocol from '../../generated/protocol.js';
|
|
11
|
+
import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
|
|
11
12
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
12
13
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
13
14
|
import * as MobileThrottling from '../mobile_throttling/mobile_throttling.js';
|
|
@@ -208,7 +209,7 @@ export class NetworkConfigView extends UI.Widget.VBox {
|
|
|
208
209
|
|
|
209
210
|
private createCacheSection(): void {
|
|
210
211
|
const section = this.createSection(i18nString(UIStrings.caching), 'network-config-disable-cache');
|
|
211
|
-
section.appendChild(
|
|
212
|
+
section.appendChild(SettingsUI.SettingsUI.createSettingCheckbox(
|
|
212
213
|
i18nString(UIStrings.disableCache), Common.Settings.Settings.instance().moduleSetting('cache-disabled')));
|
|
213
214
|
}
|
|
214
215
|
|
|
@@ -48,6 +48,7 @@ import type * as PanelCommon from '../../panels/common/common.js';
|
|
|
48
48
|
import * as NetworkForward from '../../panels/network/forward/forward.js';
|
|
49
49
|
import * as Tracing from '../../services/tracing/tracing.js';
|
|
50
50
|
import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';
|
|
51
|
+
import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
|
|
51
52
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
52
53
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
53
54
|
import * as MobileThrottling from '../mobile_throttling/mobile_throttling.js';
|
|
@@ -259,17 +260,17 @@ export class NetworkPanel extends UI.Panel.Panel implements
|
|
|
259
260
|
|
|
260
261
|
const settingsPane = panel.contentElement.createChild('div', 'network-settings-pane');
|
|
261
262
|
settingsPane.append(
|
|
262
|
-
|
|
263
|
+
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
263
264
|
i18nString(UIStrings.useLargeRequestRows), this.networkLogLargeRowsSetting,
|
|
264
265
|
i18nString(UIStrings.showMoreInformationInRequestRows)),
|
|
265
|
-
|
|
266
|
+
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
266
267
|
i18nString(UIStrings.groupByFrame),
|
|
267
268
|
Common.Settings.Settings.instance().moduleSetting('network.group-by-frame'),
|
|
268
269
|
i18nString(UIStrings.groupRequestsByTopLevelRequest)),
|
|
269
|
-
|
|
270
|
+
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
270
271
|
i18nString(UIStrings.showOverview), this.networkLogShowOverviewSetting,
|
|
271
272
|
i18nString(UIStrings.showOverviewOfNetworkRequests)),
|
|
272
|
-
|
|
273
|
+
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
273
274
|
i18nString(UIStrings.captureScreenshots), this.networkRecordFilmStripSetting,
|
|
274
275
|
i18nString(UIStrings.captureScreenshotsWhenLoadingA)),
|
|
275
276
|
|