chrome-devtools-frontend 1.0.1006768 → 1.0.1007307
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/config/gni/devtools_grd_files.gni +2 -0
- package/config/gni/devtools_image_files.gni +2 -0
- package/front_end/Images/src/ic_sources_authored.svg +5 -0
- package/front_end/Images/src/ic_sources_deployed.svg +5 -0
- package/front_end/core/i18n/locales/en-US.json +25 -1
- package/front_end/core/i18n/locales/en-XL.json +25 -1
- package/front_end/core/sdk/DebuggerModel.ts +12 -3
- package/front_end/core/sdk/NetworkManager.ts +6 -2
- package/front_end/devtools_compatibility.js +1 -0
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +1 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +12 -10
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +4 -0
- package/front_end/models/formatter/FormatterWorkerPool.ts +6 -0
- package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +13 -20
- package/front_end/models/javascript_metadata/NativeFunctions.js +1237 -3962
- package/front_end/models/source_map_scopes/NamesResolver.ts +206 -73
- package/front_end/models/workspace/UISourceCode.ts +7 -0
- package/front_end/panels/application/components/BackForwardCacheView.ts +16 -0
- package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -5
- package/front_end/panels/lighthouse/LighthouseStartViewFR.ts +70 -49
- package/front_end/panels/network/components/RequestHeadersView.css +31 -3
- package/front_end/panels/network/components/RequestHeadersView.ts +126 -3
- package/front_end/panels/sources/NavigatorView.ts +141 -40
- package/front_end/panels/sources/SourcesPanel.ts +8 -0
- package/front_end/panels/sources/TabbedEditorContainer.ts +2 -2
- package/front_end/panels/sources/sources-meta.ts +6 -0
- package/front_end/ui/components/text_editor/javascript.ts +12 -14
- package/front_end/ui/legacy/Treeoutline.ts +5 -2
- package/package.json +1 -1
- package/scripts/hosted_mode/server.js +14 -1
- package/scripts/javascript_natives/helpers.js +26 -7
- package/scripts/javascript_natives/index.js +4 -3
- package/scripts/javascript_natives/tests.js +2 -2
@@ -23,10 +23,33 @@
|
|
23
23
|
background-color: var(--legacy-focus-bg-color);
|
24
24
|
}
|
25
25
|
|
26
|
+
details[open] .header-count {
|
27
|
+
display: none;
|
28
|
+
}
|
29
|
+
|
30
|
+
details summary label {
|
31
|
+
display: none;
|
32
|
+
}
|
33
|
+
|
34
|
+
details[open] summary label {
|
35
|
+
display: inline-flex;
|
36
|
+
gap: 2px;
|
37
|
+
}
|
38
|
+
|
39
|
+
.raw-checkbox-container {
|
40
|
+
float: right;
|
41
|
+
}
|
42
|
+
|
43
|
+
details summary input {
|
44
|
+
vertical-align: middle;
|
45
|
+
}
|
46
|
+
|
26
47
|
.row {
|
27
48
|
display: flex;
|
28
49
|
line-height: 20px;
|
29
|
-
padding-left:
|
50
|
+
padding-left: 8px;
|
51
|
+
gap: 12px;
|
52
|
+
user-select: text;
|
30
53
|
}
|
31
54
|
|
32
55
|
.row:first-of-type {
|
@@ -39,14 +62,13 @@
|
|
39
62
|
|
40
63
|
.header-name {
|
41
64
|
color: var(--color-primary);
|
42
|
-
font-weight:
|
65
|
+
font-weight: 500;
|
43
66
|
width: 160px;
|
44
67
|
flex-shrink: 0;
|
45
68
|
}
|
46
69
|
|
47
70
|
.header-value {
|
48
71
|
word-break: break-all;
|
49
|
-
user-select: text;
|
50
72
|
}
|
51
73
|
|
52
74
|
.green-circle::before,
|
@@ -76,3 +98,9 @@
|
|
76
98
|
.status-with-comment {
|
77
99
|
color: var(--color-text-secondary);
|
78
100
|
}
|
101
|
+
|
102
|
+
.raw-headers {
|
103
|
+
font-family: var(--source-code-font-family);
|
104
|
+
font-size: var(--source-code-font-size);
|
105
|
+
white-space: pre-wrap;
|
106
|
+
}
|
@@ -44,6 +44,14 @@ const UIStrings = {
|
|
44
44
|
*/
|
45
45
|
general: 'General',
|
46
46
|
/**
|
47
|
+
*@description Label for a checkbox to switch between raw and parsed headers
|
48
|
+
*/
|
49
|
+
raw: 'Raw',
|
50
|
+
/**
|
51
|
+
*@description Text in Request Headers View of the Network panel
|
52
|
+
*/
|
53
|
+
requestHeaders: 'Request Headers',
|
54
|
+
/**
|
47
55
|
*@description The URL of a request
|
48
56
|
*/
|
49
57
|
requestUrl: 'Request URL',
|
@@ -52,6 +60,10 @@ const UIStrings = {
|
|
52
60
|
*/
|
53
61
|
requestMethod: 'Request Method',
|
54
62
|
/**
|
63
|
+
*@description A context menu item in the Network Log View Columns of the Network panel
|
64
|
+
*/
|
65
|
+
responseHeaders: 'Response Headers',
|
66
|
+
/**
|
55
67
|
*@description HTTP response code
|
56
68
|
*/
|
57
69
|
statusCode: 'Status Code',
|
@@ -103,6 +115,8 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
103
115
|
static readonly litTagName = LitHtml.literal`devtools-request-headers`;
|
104
116
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
105
117
|
#request?: Readonly<SDK.NetworkRequest.NetworkRequest>;
|
118
|
+
#showResponseHeadersText = false;
|
119
|
+
#showRequestHeadersText = false;
|
106
120
|
|
107
121
|
set data(data: RequestHeadersComponentData) {
|
108
122
|
this.#request = data.request;
|
@@ -120,10 +134,84 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
120
134
|
// clang-format off
|
121
135
|
render(html`
|
122
136
|
${this.#renderGeneralSection()}
|
137
|
+
${this.#renderResponseHeaders()}
|
138
|
+
${this.#renderRequestHeaders()}
|
123
139
|
`, this.#shadow, {host: this});
|
124
140
|
// clang-format on
|
125
141
|
}
|
126
142
|
|
143
|
+
#renderResponseHeaders(): LitHtml.TemplateResult {
|
144
|
+
assertNotNullOrUndefined(this.#request);
|
145
|
+
|
146
|
+
const toggleShowRaw = (): void => {
|
147
|
+
this.#showResponseHeadersText = !this.#showResponseHeadersText;
|
148
|
+
this.#render();
|
149
|
+
};
|
150
|
+
|
151
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
152
|
+
// clang-format off
|
153
|
+
return html`
|
154
|
+
<${Category.litTagName}
|
155
|
+
@togglerawevent=${toggleShowRaw}
|
156
|
+
.data=${{
|
157
|
+
name: 'responseHeaders',
|
158
|
+
title: i18nString(UIStrings.responseHeaders),
|
159
|
+
headerCount: this.#request.sortedResponseHeaders.length,
|
160
|
+
checked: this.#request.responseHeadersText ? this.#showResponseHeadersText : undefined,
|
161
|
+
} as CategoryData}
|
162
|
+
aria-label=${i18nString(UIStrings.responseHeaders)}
|
163
|
+
>
|
164
|
+
${this.#showResponseHeadersText ? html`
|
165
|
+
<div class="row raw-headers">${this.#request.responseHeadersText.trim()}</div>
|
166
|
+
` : html`
|
167
|
+
${this.#request.sortedResponseHeaders.map(header => html`
|
168
|
+
<div class="row">
|
169
|
+
<div class="header-name">${header.name}:</div>
|
170
|
+
<div class="header-value">${header.value}</div>
|
171
|
+
</div>
|
172
|
+
`)}
|
173
|
+
`}
|
174
|
+
</${Category.litTagName}>
|
175
|
+
`;
|
176
|
+
}
|
177
|
+
|
178
|
+
#renderRequestHeaders(): LitHtml.TemplateResult {
|
179
|
+
assertNotNullOrUndefined(this.#request);
|
180
|
+
|
181
|
+
const toggleShowRaw = (): void => {
|
182
|
+
this.#showRequestHeadersText = !this.#showRequestHeadersText;
|
183
|
+
this.#render();
|
184
|
+
};
|
185
|
+
|
186
|
+
const requestHeadersText = this.#request.requestHeadersText();
|
187
|
+
|
188
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
189
|
+
// clang-format off
|
190
|
+
return html`
|
191
|
+
<${Category.litTagName}
|
192
|
+
@togglerawevent=${toggleShowRaw}
|
193
|
+
.data=${{
|
194
|
+
name: 'requestHeaders',
|
195
|
+
title: i18nString(UIStrings.requestHeaders),
|
196
|
+
headerCount: this.#request.requestHeaders().length,
|
197
|
+
checked: requestHeadersText? this.#showRequestHeadersText : undefined,
|
198
|
+
} as CategoryData}
|
199
|
+
aria-label=${i18nString(UIStrings.requestHeaders)}
|
200
|
+
>
|
201
|
+
${(this.#showRequestHeadersText && requestHeadersText) ? html`
|
202
|
+
<div class="row raw-headers">${requestHeadersText.trim()}</div>
|
203
|
+
` : html`
|
204
|
+
${this.#request.requestHeaders().map(header => html`
|
205
|
+
<div class="row">
|
206
|
+
<div class="header-name">${header.name}:</div>
|
207
|
+
<div class="header-value">${header.value}</div>
|
208
|
+
</div>
|
209
|
+
`)}
|
210
|
+
`}
|
211
|
+
</${Category.litTagName}>
|
212
|
+
`;
|
213
|
+
}
|
214
|
+
|
127
215
|
#renderGeneralSection(): LitHtml.TemplateResult {
|
128
216
|
assertNotNullOrUndefined(this.#request);
|
129
217
|
|
@@ -159,7 +247,10 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
159
247
|
// Disabled until https://crbug.com/1079231 is fixed.
|
160
248
|
// clang-format off
|
161
249
|
return html`
|
162
|
-
<${Category.litTagName}
|
250
|
+
<${Category.litTagName}
|
251
|
+
.data=${{name: 'general', title: i18nString(UIStrings.general)} as CategoryData}
|
252
|
+
aria-label=${i18nString(UIStrings.general)}
|
253
|
+
>
|
163
254
|
<div class="row">
|
164
255
|
<div class="header-name">${i18nString(UIStrings.requestUrl)}:</div>
|
165
256
|
<div class="header-value">${this.#request.url()}</div>
|
@@ -192,9 +283,19 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
192
283
|
}
|
193
284
|
}
|
194
285
|
|
286
|
+
export class ToggleRawHeadersEvent extends Event {
|
287
|
+
static readonly eventName = 'togglerawevent';
|
288
|
+
|
289
|
+
constructor() {
|
290
|
+
super(ToggleRawHeadersEvent.eventName, {});
|
291
|
+
}
|
292
|
+
}
|
293
|
+
|
195
294
|
export interface CategoryData {
|
196
295
|
name: string;
|
197
296
|
title: Common.UIString.LocalizedString;
|
297
|
+
headerCount?: number;
|
298
|
+
checked?: boolean;
|
198
299
|
}
|
199
300
|
|
200
301
|
export class Category extends HTMLElement {
|
@@ -202,6 +303,8 @@ export class Category extends HTMLElement {
|
|
202
303
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
203
304
|
#expandedSetting?: Common.Settings.Setting<boolean>;
|
204
305
|
#title: Common.UIString.LocalizedString = Common.UIString.LocalizedEmptyString;
|
306
|
+
#headerCount?: number = undefined;
|
307
|
+
#checked: boolean|undefined = undefined;
|
205
308
|
|
206
309
|
connectedCallback(): void {
|
207
310
|
this.#shadow.adoptedStyleSheets = [requestHeadersViewStyles];
|
@@ -211,15 +314,35 @@ export class Category extends HTMLElement {
|
|
211
314
|
this.#title = data.title;
|
212
315
|
this.#expandedSetting =
|
213
316
|
Common.Settings.Settings.instance().createSetting('request-info-' + data.name + '-category-expanded', true);
|
317
|
+
this.#headerCount = data.headerCount;
|
318
|
+
this.#checked = data.checked;
|
214
319
|
this.#render();
|
215
320
|
}
|
216
321
|
|
322
|
+
#onCheckboxToggle(): void {
|
323
|
+
this.dispatchEvent(new ToggleRawHeadersEvent());
|
324
|
+
}
|
325
|
+
|
217
326
|
#render(): void {
|
327
|
+
const isOpen = this.#expandedSetting ? this.#expandedSetting.get() : true;
|
218
328
|
// Disabled until https://crbug.com/1079231 is fixed.
|
219
329
|
// clang-format off
|
220
330
|
render(html`
|
221
|
-
<details ?open=${
|
222
|
-
<summary class="header" @keydown=${this.#onSummaryKeyDown}
|
331
|
+
<details ?open=${isOpen} @toggle=${this.#onToggle}>
|
332
|
+
<summary class="header" @keydown=${this.#onSummaryKeyDown}>
|
333
|
+
${this.#title}${this.#headerCount ?
|
334
|
+
html`<span class="header-count"> (${this.#headerCount})</span>` :
|
335
|
+
LitHtml.nothing
|
336
|
+
}
|
337
|
+
${this.#checked !== undefined ? html`
|
338
|
+
<span class="raw-checkbox-container">
|
339
|
+
<label>
|
340
|
+
<input type="checkbox" .checked=${this.#checked} @change=${this.#onCheckboxToggle} />
|
341
|
+
${i18nString(UIStrings.raw)}
|
342
|
+
</label>
|
343
|
+
</span>
|
344
|
+
` : LitHtml.nothing}
|
345
|
+
</summary>
|
223
346
|
<slot></slot>
|
224
347
|
</details>
|
225
348
|
`, this.#shadow, {host: this});
|