chrome-devtools-frontend 1.0.1585664 → 1.0.1587572
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/core/common/Srcset.ts +61 -0
- package/front_end/core/common/common.ts +2 -0
- package/front_end/entrypoint_template.html +5 -1
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/protocol.ts +2 -0
- package/front_end/models/ai_assistance/AiConversation.ts +6 -2
- package/front_end/models/javascript_metadata/NativeFunctions.js +2 -2
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -0
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -2
- package/front_end/panels/console/PromptBuilder.ts +15 -3
- package/front_end/panels/elements/ElementsPanel.ts +114 -15
- package/front_end/panels/elements/ElementsTreeElement.ts +4 -56
- package/front_end/panels/network/NetworkItemView.ts +4 -3
- package/front_end/panels/network/{components/RequestHeadersView.ts → RequestHeadersView.ts} +112 -184
- package/front_end/panels/network/components/RequestHeaderSection.ts +3 -0
- package/front_end/panels/network/components/components.ts +0 -2
- package/front_end/panels/network/network.ts +3 -0
- package/front_end/panels/sources/CallStackSidebarPane.ts +3 -7
- package/front_end/panels/utils/utils.ts +13 -5
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js +7 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +7 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js +7 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/common/util.ts +9 -8
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/legacy/UIUtils.ts +31 -14
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +135 -142
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
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
4
|
|
|
6
5
|
/*
|
|
7
6
|
* Copyright (C) 2011 Google Inc. All rights reserved.
|
|
@@ -38,12 +37,15 @@ import * as i18n from '../../../../core/i18n/i18n.js';
|
|
|
38
37
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
39
38
|
import * as StackTrace from '../../../../models/stack_trace/stack_trace.js';
|
|
40
39
|
import * as Workspace from '../../../../models/workspace/workspace.js';
|
|
40
|
+
import {Directives, html, nothing, render, type TemplateResult} from '../../../lit/lit.js';
|
|
41
41
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
42
42
|
import * as UI from '../../legacy.js';
|
|
43
43
|
|
|
44
44
|
import jsUtilsStyles from './jsUtils.css.js';
|
|
45
45
|
import {Linkifier} from './Linkifier.js';
|
|
46
46
|
|
|
47
|
+
const {classMap} = Directives;
|
|
48
|
+
|
|
47
49
|
const UIStrings = {
|
|
48
50
|
/**
|
|
49
51
|
* @description Text to stop preventing the debugger from stepping into library code
|
|
@@ -89,128 +91,110 @@ function populateContextMenu(link: Element, event: Event): void {
|
|
|
89
91
|
void contextMenu.show();
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const isAsync = 'description' in fragment;
|
|
104
|
-
if (previousFragment && isAsync) {
|
|
105
|
-
asyncRow = {
|
|
106
|
-
asyncDescription: UI.UIUtils.asyncStackTraceLabel(
|
|
107
|
-
fragment.description, previousFragment.frames.map(f => ({functionName: f.name ?? ''}))),
|
|
108
|
-
};
|
|
109
|
-
stackTraceRows.push(asyncRow);
|
|
110
|
-
}
|
|
111
|
-
let previousStackFrameWasBreakpointCondition = false;
|
|
112
|
-
for (const frame of fragment.frames) {
|
|
113
|
-
const functionName = UI.UIUtils.beautifyFunctionName(frame.name ?? '');
|
|
114
|
-
const link = Linkifier.linkifyStackTraceFrame(frame, {
|
|
115
|
-
showColumnNumber,
|
|
116
|
-
tabStop: Boolean(tabStops),
|
|
117
|
-
inlineFrameIndex: 0,
|
|
118
|
-
revealBreakpoint: previousStackFrameWasBreakpointCondition,
|
|
119
|
-
maxLength: UI.UIUtils.MaxLengthForDisplayedURLsInConsole,
|
|
120
|
-
});
|
|
121
|
-
link.setAttribute('jslog', `${VisualLogging.link('stack-trace').track({click: true})}`);
|
|
122
|
-
link.addEventListener('contextmenu', populateContextMenu.bind(null, link));
|
|
123
|
-
|
|
124
|
-
stackTraceRows.push({functionName, link});
|
|
125
|
-
previousStackFrameWasBreakpointCondition = [
|
|
126
|
-
SDK.DebuggerModel.COND_BREAKPOINT_SOURCE_URL,
|
|
127
|
-
SDK.DebuggerModel.LOGPOINT_SOURCE_URL,
|
|
128
|
-
].includes(frame.url ?? '');
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
buildStackTraceRowsHelper(stackTrace.syncFragment);
|
|
133
|
-
let previousFragment = stackTrace.syncFragment;
|
|
134
|
-
for (const asyncFragment of stackTrace.asyncFragments) {
|
|
135
|
-
if (asyncFragment.frames.length) {
|
|
136
|
-
buildStackTraceRowsHelper(asyncFragment, previousFragment);
|
|
137
|
-
}
|
|
138
|
-
previousFragment = asyncFragment;
|
|
139
|
-
}
|
|
140
|
-
return stackTraceRows;
|
|
94
|
+
export interface ViewInput {
|
|
95
|
+
stackTrace?: StackTrace.StackTrace.StackTrace;
|
|
96
|
+
tabStops?: boolean;
|
|
97
|
+
widthConstrained?: boolean;
|
|
98
|
+
showColumnNumber?: boolean;
|
|
99
|
+
expandable?: boolean;
|
|
100
|
+
expanded?: boolean;
|
|
101
|
+
showIgnoreListed?: boolean;
|
|
102
|
+
onExpand: () => void;
|
|
103
|
+
onShowMore: () => void;
|
|
104
|
+
onShowLess: () => void;
|
|
141
105
|
}
|
|
142
106
|
|
|
143
|
-
|
|
144
|
-
container: Element, parent: Element, expandable: boolean,
|
|
145
|
-
stackTraceRows: Array<StackTraceRegularRow|StackTraceAsyncRow>): void {
|
|
146
|
-
container.removeChildren();
|
|
107
|
+
export type View = (input: ViewInput, output: object, target: HTMLElement) => void;
|
|
147
108
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
109
|
+
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
110
|
+
let renderExpandButton = Boolean(input.expandable);
|
|
111
|
+
const maybeRenderExpandButton = (): TemplateResult => {
|
|
112
|
+
// clang-format off
|
|
113
|
+
const result = html`
|
|
114
|
+
${renderExpandButton ? html`
|
|
115
|
+
<button class="arrow-icon-button" jslog=${VisualLogging.expand().track({click: true})} @click=${input.onExpand}>
|
|
116
|
+
<span class="arrow-icon"></span>
|
|
117
|
+
</button>
|
|
118
|
+
` : '\n'}`;
|
|
119
|
+
// clang-format on
|
|
120
|
+
renderExpandButton = false;
|
|
121
|
+
return result;
|
|
122
|
+
};
|
|
156
123
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
124
|
+
const classes = {
|
|
125
|
+
'stack-preview-container': true,
|
|
126
|
+
'width-constrained': Boolean(input.widthConstrained),
|
|
127
|
+
expandable: Boolean(input.expandable),
|
|
128
|
+
expanded: Boolean(input.expanded),
|
|
129
|
+
'show-hidden-rows': Boolean(input.showIgnoreListed),
|
|
130
|
+
};
|
|
131
|
+
const {stackTrace} = input;
|
|
132
|
+
// clang-format off
|
|
133
|
+
render(html`
|
|
134
|
+
<style>${jsUtilsStyles}</style>
|
|
135
|
+
<table class=${classMap(classes)}>
|
|
136
|
+
${stackTrace ? html`
|
|
137
|
+
${[stackTrace.syncFragment, ...stackTrace.asyncFragments].map(fragment => html`
|
|
138
|
+
<tbody>
|
|
139
|
+
${'description' in fragment ? html`
|
|
140
|
+
<tr class="stack-preview-async-row">
|
|
141
|
+
<td>${maybeRenderExpandButton()}</td>
|
|
142
|
+
<td class="stack-preview-async-description">
|
|
143
|
+
${UI.UIUtils.asyncFragmentLabel(stackTrace, fragment as StackTrace.StackTrace.AsyncFragment)}
|
|
144
|
+
</td>
|
|
145
|
+
<td></td>
|
|
146
|
+
<td></td>
|
|
147
|
+
</tr>
|
|
148
|
+
` : nothing}
|
|
149
|
+
${fragment.frames.map((frame, i) => {
|
|
150
|
+
const previousStackFrameWasBreakpointCondition = i > 0 && [
|
|
151
|
+
SDK.DebuggerModel.COND_BREAKPOINT_SOURCE_URL,
|
|
152
|
+
SDK.DebuggerModel.LOGPOINT_SOURCE_URL,
|
|
153
|
+
].includes(fragment.frames[i - 1].url ?? '');
|
|
154
|
+
const link = Linkifier.linkifyStackTraceFrame(frame, {
|
|
155
|
+
showColumnNumber: Boolean(input.showColumnNumber),
|
|
156
|
+
tabStop: Boolean(input.tabStops),
|
|
157
|
+
inlineFrameIndex: 0,
|
|
158
|
+
revealBreakpoint: previousStackFrameWasBreakpointCondition,
|
|
159
|
+
maxLength: UI.UIUtils.MaxLengthForDisplayedURLsInConsole,
|
|
160
|
+
});
|
|
161
|
+
link.setAttribute('jslog', `${VisualLogging.link('stack-trace').track({click: true})}`);
|
|
162
|
+
link.addEventListener('contextmenu', populateContextMenu.bind(null, link));
|
|
163
|
+
return html`
|
|
164
|
+
<tr>
|
|
165
|
+
<td>${maybeRenderExpandButton()}</td>
|
|
166
|
+
<td class="function-name">
|
|
167
|
+
${UI.UIUtils.beautifyFunctionName(frame.name ?? '')}
|
|
168
|
+
</td>
|
|
169
|
+
<td> @ </td>
|
|
170
|
+
<td class="link">${link}</td>
|
|
171
|
+
</tr>
|
|
172
|
+
`;})}
|
|
173
|
+
</tbody>
|
|
174
|
+
`)}
|
|
175
|
+
<tfoot>
|
|
176
|
+
<tr class="show-all-link">
|
|
177
|
+
<td></td>
|
|
178
|
+
<td colspan="3">
|
|
179
|
+
<span class="link" @click=${input.onShowMore}>
|
|
180
|
+
<span class="css-inserted-text" data-inserted-text=${i18nString(UIStrings.showMoreFrames)}></span>
|
|
181
|
+
</span>
|
|
182
|
+
</td>
|
|
183
|
+
</tr>
|
|
184
|
+
<tr class="show-less-link">
|
|
185
|
+
<td></td>
|
|
186
|
+
<td colspan="3">
|
|
187
|
+
<span class="link" @click=${input.onShowLess}>
|
|
188
|
+
<span class="css-inserted-text" data-inserted-text=${i18nString(UIStrings.showLess)}></span>
|
|
189
|
+
</span>
|
|
190
|
+
</td>
|
|
191
|
+
</tr>
|
|
192
|
+
</tfoot>
|
|
193
|
+
` : nothing}
|
|
194
|
+
</table>
|
|
195
|
+
`, target);
|
|
196
|
+
// clang-format on
|
|
197
|
+
};
|
|
214
198
|
|
|
215
199
|
export interface Options {
|
|
216
200
|
tabStops?: boolean;
|
|
@@ -222,27 +206,17 @@ export interface Options {
|
|
|
222
206
|
expandable?: boolean;
|
|
223
207
|
}
|
|
224
208
|
|
|
225
|
-
interface StackTraceRegularRow {
|
|
226
|
-
functionName: string;
|
|
227
|
-
link: HTMLElement;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
interface StackTraceAsyncRow {
|
|
231
|
-
asyncDescription: string;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
209
|
export class StackTracePreviewContent extends UI.Widget.Widget {
|
|
210
|
+
readonly #view: View;
|
|
211
|
+
|
|
235
212
|
#stackTrace?: StackTrace.StackTrace.StackTrace;
|
|
236
213
|
#options: Options = {};
|
|
214
|
+
#expanded = false;
|
|
215
|
+
#showIgnoreListed = false;
|
|
237
216
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
constructor(element?: HTMLElement) {
|
|
217
|
+
constructor(element?: HTMLElement, view = DEFAULT_VIEW) {
|
|
241
218
|
super(element, {useShadowDom: true, classes: ['monospace', 'stack-preview-container']});
|
|
242
|
-
|
|
243
|
-
UI.DOMUtilities.appendStyle(this.element.shadowRoot as ShadowRoot, jsUtilsStyles);
|
|
244
|
-
|
|
245
|
-
this.#table = this.contentElement.createChild('table', 'stack-preview-container');
|
|
219
|
+
this.#view = view;
|
|
246
220
|
}
|
|
247
221
|
|
|
248
222
|
hasContent(): boolean {
|
|
@@ -254,13 +228,20 @@ export class StackTracePreviewContent extends UI.Widget.Widget {
|
|
|
254
228
|
}
|
|
255
229
|
|
|
256
230
|
override performUpdate(): void {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
231
|
+
this.element.classList.toggle('expandable', this.#options.expandable);
|
|
232
|
+
this.element.classList.toggle('expanded', this.#expanded);
|
|
233
|
+
this.element.classList.toggle('show-hidden-rows', this.#showIgnoreListed);
|
|
260
234
|
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
|
|
235
|
+
const input: ViewInput = {
|
|
236
|
+
stackTrace: this.#stackTrace,
|
|
237
|
+
...this.#options,
|
|
238
|
+
expanded: this.#expanded,
|
|
239
|
+
showIgnoreListed: this.#showIgnoreListed,
|
|
240
|
+
onExpand: this.#onExpand.bind(this),
|
|
241
|
+
onShowMore: this.#onShowMoreLess.bind(this, true),
|
|
242
|
+
onShowLess: this.#onShowMoreLess.bind(this, false),
|
|
243
|
+
};
|
|
244
|
+
this.#view(input, {}, this.contentElement);
|
|
264
245
|
}
|
|
265
246
|
|
|
266
247
|
get linkElements(): readonly HTMLElement[] {
|
|
@@ -269,7 +250,6 @@ export class StackTracePreviewContent extends UI.Widget.Widget {
|
|
|
269
250
|
|
|
270
251
|
set options(options: Options) {
|
|
271
252
|
this.#options = options;
|
|
272
|
-
this.#table.classList.toggle('width-constrained', this.#options.widthConstrained ?? false);
|
|
273
253
|
this.requestUpdate();
|
|
274
254
|
}
|
|
275
255
|
|
|
@@ -281,4 +261,17 @@ export class StackTracePreviewContent extends UI.Widget.Widget {
|
|
|
281
261
|
this.#stackTrace.addEventListener(StackTrace.StackTrace.Events.UPDATED, this.requestUpdate, this);
|
|
282
262
|
this.requestUpdate();
|
|
283
263
|
}
|
|
264
|
+
|
|
265
|
+
#onShowMoreLess(more: boolean): void {
|
|
266
|
+
this.#showIgnoreListed = more;
|
|
267
|
+
this.requestUpdate();
|
|
268
|
+
|
|
269
|
+
// If we are in a popup, this will trigger a re-layout
|
|
270
|
+
void this.updateComplete.then(() => UI.GlassPane.GlassPane.containerMoved(this.contentElement));
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
#onExpand(): void {
|
|
274
|
+
this.#expanded = !this.#expanded;
|
|
275
|
+
this.requestUpdate();
|
|
276
|
+
}
|
|
284
277
|
}
|
package/package.json
CHANGED