chrome-devtools-frontend 1.0.1003496 → 1.0.1004641
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/front_end/core/common/ParsedURL.ts +7 -3
- package/front_end/core/host/UserMetrics.ts +1 -1
- package/front_end/core/i18n/locales/en-US.json +48 -3
- package/front_end/core/i18n/locales/en-XL.json +48 -3
- package/front_end/core/sdk/DebuggerModel.ts +12 -0
- package/front_end/core/sdk/NetworkManager.ts +2 -2
- package/front_end/core/sdk/ResourceTreeModel.ts +32 -6
- package/front_end/core/sdk/RuntimeModel.ts +5 -3
- package/front_end/core/sdk/WebAuthnModel.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +2 -2
- package/front_end/generated/InspectorBackendCommands.js +8 -2
- package/front_end/generated/SupportedCSSProperties.js +4 -0
- package/front_end/generated/protocol-mapping.d.ts +14 -2
- package/front_end/generated/protocol-proxy-api.d.ts +14 -2
- package/front_end/generated/protocol.ts +23 -1
- package/front_end/models/extensions/ExtensionPanel.ts +1 -1
- package/front_end/models/extensions/ExtensionServer.ts +12 -14
- package/front_end/models/har/Log.ts +4 -3
- package/front_end/panels/application/components/FrameDetailsView.ts +28 -0
- package/front_end/panels/console/ErrorStackParser.ts +2 -5
- package/front_end/panels/issues/AffectedDirectivesView.ts +4 -3
- package/front_end/panels/lighthouse/LighthouseController.ts +6 -6
- package/front_end/panels/lighthouse/LighthousePanel.ts +1 -3
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +2 -1
- package/front_end/panels/network/NetworkItemView.ts +10 -1
- package/front_end/panels/network/NetworkLogView.ts +7 -4
- package/front_end/panels/network/RequestHeadersView.ts +1 -1
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +2 -2
- package/front_end/panels/network/components/RequestHeadersView.css +78 -0
- package/front_end/panels/network/components/RequestHeadersView.ts +262 -0
- package/front_end/panels/network/components/components.ts +2 -0
- package/front_end/panels/network/forward/UIRequestLocation.ts +1 -0
- package/front_end/panels/network/networkLogView.css +3 -3
- package/front_end/panels/network/requestHeadersTree.css +6 -0
- package/front_end/panels/profiler/HeapSnapshotView.ts +11 -13
- package/front_end/panels/profiler/LiveHeapProfileView.ts +0 -1
- package/front_end/panels/screencast/ScreencastView.ts +0 -1
- package/front_end/panels/settings/SettingsScreen.ts +0 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +13 -0
- package/front_end/panels/sources/NavigatorView.ts +0 -2
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +4 -3
- package/front_end/panels/sources/SourcesSearchScope.ts +0 -2
- package/front_end/panels/sources/sourcesView.css +4 -0
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +16 -2
- package/front_end/ui/legacy/components/data_grid/ViewportDataGrid.ts +2 -2
- package/package.json +1 -1
@@ -0,0 +1,262 @@
|
|
1
|
+
// Copyright 2022 The Chromium Authors. All rights reserved.
|
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 Common from '../../../core/common/common.js';
|
6
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
7
|
+
import {assertNotNullOrUndefined} from '../../../core/platform/platform.js';
|
8
|
+
import * as SDK from '../../../core/sdk/sdk.js';
|
9
|
+
import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
|
10
|
+
import * as UI from '../../../ui/legacy/legacy.js';
|
11
|
+
import * as LitHtml from '../../../ui/lit-html/lit-html.js';
|
12
|
+
|
13
|
+
import requestHeadersViewStyles from './RequestHeadersView.css.js';
|
14
|
+
|
15
|
+
const {render, html} = LitHtml;
|
16
|
+
|
17
|
+
const UIStrings = {
|
18
|
+
/**
|
19
|
+
*@description Text in Request Headers View of the Network panel
|
20
|
+
*/
|
21
|
+
fromMemoryCache: '(from memory cache)',
|
22
|
+
/**
|
23
|
+
*@description Text in Request Headers View of the Network panel
|
24
|
+
*/
|
25
|
+
fromServiceWorker: '(from `service worker`)',
|
26
|
+
/**
|
27
|
+
*@description Text in Request Headers View of the Network panel
|
28
|
+
*/
|
29
|
+
fromSignedexchange: '(from signed-exchange)',
|
30
|
+
/**
|
31
|
+
*@description Text in Request Headers View of the Network panel
|
32
|
+
*/
|
33
|
+
fromPrefetchCache: '(from prefetch cache)',
|
34
|
+
/**
|
35
|
+
*@description Text in Request Headers View of the Network panel
|
36
|
+
*/
|
37
|
+
fromDiskCache: '(from disk cache)',
|
38
|
+
/**
|
39
|
+
*@description Text in Request Headers View of the Network panel
|
40
|
+
*/
|
41
|
+
fromWebBundle: '(from Web Bundle)',
|
42
|
+
/**
|
43
|
+
*@description Section header for a list of the main aspects of a http request
|
44
|
+
*/
|
45
|
+
general: 'General',
|
46
|
+
/**
|
47
|
+
*@description The URL of a request
|
48
|
+
*/
|
49
|
+
requestUrl: 'Request URL',
|
50
|
+
/**
|
51
|
+
*@description The HTTP method of a request
|
52
|
+
*/
|
53
|
+
requestMethod: 'Request Method',
|
54
|
+
/**
|
55
|
+
*@description HTTP response code
|
56
|
+
*/
|
57
|
+
statusCode: 'Status Code',
|
58
|
+
/**
|
59
|
+
*@description Text in Network Log View Columns of the Network panel
|
60
|
+
*/
|
61
|
+
remoteAddress: 'Remote Address',
|
62
|
+
/**
|
63
|
+
*@description Text in Request Headers View of the Network panel
|
64
|
+
*/
|
65
|
+
referrerPolicy: 'Referrer Policy',
|
66
|
+
};
|
67
|
+
const str_ = i18n.i18n.registerUIStrings('panels/network/components/RequestHeadersView.ts', UIStrings);
|
68
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
69
|
+
|
70
|
+
export class RequestHeadersView extends UI.Widget.VBox {
|
71
|
+
readonly #headersView = new RequestHeadersComponent();
|
72
|
+
readonly #request: SDK.NetworkRequest.NetworkRequest;
|
73
|
+
|
74
|
+
constructor(request: SDK.NetworkRequest.NetworkRequest) {
|
75
|
+
super();
|
76
|
+
this.#request = request;
|
77
|
+
this.contentElement.appendChild(this.#headersView);
|
78
|
+
}
|
79
|
+
|
80
|
+
wasShown(): void {
|
81
|
+
this.#request.addEventListener(SDK.NetworkRequest.Events.RemoteAddressChanged, this.#refreshHeadersView, this);
|
82
|
+
this.#request.addEventListener(SDK.NetworkRequest.Events.FinishedLoading, this.#refreshHeadersView, this);
|
83
|
+
this.#refreshHeadersView();
|
84
|
+
}
|
85
|
+
|
86
|
+
willHide(): void {
|
87
|
+
this.#request.removeEventListener(SDK.NetworkRequest.Events.RemoteAddressChanged, this.#refreshHeadersView, this);
|
88
|
+
this.#request.removeEventListener(SDK.NetworkRequest.Events.FinishedLoading, this.#refreshHeadersView, this);
|
89
|
+
}
|
90
|
+
|
91
|
+
#refreshHeadersView(): void {
|
92
|
+
this.#headersView.data = {
|
93
|
+
request: this.#request,
|
94
|
+
};
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
export interface RequestHeadersComponentData {
|
99
|
+
request: SDK.NetworkRequest.NetworkRequest;
|
100
|
+
}
|
101
|
+
|
102
|
+
export class RequestHeadersComponent extends HTMLElement {
|
103
|
+
static readonly litTagName = LitHtml.literal`devtools-request-headers`;
|
104
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
105
|
+
#request?: Readonly<SDK.NetworkRequest.NetworkRequest>;
|
106
|
+
|
107
|
+
set data(data: RequestHeadersComponentData) {
|
108
|
+
this.#request = data.request;
|
109
|
+
this.#render();
|
110
|
+
}
|
111
|
+
|
112
|
+
connectedCallback(): void {
|
113
|
+
this.#shadow.adoptedStyleSheets = [requestHeadersViewStyles];
|
114
|
+
}
|
115
|
+
|
116
|
+
#render(): void {
|
117
|
+
assertNotNullOrUndefined(this.#request);
|
118
|
+
|
119
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
120
|
+
// clang-format off
|
121
|
+
render(html`
|
122
|
+
${this.#renderGeneralSection()}
|
123
|
+
`, this.#shadow, {host: this});
|
124
|
+
// clang-format on
|
125
|
+
}
|
126
|
+
|
127
|
+
#renderGeneralSection(): LitHtml.TemplateResult {
|
128
|
+
assertNotNullOrUndefined(this.#request);
|
129
|
+
|
130
|
+
let coloredCircleClassName = 'red-circle';
|
131
|
+
if (this.#request.statusCode < 300 || this.#request.statusCode === 304) {
|
132
|
+
coloredCircleClassName = 'green-circle';
|
133
|
+
} else if (this.#request.statusCode < 400) {
|
134
|
+
coloredCircleClassName = 'yellow-circle';
|
135
|
+
}
|
136
|
+
|
137
|
+
let statusText = this.#request.statusCode + ' ' + this.#request.statusText;
|
138
|
+
let statusTextHasComment = false;
|
139
|
+
if (this.#request.cachedInMemory()) {
|
140
|
+
statusText += ' ' + i18nString(UIStrings.fromMemoryCache);
|
141
|
+
statusTextHasComment = true;
|
142
|
+
} else if (this.#request.fetchedViaServiceWorker) {
|
143
|
+
statusText += ' ' + i18nString(UIStrings.fromServiceWorker);
|
144
|
+
statusTextHasComment = true;
|
145
|
+
} else if (this.#request.redirectSourceSignedExchangeInfoHasNoErrors()) {
|
146
|
+
statusText += ' ' + i18nString(UIStrings.fromSignedexchange);
|
147
|
+
statusTextHasComment = true;
|
148
|
+
} else if (this.#request.webBundleInnerRequestInfo()) {
|
149
|
+
statusText += ' ' + i18nString(UIStrings.fromWebBundle);
|
150
|
+
statusTextHasComment = true;
|
151
|
+
} else if (this.#request.fromPrefetchCache()) {
|
152
|
+
statusText += ' ' + i18nString(UIStrings.fromPrefetchCache);
|
153
|
+
statusTextHasComment = true;
|
154
|
+
} else if (this.#request.cached()) {
|
155
|
+
statusText += ' ' + i18nString(UIStrings.fromDiskCache);
|
156
|
+
statusTextHasComment = true;
|
157
|
+
}
|
158
|
+
|
159
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
160
|
+
// clang-format off
|
161
|
+
return html`
|
162
|
+
<${Category.litTagName} .data=${{name: 'general', title: i18nString(UIStrings.general)} as CategoryData}>
|
163
|
+
<div class="row">
|
164
|
+
<div class="header-name">${i18nString(UIStrings.requestUrl)}:</div>
|
165
|
+
<div class="header-value">${this.#request.url()}</div>
|
166
|
+
</div>
|
167
|
+
${this.#request.statusCode? html`
|
168
|
+
<div class="row">
|
169
|
+
<div class="header-name">${i18nString(UIStrings.requestMethod)}:</div>
|
170
|
+
<div class="header-value">${this.#request.requestMethod}</div>
|
171
|
+
</div>
|
172
|
+
<div class="row">
|
173
|
+
<div class="header-name">${i18nString(UIStrings.statusCode)}:</div>
|
174
|
+
<div class="header-value ${coloredCircleClassName} ${statusTextHasComment ? 'status-with-comment' : ''}">${statusText}</div>
|
175
|
+
</div>
|
176
|
+
` : ''}
|
177
|
+
${this.#request.remoteAddress()? html`
|
178
|
+
<div class="row">
|
179
|
+
<div class="header-name">${i18nString(UIStrings.remoteAddress)}:</div>
|
180
|
+
<div class="header-value">${this.#request.remoteAddress()}</div>
|
181
|
+
</div>
|
182
|
+
` : ''}
|
183
|
+
${this.#request.referrerPolicy()? html`
|
184
|
+
<div class="row">
|
185
|
+
<div class="header-name">${i18nString(UIStrings.referrerPolicy)}:</div>
|
186
|
+
<div class="header-value">${this.#request.referrerPolicy()}</div>
|
187
|
+
</div>
|
188
|
+
` : ''}
|
189
|
+
</${Category.litTagName}>
|
190
|
+
`;
|
191
|
+
// clang-format on
|
192
|
+
}
|
193
|
+
}
|
194
|
+
|
195
|
+
export interface CategoryData {
|
196
|
+
name: string;
|
197
|
+
title: Common.UIString.LocalizedString;
|
198
|
+
}
|
199
|
+
|
200
|
+
export class Category extends HTMLElement {
|
201
|
+
static readonly litTagName = LitHtml.literal`devtools-request-headers-category`;
|
202
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
203
|
+
#expandedSetting?: Common.Settings.Setting<boolean>;
|
204
|
+
#title: Common.UIString.LocalizedString = Common.UIString.LocalizedEmptyString;
|
205
|
+
|
206
|
+
connectedCallback(): void {
|
207
|
+
this.#shadow.adoptedStyleSheets = [requestHeadersViewStyles];
|
208
|
+
}
|
209
|
+
|
210
|
+
set data(data: CategoryData) {
|
211
|
+
this.#title = data.title;
|
212
|
+
this.#expandedSetting =
|
213
|
+
Common.Settings.Settings.instance().createSetting('request-info-' + data.name + '-category-expanded', true);
|
214
|
+
this.#render();
|
215
|
+
}
|
216
|
+
|
217
|
+
#render(): void {
|
218
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
219
|
+
// clang-format off
|
220
|
+
render(html`
|
221
|
+
<details ?open=${this.#expandedSetting ? this.#expandedSetting.get() : true} @toggle=${this.#onToggle}>
|
222
|
+
<summary class="header" @keydown=${this.#onSummaryKeyDown}>${this.#title}</summary>
|
223
|
+
<slot></slot>
|
224
|
+
</details>
|
225
|
+
`, this.#shadow, {host: this});
|
226
|
+
// clang-format on
|
227
|
+
}
|
228
|
+
|
229
|
+
#onSummaryKeyDown(event: KeyboardEvent): void {
|
230
|
+
if (!event.target) {
|
231
|
+
return;
|
232
|
+
}
|
233
|
+
const summaryElement = event.target as HTMLElement;
|
234
|
+
const detailsElement = summaryElement.parentElement as HTMLDetailsElement;
|
235
|
+
if (!detailsElement) {
|
236
|
+
throw new Error('<details> element is not found for a <summary> element');
|
237
|
+
}
|
238
|
+
switch (event.key) {
|
239
|
+
case 'ArrowLeft':
|
240
|
+
detailsElement.open = false;
|
241
|
+
break;
|
242
|
+
case 'ArrowRight':
|
243
|
+
detailsElement.open = true;
|
244
|
+
break;
|
245
|
+
}
|
246
|
+
}
|
247
|
+
|
248
|
+
#onToggle(event: Event): void {
|
249
|
+
this.#expandedSetting?.set((event.target as HTMLDetailsElement).open);
|
250
|
+
}
|
251
|
+
}
|
252
|
+
|
253
|
+
ComponentHelpers.CustomElements.defineComponent('devtools-request-headers', RequestHeadersComponent);
|
254
|
+
ComponentHelpers.CustomElements.defineComponent('devtools-request-headers-category', Category);
|
255
|
+
|
256
|
+
declare global {
|
257
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
258
|
+
interface HTMLElementTagNameMap {
|
259
|
+
'devtools-request-headers': RequestHeadersComponent;
|
260
|
+
'devtools-request-headers-category': Category;
|
261
|
+
}
|
262
|
+
}
|
@@ -2,8 +2,10 @@
|
|
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
4
|
|
5
|
+
import * as RequestHeadersView from './RequestHeadersView.js';
|
5
6
|
import * as RequestTrustTokensView from './RequestTrustTokensView.js';
|
6
7
|
|
7
8
|
export {
|
9
|
+
RequestHeadersView,
|
8
10
|
RequestTrustTokensView,
|
9
11
|
};
|
@@ -70,7 +70,7 @@
|
|
70
70
|
flex: none;
|
71
71
|
}
|
72
72
|
|
73
|
-
.network-log-grid.data-grid
|
73
|
+
.network-log-grid.data-grid tbody {
|
74
74
|
background: transparent;
|
75
75
|
}
|
76
76
|
|
@@ -397,8 +397,8 @@
|
|
397
397
|
/* This is part of the large color block declared above, but should not be
|
398
398
|
extracted out. */
|
399
399
|
/* stylelint-disable no-descending-specificity */
|
400
|
-
.network-log-grid.data-grid
|
401
|
-
.network-log-grid.data-grid:focus
|
400
|
+
.network-log-grid.data-grid tbody tr.revealed.selected,
|
401
|
+
.network-log-grid.data-grid:focus tbody tr.revealed.selected,
|
402
402
|
.network-log-grid.data-grid:focus tr.selected .network-dim-cell,
|
403
403
|
.network-log-grid.data-grid tr.selected .network-dim-cell,
|
404
404
|
.network-log-grid.data-grid:focus tr.selected .initiator-column .devtools-link,
|
@@ -183,8 +183,7 @@ const UIStrings = {
|
|
183
183
|
/**
|
184
184
|
*@description Text in Heap Snapshot View of a profiler tool
|
185
185
|
*/
|
186
|
-
|
187
|
-
'Treat global objects as roots (recommended, unchecking this exposes internal nodes and introduces excessive detail, but might help debugging cycles in retaining paths)',
|
186
|
+
exposeInternals: 'Expose internals (includes additional implementation-specific details)',
|
188
187
|
/**
|
189
188
|
*@description Text in Heap Snapshot View of a profiler tool
|
190
189
|
* This option turns on inclusion of numerical values in the heap snapshot.
|
@@ -1182,7 +1181,7 @@ export class StatisticsPerspective extends Perspective {
|
|
1182
1181
|
export class HeapSnapshotProfileType extends
|
1183
1182
|
Common.ObjectWrapper.eventMixin<HeapSnapshotProfileTypeEventTypes, typeof ProfileType>(ProfileType)
|
1184
1183
|
implements SDK.TargetManager.SDKModelObserver<SDK.HeapProfilerModel.HeapProfilerModel> {
|
1185
|
-
readonly
|
1184
|
+
readonly exposeInternals: Common.Settings.Setting<boolean>;
|
1186
1185
|
readonly captureNumericValue: Common.Settings.Setting<boolean>;
|
1187
1186
|
customContentInternal: HTMLElement|null;
|
1188
1187
|
constructor(id?: string, title?: string) {
|
@@ -1196,8 +1195,7 @@ export class HeapSnapshotProfileType extends
|
|
1196
1195
|
SDK.TargetManager.TargetManager.instance().addModelListener(
|
1197
1196
|
SDK.HeapProfilerModel.HeapProfilerModel, SDK.HeapProfilerModel.Events.ReportHeapSnapshotProgress,
|
1198
1197
|
this.reportHeapSnapshotProgress, this);
|
1199
|
-
this.
|
1200
|
-
Common.Settings.Settings.instance().createSetting('treatGlobalObjectsAsRoots', true);
|
1198
|
+
this.exposeInternals = Common.Settings.Settings.instance().createSetting('exposeInternals', false);
|
1201
1199
|
this.captureNumericValue = Common.Settings.Settings.instance().createSetting('captureNumericValue', false);
|
1202
1200
|
this.customContentInternal = null;
|
1203
1201
|
}
|
@@ -1241,13 +1239,13 @@ export class HeapSnapshotProfileType extends
|
|
1241
1239
|
|
1242
1240
|
customContent(): Element|null {
|
1243
1241
|
const optionsContainer = document.createElement('div');
|
1244
|
-
const
|
1245
|
-
Root.Runtime.experiments.isEnabled('
|
1246
|
-
const omitParagraphElement = !
|
1247
|
-
if (
|
1248
|
-
const
|
1249
|
-
i18nString(UIStrings.
|
1250
|
-
optionsContainer.appendChild(
|
1242
|
+
const showOptionToExposeInternalsInHeapSnapshot =
|
1243
|
+
Root.Runtime.experiments.isEnabled('showOptionToExposeInternalsInHeapSnapshot');
|
1244
|
+
const omitParagraphElement = !showOptionToExposeInternalsInHeapSnapshot;
|
1245
|
+
if (showOptionToExposeInternalsInHeapSnapshot) {
|
1246
|
+
const exposeInternalsInHeapSnapshotCheckbox = UI.SettingsUI.createSettingCheckbox(
|
1247
|
+
i18nString(UIStrings.exposeInternals), this.exposeInternals, omitParagraphElement);
|
1248
|
+
optionsContainer.appendChild(exposeInternalsInHeapSnapshotCheckbox);
|
1251
1249
|
}
|
1252
1250
|
const captureNumericValueCheckbox = UI.SettingsUI.createSettingCheckbox(
|
1253
1251
|
UIStrings.captureNumericValue, this.captureNumericValue, omitParagraphElement);
|
@@ -1284,8 +1282,8 @@ export class HeapSnapshotProfileType extends
|
|
1284
1282
|
|
1285
1283
|
await heapProfilerModel.takeHeapSnapshot({
|
1286
1284
|
reportProgress: true,
|
1287
|
-
treatGlobalObjectsAsRoots: this.treatGlobalObjectsAsRoots.get(),
|
1288
1285
|
captureNumericValue: this.captureNumericValue.get(),
|
1286
|
+
exposeInternals: this.exposeInternals.get(),
|
1289
1287
|
});
|
1290
1288
|
profile = this.profileBeingRecorded() as HeapProfileHeader;
|
1291
1289
|
if (!profile) {
|
@@ -292,7 +292,6 @@ export class LiveHeapProfileView extends UI.Widget.VBox {
|
|
292
292
|
if (!node || !node.url) {
|
293
293
|
return;
|
294
294
|
}
|
295
|
-
// TODO(crbug.com/1253323): Cast to UrlString will be removed when migration to branded types is complete.
|
296
295
|
const sourceCode =
|
297
296
|
Workspace.Workspace.WorkspaceImpl.instance().uiSourceCodeForURL(node.url as Platform.DevToolsPath.UrlString);
|
298
297
|
if (sourceCode) {
|
@@ -744,7 +744,6 @@ export class ScreencastView extends UI.Widget.VBox implements SDK.OverlayModel.H
|
|
744
744
|
if (match) {
|
745
745
|
url = match[1];
|
746
746
|
}
|
747
|
-
// TODO(crbug.com/1253323): Cast to UrlString will be removed when migration to branded types is complete.
|
748
747
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.inspectedURLChanged(
|
749
748
|
url as Platform.DevToolsPath.UrlString);
|
750
749
|
this.navigationUrl.value = decodeURI(url);
|
@@ -509,7 +509,6 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
509
509
|
case 'settings.show':
|
510
510
|
void SettingsScreen.showSettingsScreen({focusTabHeader: true} as ShowSettingsScreenOptions);
|
511
511
|
return true;
|
512
|
-
// TODO(crbug.com/1253323): Cast to UrlString will be removed when migration to branded types is complete.
|
513
512
|
case 'settings.documentation':
|
514
513
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(UI.UIUtils.addReferrerToURL(
|
515
514
|
'https://developer.chrome.com/docs/devtools/' as Platform.DevToolsPath.UrlString));
|
@@ -86,6 +86,12 @@ const UIStrings = {
|
|
86
86
|
*@description Text in Call Stack Sidebar Pane of the Sources panel when some call frames have warnings
|
87
87
|
*/
|
88
88
|
callFrameWarnings: 'Some call frames have warnings',
|
89
|
+
/**
|
90
|
+
* @description A contex menu item in the Call Stack Sidebar Pane. "Restart" is a verb and
|
91
|
+
* "frame" is a noun. "Frame" refers to an individual item in the call stack, i.e. a call frame.
|
92
|
+
* The user opens this context menu by selecting a specific call frame in the call stack sidebar pane.
|
93
|
+
*/
|
94
|
+
restartFrame: 'Restart frame',
|
89
95
|
};
|
90
96
|
const str_ = i18n.i18n.registerUIStrings('panels/sources/CallStackSidebarPane.ts', UIStrings);
|
91
97
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
@@ -384,6 +390,13 @@ export class CallStackSidebarPane extends UI.View.SimpleView implements UI.Conte
|
|
384
390
|
return;
|
385
391
|
}
|
386
392
|
const contextMenu = new UI.ContextMenu.ContextMenu(event);
|
393
|
+
const debuggerCallFrame = itemToCallFrame.get(item);
|
394
|
+
if (debuggerCallFrame) {
|
395
|
+
contextMenu.defaultSection().appendItem(i18nString(UIStrings.restartFrame), () => {
|
396
|
+
Host.userMetrics.actionTaken(Host.UserMetrics.Action.StackFrameRestarted);
|
397
|
+
void debuggerCallFrame.restart();
|
398
|
+
}, !debuggerCallFrame.canBeRestarted);
|
399
|
+
}
|
387
400
|
contextMenu.defaultSection().appendItem(i18nString(UIStrings.copyStackTrace), this.copyStackTrace.bind(this));
|
388
401
|
if (item.uiLocation) {
|
389
402
|
this.appendIgnoreListURLContextMenuItems(contextMenu, item.uiLocation.uiSourceCode);
|
@@ -28,8 +28,6 @@
|
|
28
28
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
29
|
*/
|
30
30
|
|
31
|
-
// TODO(crbug.com/1253323): Casts to Branded Types will be removed from this file when migration to branded types is complete.
|
32
|
-
|
33
31
|
import * as Common from '../../core/common/common.js';
|
34
32
|
import * as Host from '../../core/host/host.js';
|
35
33
|
import * as i18n from '../../core/i18n/i18n.js';
|
@@ -311,13 +311,14 @@ export class OpenLinearMemoryInspector extends UI.Widget.VBox implements UI.Cont
|
|
311
311
|
}
|
312
312
|
|
313
313
|
private isMemoryObjectProperty(obj: SDK.RemoteObject.RemoteObject): boolean {
|
314
|
-
const
|
314
|
+
const isWasmOrBuffer = obj.type === 'object' && obj.subtype &&
|
315
315
|
LinearMemoryInspector.LinearMemoryInspectorController.ACCEPTED_MEMORY_TYPES.includes(obj.subtype);
|
316
|
-
if (
|
316
|
+
if (isWasmOrBuffer) {
|
317
317
|
return true;
|
318
318
|
}
|
319
319
|
|
320
|
-
|
320
|
+
const isWasmDWARF = obj instanceof Bindings.DebuggerLanguagePlugins.ValueNode;
|
321
|
+
if (isWasmDWARF) {
|
321
322
|
return obj.inspectableAddress !== undefined;
|
322
323
|
}
|
323
324
|
|
@@ -28,8 +28,6 @@
|
|
28
28
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
29
|
*/
|
30
30
|
|
31
|
-
// TODO(crbug.com/1253323): Casts to Branded Types will be removed from this file when migration to branded types is complete.
|
32
|
-
|
33
31
|
import * as Common from '../../core/common/common.js';
|
34
32
|
import * as Platform from '../../core/platform/platform.js';
|
35
33
|
import * as Bindings from '../../models/bindings/bindings.js';
|
@@ -130,6 +130,7 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
130
130
|
[x: string]: Element,
|
131
131
|
};
|
132
132
|
scrollContainerInternal: Element;
|
133
|
+
private dataContainerInternal: Element;
|
133
134
|
private readonly dataTable: Element;
|
134
135
|
protected inline: boolean;
|
135
136
|
private columnsArray: ColumnDescriptor[];
|
@@ -190,8 +191,9 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
190
191
|
|
191
192
|
this.dataTableHeaders = {};
|
192
193
|
|
193
|
-
this.
|
194
|
-
this.dataTable = this.
|
194
|
+
this.dataContainerInternal = this.element.createChild('div', 'data-container');
|
195
|
+
this.dataTable = this.dataContainerInternal.createChild('table', 'data');
|
196
|
+
this.scrollContainerInternal = this.dataContainerInternal;
|
195
197
|
|
196
198
|
// FIXME: Add a createCallback which is different from editCallback and has different
|
197
199
|
// behavior when creating a new node.
|
@@ -1539,6 +1541,18 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
1539
1541
|
return this.topFillerRow;
|
1540
1542
|
}
|
1541
1543
|
|
1544
|
+
// Note on the following methods:
|
1545
|
+
// The header row is a child of the scrollable container, and uses position: sticky
|
1546
|
+
// so it can visually obscure other elements below it in the grid. We need to manually
|
1547
|
+
// subtract the header's height when calculating the actual client area in which
|
1548
|
+
// data rows are visible. However, if a caller has set a different scroll container
|
1549
|
+
// then we report 0 height and the caller is expected to ensure their chosen scroll
|
1550
|
+
// container's height matches the visible scrollable data area as seen by the user.
|
1551
|
+
|
1552
|
+
protected headerHeightInScroller(): number {
|
1553
|
+
return this.scrollContainer === this.dataContainerInternal ? this.headerHeight() : 0;
|
1554
|
+
}
|
1555
|
+
|
1542
1556
|
protected headerHeight(): number {
|
1543
1557
|
return this.dataTableHeadInternal.offsetHeight;
|
1544
1558
|
}
|
@@ -172,7 +172,7 @@ export class ViewportDataGrid<T> extends Common.ObjectWrapper.eventMixin<EventTy
|
|
172
172
|
delete this.updateAnimationFrameId;
|
173
173
|
}
|
174
174
|
|
175
|
-
const clientHeight = this.scrollContainer.clientHeight - this.
|
175
|
+
const clientHeight = this.scrollContainer.clientHeight - this.headerHeightInScroller();
|
176
176
|
let scrollTop: number = this.scrollContainer.scrollTop;
|
177
177
|
const currentScrollTop = scrollTop;
|
178
178
|
const maxScrollTop = Math.max(0, this.contentHeight() - clientHeight);
|
@@ -249,7 +249,7 @@ export class ViewportDataGrid<T> extends Common.ObjectWrapper.eventMixin<EventTy
|
|
249
249
|
}
|
250
250
|
const toY = fromY + node.nodeSelfHeight();
|
251
251
|
let scrollTop: number = this.scrollContainer.scrollTop;
|
252
|
-
const visibleHeight = this.scrollContainer.offsetHeight - this.
|
252
|
+
const visibleHeight = this.scrollContainer.offsetHeight - this.headerHeightInScroller();
|
253
253
|
if (scrollTop > fromY) {
|
254
254
|
scrollTop = fromY;
|
255
255
|
this.stickToBottom = false;
|
package/package.json
CHANGED