chrome-devtools-frontend 1.0.1537268 → 1.0.1538310
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 +10 -0
- package/docs/get_the_code.md +27 -0
- package/eslint.config.mjs +151 -149
- package/front_end/core/common/SettingRegistration.ts +10 -7
- package/front_end/core/common/Settings.ts +3 -0
- package/front_end/core/host/AidaClient.ts +1 -0
- package/front_end/core/host/UserMetrics.ts +3 -1
- package/front_end/core/root/Runtime.ts +8 -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/ai_code_generation/AiCodeGeneration.ts +151 -0
- package/front_end/models/ai_code_generation/ai_code_generation.ts +6 -0
- package/front_end/models/ai_code_generation/debug.ts +30 -0
- 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/PreloadingTreeElement.ts +10 -2
- 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 +141 -170
- package/front_end/panels/application/components/backForwardCacheView.css +4 -0
- package/front_end/panels/application/components/originTrialTreeView.css +37 -7
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +30 -1
- 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/emulation/components/DeviceSizeInputElement.ts +1 -0
- package/front_end/panels/network/NetworkConfigView.ts +2 -1
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/network/NetworkPanel.ts +5 -4
- package/front_end/panels/network/NetworkWaterfallColumn.ts +5 -6
- package/front_end/panels/network/RequestCookiesView.ts +2 -1
- package/front_end/panels/network/RequestTimingView.ts +404 -348
- package/front_end/panels/network/networkTimingTable.css +22 -2
- 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/NetworkRequestTooltip.ts +42 -3
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +2 -0
- package/front_end/panels/timeline/components/networkRequestTooltip.css +19 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/adorners/Adorner.ts +3 -1
- package/front_end/ui/components/buttons/Button.docs.ts +195 -0
- package/front_end/ui/components/icon_button/IconButton.ts +1 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +50 -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/Treeoutline.ts +15 -0
- package/front_end/ui/legacy/UIUtils.ts +117 -1
- package/front_end/ui/legacy/Widget.ts +68 -38
- package/front_end/ui/legacy/XLink.ts +1 -0
- package/front_end/ui/legacy/components/inline_editor/Swatches.ts +1 -0
- package/front_end/ui/legacy/components/perf_ui/BrickBreaker.ts +1 -0
- 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/legacy/popover.css +12 -11
- 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/panels/application/components/badge.css +0 -25
- 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
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
// Copyright 2021 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
|
-
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
6
4
|
|
|
7
5
|
import '../../../ui/components/icon_button/icon_button.js';
|
|
8
|
-
import '../../../ui/
|
|
6
|
+
import '../../../ui/legacy/legacy.js';
|
|
7
|
+
import '../../../ui/components/adorners/adorners.js';
|
|
9
8
|
|
|
10
9
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
11
10
|
import * as Protocol from '../../../generated/protocol.js';
|
|
12
|
-
import * as Adorners from '../../../ui/components/adorners/adorners.js';
|
|
13
11
|
import type * as TreeOutline from '../../../ui/components/tree_outline/tree_outline.js';
|
|
14
12
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
15
|
-
import
|
|
13
|
+
import {Directives, html, type LitTemplate, nothing, render, type TemplateResult} from '../../../ui/lit/lit.js';
|
|
16
14
|
|
|
17
|
-
import badgeStyles from './badge.css.js';
|
|
18
15
|
import originTrialTokenRowsStyles from './originTrialTokenRows.css.js';
|
|
19
16
|
import originTrialTreeViewStyles from './originTrialTreeView.css.js';
|
|
20
17
|
|
|
21
|
-
const {
|
|
18
|
+
const {classMap} = Directives;
|
|
19
|
+
const {widgetConfig} = UI.Widget;
|
|
22
20
|
|
|
23
21
|
const UIStrings = {
|
|
24
22
|
/**
|
|
@@ -75,23 +73,6 @@ const UIStrings = {
|
|
|
75
73
|
const str_ = i18n.i18n.registerUIStrings('panels/application/components/OriginTrialTreeView.ts', UIStrings);
|
|
76
74
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
77
75
|
|
|
78
|
-
export interface BadgeData {
|
|
79
|
-
badgeContent: string;
|
|
80
|
-
style: 'error'|'success'|'secondary';
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function createBadge(data: BadgeData): Adorners.Adorner.Adorner {
|
|
84
|
-
const adorner = new Adorners.Adorner.Adorner();
|
|
85
|
-
const adornerContent = document.createElement('span');
|
|
86
|
-
adornerContent.textContent = data.badgeContent;
|
|
87
|
-
adorner.data = {
|
|
88
|
-
name: 'badge',
|
|
89
|
-
content: adornerContent,
|
|
90
|
-
};
|
|
91
|
-
adorner.classList.add(`badge-${data.style}`);
|
|
92
|
-
return adorner;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
76
|
type TreeNode<DataType> = TreeOutline.TreeOutlineUtils.TreeNode<DataType>;
|
|
96
77
|
|
|
97
78
|
/**
|
|
@@ -103,103 +84,124 @@ type TreeNode<DataType> = TreeOutline.TreeOutlineUtils.TreeNode<DataType>;
|
|
|
103
84
|
**/
|
|
104
85
|
export type OriginTrialTreeNodeData = Protocol.Page.OriginTrial|Protocol.Page.OriginTrialTokenWithStatus|string;
|
|
105
86
|
|
|
106
|
-
function
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
${
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
${trial.tokensWithStatus.length > 1 ? tokenCountBadge : Lit.nothing}
|
|
128
|
-
`;
|
|
129
|
-
},
|
|
130
|
-
};
|
|
87
|
+
function renderOriginTrialTree(originTrial: Protocol.Page.OriginTrial): LitTemplate {
|
|
88
|
+
const success = originTrial.status === Protocol.Page.OriginTrialStatus.Enabled;
|
|
89
|
+
// clang-format off
|
|
90
|
+
return html`
|
|
91
|
+
<li role="treeitem">
|
|
92
|
+
${originTrial.trialName}
|
|
93
|
+
<devtools-adorner class="badge-${success ? 'success' : 'error'}">
|
|
94
|
+
${originTrial.status}
|
|
95
|
+
</devtools-adorner>
|
|
96
|
+
${originTrial.tokensWithStatus.length > 1 ? html`
|
|
97
|
+
<devtools-adorner class="badge-secondary">
|
|
98
|
+
${i18nString(UIStrings.tokens, {PH1: originTrial.tokensWithStatus.length})}
|
|
99
|
+
</devtools-adorner>`
|
|
100
|
+
: nothing}
|
|
101
|
+
<ul role="group" hidden>
|
|
102
|
+
${originTrial.tokensWithStatus.length > 1 ?
|
|
103
|
+
originTrial.tokensWithStatus.map(renderTokenNode) :
|
|
104
|
+
renderTokenDetailsNodes(originTrial.tokensWithStatus[0])}
|
|
105
|
+
</ul>
|
|
106
|
+
</li>`;
|
|
107
|
+
// clang-format on
|
|
131
108
|
}
|
|
132
109
|
|
|
133
|
-
function
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
};
|
|
110
|
+
function renderTokenNode(token: Protocol.Page.OriginTrialTokenWithStatus): LitTemplate {
|
|
111
|
+
const success = token.status === Protocol.Page.OriginTrialTokenStatus.Success;
|
|
112
|
+
// Only display token status for convenience when the node is not expanded.
|
|
113
|
+
// clang-format off
|
|
114
|
+
return html`
|
|
115
|
+
<li role="treeitem">
|
|
116
|
+
${i18nString(UIStrings.token)}
|
|
117
|
+
<devtools-adorner class="token-status-badge badge-${success ? 'success' : 'error'}">
|
|
118
|
+
${token.status}
|
|
119
|
+
</devtools-adorner>
|
|
120
|
+
<ul role="group" hidden>
|
|
121
|
+
${renderTokenDetailsNodes(token)}
|
|
122
|
+
</ul>
|
|
123
|
+
</li>`;
|
|
148
124
|
}
|
|
149
125
|
|
|
150
126
|
interface TokenField {
|
|
151
127
|
name: string;
|
|
152
|
-
value:
|
|
128
|
+
value: {text: string, hasError?: boolean};
|
|
153
129
|
}
|
|
154
130
|
|
|
155
|
-
function renderTokenDetails(
|
|
131
|
+
function renderTokenDetails(token: Protocol.Page.OriginTrialTokenWithStatus): TemplateResult {
|
|
156
132
|
return html`
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
function constructTokenDetailsNodes(token: Protocol.Page.OriginTrialTokenWithStatus):
|
|
163
|
-
Array<TreeNode<OriginTrialTreeNodeData>> {
|
|
164
|
-
return [
|
|
165
|
-
{
|
|
166
|
-
treeNodeData: token,
|
|
167
|
-
id: 'TokenDetailsNode#' + token.rawTokenText,
|
|
168
|
-
renderer: renderTokenDetails,
|
|
169
|
-
},
|
|
170
|
-
constructRawTokenTextNode(token.rawTokenText),
|
|
171
|
-
];
|
|
133
|
+
<li role="treeitem">
|
|
134
|
+
<devtools-widget .widgetConfig=${widgetConfig(OriginTrialTokenRows, {data: token})}>
|
|
135
|
+
</devtools-widget>
|
|
136
|
+
</li>`;
|
|
172
137
|
}
|
|
173
138
|
|
|
174
|
-
function
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
};
|
|
139
|
+
function renderTokenDetailsNodes(token: Protocol.Page.OriginTrialTokenWithStatus):
|
|
140
|
+
TemplateResult {
|
|
141
|
+
// clang-format off
|
|
142
|
+
return html`
|
|
143
|
+
${renderTokenDetails(token)}
|
|
144
|
+
${renderRawTokenTextNode(token.rawTokenText)}
|
|
145
|
+
`;
|
|
146
|
+
// clang-format on
|
|
191
147
|
}
|
|
192
148
|
|
|
193
|
-
function
|
|
194
|
-
|
|
149
|
+
function renderRawTokenTextNode(tokenText: string): LitTemplate {
|
|
150
|
+
// clang-format off
|
|
151
|
+
return html`
|
|
152
|
+
<li role="treeitem">
|
|
153
|
+
${i18nString(UIStrings.rawTokenText)}
|
|
154
|
+
<ul role="group" hidden>
|
|
155
|
+
<li role="treeitem">
|
|
156
|
+
<div style="overflow-wrap: break-word;">
|
|
157
|
+
${tokenText}
|
|
158
|
+
</div>
|
|
159
|
+
</li>
|
|
160
|
+
</ul>
|
|
161
|
+
</li>`;
|
|
162
|
+
// clang-format on
|
|
195
163
|
}
|
|
196
164
|
|
|
197
165
|
export interface OriginTrialTokenRowsData {
|
|
198
166
|
node: TreeNode<OriginTrialTreeNodeData>;
|
|
199
167
|
}
|
|
200
168
|
|
|
201
|
-
|
|
202
|
-
|
|
169
|
+
interface RowsViewInput {
|
|
170
|
+
tokenWithStatus: Protocol.Page.OriginTrialTokenWithStatus;
|
|
171
|
+
parsedTokenDetails: TokenField[];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
type RowsView = (input: RowsViewInput, output: undefined, target: HTMLElement) => void;
|
|
175
|
+
|
|
176
|
+
const ROWS_DEFAULT_VIEW: RowsView = (input, _output, target) => {
|
|
177
|
+
const success = input.tokenWithStatus.status === Protocol.Page.OriginTrialTokenStatus.Success;
|
|
178
|
+
// clang-format off
|
|
179
|
+
render(html`
|
|
180
|
+
<style>
|
|
181
|
+
${originTrialTokenRowsStyles}
|
|
182
|
+
${originTrialTreeViewStyles}
|
|
183
|
+
</style>
|
|
184
|
+
<div class="content">
|
|
185
|
+
<div class="key">${i18nString(UIStrings.status)}</div>
|
|
186
|
+
<div class="value">
|
|
187
|
+
<devtools-adorner class="badge-${success ? 'success' : 'error'}">
|
|
188
|
+
${input.tokenWithStatus.status}
|
|
189
|
+
</devtools-adorner>
|
|
190
|
+
</div>
|
|
191
|
+
${input.parsedTokenDetails.map((field: TokenField) => html`
|
|
192
|
+
<div class="key">${field.name}</div>
|
|
193
|
+
<div class="value">
|
|
194
|
+
<div class=${classMap({'error-text': Boolean(field.value.hasError)})}>
|
|
195
|
+
${field.value.text}
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
`)}
|
|
199
|
+
</div>`, target);
|
|
200
|
+
// clang-format on
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export class OriginTrialTokenRows extends UI.Widget.Widget {
|
|
204
|
+
#view: RowsView;
|
|
203
205
|
#tokenWithStatus: Protocol.Page.OriginTrialTokenWithStatus|null = null;
|
|
204
206
|
#parsedTokenDetails: TokenField[] = [];
|
|
205
207
|
#dateFormatter: Intl.DateTimeFormat = new Intl.DateTimeFormat(
|
|
@@ -207,20 +209,20 @@ export class OriginTrialTokenRows extends HTMLElement {
|
|
|
207
209
|
{dateStyle: 'long', timeStyle: 'long'},
|
|
208
210
|
);
|
|
209
211
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
+
constructor(element?: HTMLElement, view: RowsView = ROWS_DEFAULT_VIEW) {
|
|
213
|
+
super(element, {useShadowDom: true});
|
|
214
|
+
this.#view = view;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
set data(data: Protocol.Page.OriginTrialTokenWithStatus) {
|
|
218
|
+
this.#tokenWithStatus = data;
|
|
212
219
|
this.#setTokenFields();
|
|
213
220
|
}
|
|
214
221
|
|
|
215
222
|
connectedCallback(): void {
|
|
216
|
-
this
|
|
223
|
+
this.requestUpdate();
|
|
217
224
|
}
|
|
218
225
|
|
|
219
|
-
#renderTokenField = (fieldValue: string, hasError?: boolean): Lit.TemplateResult => html`
|
|
220
|
-
<div class=${ifDefined(hasError ? 'error-text' : undefined)}>
|
|
221
|
-
${fieldValue}
|
|
222
|
-
</div>`;
|
|
223
|
-
|
|
224
226
|
#setTokenFields(): void {
|
|
225
227
|
if (!this.#tokenWithStatus?.parsedToken) {
|
|
226
228
|
return;
|
|
@@ -228,27 +230,29 @@ export class OriginTrialTokenRows extends HTMLElement {
|
|
|
228
230
|
this.#parsedTokenDetails = [
|
|
229
231
|
{
|
|
230
232
|
name: i18nString(UIStrings.origin),
|
|
231
|
-
value:
|
|
232
|
-
|
|
233
|
-
|
|
233
|
+
value: {
|
|
234
|
+
text: this.#tokenWithStatus.parsedToken.origin,
|
|
235
|
+
hasError: this.#tokenWithStatus.status === Protocol.Page.OriginTrialTokenStatus.WrongOrigin,
|
|
236
|
+
},
|
|
234
237
|
},
|
|
235
238
|
{
|
|
236
239
|
name: i18nString(UIStrings.expiryTime),
|
|
237
|
-
value:
|
|
238
|
-
|
|
239
|
-
|
|
240
|
+
value: {
|
|
241
|
+
text: this.#dateFormatter.format(this.#tokenWithStatus.parsedToken.expiryTime * 1000),
|
|
242
|
+
hasError: this.#tokenWithStatus.status === Protocol.Page.OriginTrialTokenStatus.Expired
|
|
243
|
+
},
|
|
240
244
|
},
|
|
241
245
|
{
|
|
242
246
|
name: i18nString(UIStrings.usageRestriction),
|
|
243
|
-
value: this.#
|
|
247
|
+
value: {text: this.#tokenWithStatus.parsedToken.usageRestriction},
|
|
244
248
|
},
|
|
245
249
|
{
|
|
246
250
|
name: i18nString(UIStrings.isThirdParty),
|
|
247
|
-
value: this.#
|
|
251
|
+
value: {text: this.#tokenWithStatus.parsedToken.isThirdParty.toString()},
|
|
248
252
|
},
|
|
249
253
|
{
|
|
250
254
|
name: i18nString(UIStrings.matchSubDomains),
|
|
251
|
-
value: this.#
|
|
255
|
+
value: {text: this.#tokenWithStatus.parsedToken.matchSubDomains.toString()},
|
|
252
256
|
},
|
|
253
257
|
];
|
|
254
258
|
|
|
@@ -256,53 +260,27 @@ export class OriginTrialTokenRows extends HTMLElement {
|
|
|
256
260
|
this.#parsedTokenDetails = [
|
|
257
261
|
{
|
|
258
262
|
name: i18nString(UIStrings.trialName),
|
|
259
|
-
value: this.#
|
|
263
|
+
value: {text: this.#tokenWithStatus.parsedToken.trialName},
|
|
260
264
|
},
|
|
261
265
|
...this.#parsedTokenDetails,
|
|
262
266
|
];
|
|
263
267
|
}
|
|
268
|
+
this.requestUpdate();
|
|
264
269
|
}
|
|
265
270
|
|
|
266
|
-
|
|
271
|
+
override performUpdate(): void {
|
|
267
272
|
if (!this.#tokenWithStatus) {
|
|
268
273
|
return;
|
|
269
274
|
}
|
|
270
275
|
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
${createBadge({
|
|
277
|
-
badgeContent: this.#tokenWithStatus.status,
|
|
278
|
-
style: this.#tokenWithStatus.status === Protocol.Page.OriginTrialTokenStatus.Success ? 'success' : 'error',
|
|
279
|
-
})}`,
|
|
280
|
-
},
|
|
281
|
-
...this.#parsedTokenDetails,
|
|
282
|
-
];
|
|
283
|
-
|
|
284
|
-
const tokenDetailRows = tokenDetails.map((field: TokenField) => {
|
|
285
|
-
return html`
|
|
286
|
-
<div class="key">${field.name}</div>
|
|
287
|
-
<div class="value">${field.value}</div>
|
|
288
|
-
`;
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
Lit.render(
|
|
292
|
-
html`
|
|
293
|
-
<style>
|
|
294
|
-
${originTrialTokenRowsStyles}
|
|
295
|
-
</style>
|
|
296
|
-
<div class="content">
|
|
297
|
-
${tokenDetailRows}
|
|
298
|
-
</div>
|
|
299
|
-
`,
|
|
300
|
-
this.#shadow, {host: this});
|
|
276
|
+
const viewInput: RowsViewInput = {
|
|
277
|
+
tokenWithStatus: this.#tokenWithStatus,
|
|
278
|
+
parsedTokenDetails: this.#parsedTokenDetails,
|
|
279
|
+
};
|
|
280
|
+
this.#view(viewInput, undefined, this.contentElement);
|
|
301
281
|
}
|
|
302
282
|
}
|
|
303
283
|
|
|
304
|
-
customElements.define('devtools-resources-origin-trial-token-rows', OriginTrialTokenRows);
|
|
305
|
-
|
|
306
284
|
export interface OriginTrialTreeViewData {
|
|
307
285
|
trials: Protocol.Page.OriginTrial[];
|
|
308
286
|
}
|
|
@@ -312,8 +290,7 @@ type View = (input: OriginTrialTreeViewData, output: undefined, target: HTMLElem
|
|
|
312
290
|
const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
313
291
|
if (!input.trials.length) {
|
|
314
292
|
// clang-format off
|
|
315
|
-
|
|
316
|
-
<style>${originTrialTreeViewStyles}</style>
|
|
293
|
+
render(html`
|
|
317
294
|
<span class="status-badge">
|
|
318
295
|
<devtools-icon class="medium" name="clear"></devtools-icon>
|
|
319
296
|
<span>${i18nString(UIStrings.noTrialTokens)}</span>
|
|
@@ -323,15 +300,15 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
323
300
|
}
|
|
324
301
|
|
|
325
302
|
// clang-format off
|
|
326
|
-
|
|
327
|
-
<style>
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
</devtools-tree
|
|
303
|
+
render(html`
|
|
304
|
+
<style>${originTrialTreeViewStyles}</style>
|
|
305
|
+
<devtools-tree .template=${html`
|
|
306
|
+
<style>${originTrialTreeViewStyles}</style>
|
|
307
|
+
<ul role="tree">
|
|
308
|
+
${input.trials.map(renderOriginTrialTree)}
|
|
309
|
+
</ul>
|
|
310
|
+
`}>
|
|
311
|
+
</devtools-tree>
|
|
335
312
|
`, target);
|
|
336
313
|
// clang-format on
|
|
337
314
|
};
|
|
@@ -354,9 +331,3 @@ export class OriginTrialTreeView extends UI.Widget.Widget {
|
|
|
354
331
|
this.#view(this.#data, undefined, this.contentElement);
|
|
355
332
|
}
|
|
356
333
|
}
|
|
357
|
-
|
|
358
|
-
declare global {
|
|
359
|
-
interface HTMLElementTagNameMap {
|
|
360
|
-
'devtools-resources-origin-trial-token-rows': OriginTrialTokenRows;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
@@ -4,12 +4,42 @@
|
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
:host {
|
|
8
|
+
.status-badge {
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
padding: 4px;
|
|
11
|
+
background: var(--sys-color-neutral-container);
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
& > devtools-icon {
|
|
14
|
+
vertical-align: sub;
|
|
15
|
+
}
|
|
14
16
|
}
|
|
15
|
-
|
|
17
|
+
|
|
18
|
+
.badge-error {
|
|
19
|
+
--override-adorner-text-color: var(--sys-color-error-bright);
|
|
20
|
+
--override-adorner-border-color: var(--sys-color-error-bright);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.badge-success {
|
|
24
|
+
--override-adorner-text-color: var(--sys-color-tertiary);
|
|
25
|
+
--override-adorner-border-color: var(--sys-color-tertiary);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.badge-secondary {
|
|
29
|
+
--override-adorner-text-color: var(--sys-color-token-subtle);
|
|
30
|
+
--override-adorner-border-color: var(--sys-color-token-subtle);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Use mono-space source code font to assist reading of adorner content */
|
|
34
|
+
devtools-adorner {
|
|
35
|
+
font-family: var(--source-code-font-family);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.token-status-badge {
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[aria-expanded='false'] .token-status-badge {
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -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)'})}>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import type * as Common from '../../../../core/common/common.js';
|
|
6
6
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
7
|
-
import
|
|
7
|
+
import * as Platform from '../../../../core/platform/platform.js';
|
|
8
8
|
import {assertNotNullOrUndefined} from '../../../../core/platform/platform.js';
|
|
9
9
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
10
10
|
import * as Protocol from '../../../../generated/protocol.js';
|
|
@@ -741,6 +741,35 @@ 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_SUPPORTED:
|
|
747
|
+
return 0;
|
|
748
|
+
case SDK.PreloadingModel.PreloadingStatus.PENDING:
|
|
749
|
+
return 1;
|
|
750
|
+
case SDK.PreloadingModel.PreloadingStatus.RUNNING:
|
|
751
|
+
return 2;
|
|
752
|
+
case SDK.PreloadingModel.PreloadingStatus.READY:
|
|
753
|
+
return 3;
|
|
754
|
+
case SDK.PreloadingModel.PreloadingStatus.SUCCESS:
|
|
755
|
+
return 4;
|
|
756
|
+
case SDK.PreloadingModel.PreloadingStatus.FAILURE: {
|
|
757
|
+
switch (attempt.action) {
|
|
758
|
+
case Protocol.Preload.SpeculationAction.Prefetch:
|
|
759
|
+
return 5;
|
|
760
|
+
case Protocol.Preload.SpeculationAction.Prerender:
|
|
761
|
+
return 6;
|
|
762
|
+
case Protocol.Preload.SpeculationAction.PrerenderUntilScript:
|
|
763
|
+
return 7;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
case SDK.PreloadingModel.PreloadingStatus.NOT_TRIGGERED:
|
|
767
|
+
return 8;
|
|
768
|
+
default:
|
|
769
|
+
Platform.assertNever(attempt.status, 'Unknown Preloading attempt status');
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
|
|
744
773
|
export function status(status: SDK.PreloadingModel.PreloadingStatus): string {
|
|
745
774
|
// See content/public/browser/preloading.h PreloadingAttemptOutcome.
|
|
746
775
|
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
|
/**
|