chrome-devtools-frontend 1.0.1642246 → 1.0.1642845
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/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +11 -0
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +0 -4
- package/front_end/models/ai_assistance/agents/AiAgent.ts +1 -6
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +0 -4
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +13 -12
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +4 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +16 -0
- package/front_end/panels/console/SymbolizedErrorWidget.ts +96 -2
- package/front_end/panels/console/symbolizedErrorWidget.css +48 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/visual_logging/LoggingDriver.ts +13 -0
- package/package.json +1 -1
|
@@ -1068,6 +1068,17 @@ export abstract class HeapSnapshot {
|
|
|
1068
1068
|
this.#progress.updateStatus('Finished processing.');
|
|
1069
1069
|
}
|
|
1070
1070
|
|
|
1071
|
+
nodeIndexForId(nodeId: number): number|undefined {
|
|
1072
|
+
const nodesLength = this.nodes.length;
|
|
1073
|
+
const {nodes, nodeFieldCount, nodeIdOffset} = this;
|
|
1074
|
+
for (let nodeIndex = 0; nodeIndex < nodesLength; nodeIndex += nodeFieldCount) {
|
|
1075
|
+
if (nodes.getValue(nodeIndex + nodeIdOffset) === nodeId) {
|
|
1076
|
+
return nodeIndex;
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
return undefined;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1071
1082
|
private startInitStep1InSecondThread(secondWorker: PlatformApi.HostRuntime.WorkerMessagePort):
|
|
1072
1083
|
Promise<ResultsFromSecondWorker> {
|
|
1073
1084
|
const resultsFromSecondWorker = new Promise<ResultsFromSecondWorker>((resolve, reject) => {
|
|
@@ -161,10 +161,6 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
|
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
override preambleFeatures(): string[] {
|
|
165
|
-
return ['function_calling'];
|
|
166
|
-
}
|
|
167
|
-
|
|
168
164
|
protected override async preRun(): Promise<void> {
|
|
169
165
|
this.#currentTurnId++;
|
|
170
166
|
const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
@@ -530,10 +530,6 @@ export abstract class AiAgent<T> {
|
|
|
530
530
|
return undefined;
|
|
531
531
|
}
|
|
532
532
|
|
|
533
|
-
preambleFeatures(): string[] {
|
|
534
|
-
return [];
|
|
535
|
-
}
|
|
536
|
-
|
|
537
533
|
buildRequest(
|
|
538
534
|
part: Host.AidaClient.Part|Host.AidaClient.Part[],
|
|
539
535
|
role: Host.AidaClient.Role.USER|Host.AidaClient.Role.ROLE_UNSPECIFIED): Host.AidaClient.DoConversationRequest {
|
|
@@ -577,8 +573,7 @@ export abstract class AiAgent<T> {
|
|
|
577
573
|
disable_user_content_logging: !(this.#serverSideLoggingEnabled ?? false),
|
|
578
574
|
string_session_id: this.#sessionId,
|
|
579
575
|
user_tier: userTier,
|
|
580
|
-
client_version:
|
|
581
|
-
Root.Runtime.getChromeVersion() + this.preambleFeatures().map(feature => `+${feature}`).join(''),
|
|
576
|
+
client_version: Root.Runtime.getChromeVersion(),
|
|
582
577
|
},
|
|
583
578
|
|
|
584
579
|
functionality_type: enableAidaFunctionCalling ? Host.AidaClient.FunctionalityType.AGENTIC_CHAT :
|
|
@@ -154,7 +154,7 @@ Content:
|
|
|
154
154
|
"disable_user_content_logging": false,
|
|
155
155
|
"string_session_id": "sessionId",
|
|
156
156
|
"user_tier": 3,
|
|
157
|
-
"client_version": "unit_test
|
|
157
|
+
"client_version": "unit_test"
|
|
158
158
|
},
|
|
159
159
|
"functionality_type": 5,
|
|
160
160
|
"client_feature": 2
|
|
@@ -254,10 +254,6 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
|
|
|
254
254
|
return Boolean(Root.Runtime.hostConfig.devToolsFreestyler?.multimodal);
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
override preambleFeatures(): string[] {
|
|
258
|
-
return ['function_calling'];
|
|
259
|
-
}
|
|
260
|
-
|
|
261
257
|
#execJs: typeof executeJsCode;
|
|
262
258
|
#javascriptExecutor: JavascriptExecutor;
|
|
263
259
|
|
|
@@ -2,6 +2,8 @@
|
|
|
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 Common from '../../../core/common/common.js';
|
|
6
|
+
import type * as Platform from '../../../core/platform/platform.js';
|
|
5
7
|
import type * as SDK from '../../../core/sdk/sdk.js';
|
|
6
8
|
import * as Protocol from '../../../generated/protocol.js';
|
|
7
9
|
import * as Annotations from '../../annotations/annotations.js';
|
|
@@ -68,17 +70,16 @@ export class NetworkRequestFormatter {
|
|
|
68
70
|
return `${title}\n<binary data>`;
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
static formatInitiatorUrl(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return
|
|
79
|
-
} catch {
|
|
80
|
-
return '<redacted cross-origin initiator URL>';
|
|
73
|
+
static formatInitiatorUrl(
|
|
74
|
+
initiatorUrl: Platform.DevToolsPath.UrlString,
|
|
75
|
+
allowedOrigin: Platform.DevToolsPath.UrlString,
|
|
76
|
+
): string {
|
|
77
|
+
// We extract the origin, and if it is invalid/empty we default to redacting.
|
|
78
|
+
const initiatorOrigin = Common.ParsedURL.ParsedURL.extractOrigin(initiatorUrl);
|
|
79
|
+
if (initiatorOrigin && initiatorOrigin === allowedOrigin) {
|
|
80
|
+
return initiatorUrl;
|
|
81
81
|
}
|
|
82
|
+
return '<redacted cross-origin initiator URL>';
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
static formatStatus(status: {
|
|
@@ -196,7 +197,7 @@ Request initiator chain:\n${this.formatRequestInitiatorChain()}`;
|
|
|
196
197
|
* the request's origin.
|
|
197
198
|
*/
|
|
198
199
|
formatRequestInitiatorChain(): string {
|
|
199
|
-
const allowedOrigin =
|
|
200
|
+
const allowedOrigin = Common.ParsedURL.ParsedURL.extractOrigin(this.#request.url());
|
|
200
201
|
let initiatorChain = '';
|
|
201
202
|
let lineStart = '- URL: ';
|
|
202
203
|
const graph = Logs.NetworkLog.NetworkLog.instance().initiatorGraphForRequest(this.#request);
|
|
@@ -268,7 +269,7 @@ Request initiator chain:\n${this.formatRequestInitiatorChain()}`;
|
|
|
268
269
|
parentRequest: SDK.NetworkRequest.NetworkRequest,
|
|
269
270
|
initiatorChain: string,
|
|
270
271
|
lineStart: string,
|
|
271
|
-
allowedOrigin:
|
|
272
|
+
allowedOrigin: Platform.DevToolsPath.UrlString,
|
|
272
273
|
): string {
|
|
273
274
|
const visited = new Set<SDK.NetworkRequest.NetworkRequest>();
|
|
274
275
|
|
|
@@ -289,6 +289,10 @@ export class HeapSnapshotProxy extends HeapSnapshotProxyObject {
|
|
|
289
289
|
return this.callMethodPromise('nodeClassKey', snapshotObjectId);
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
+
nodeIndexForId(nodeId: number): Promise<number|undefined> {
|
|
293
|
+
return this.callMethodPromise('nodeIndexForId', nodeId);
|
|
294
|
+
}
|
|
295
|
+
|
|
292
296
|
createEdgesProvider(nodeIndex: number): HeapSnapshotProviderProxy {
|
|
293
297
|
return this.callFactoryMethod('createEdgesProvider', HeapSnapshotProviderProxy, nodeIndex);
|
|
294
298
|
}
|
|
@@ -6489,6 +6489,22 @@ export const NativeFunctions = [
|
|
|
6489
6489
|
name: "XRLayerEvent",
|
|
6490
6490
|
signatures: [["type","eventInitDict"]]
|
|
6491
6491
|
},
|
|
6492
|
+
{
|
|
6493
|
+
name: "XRMediaBinding",
|
|
6494
|
+
signatures: [["session"]]
|
|
6495
|
+
},
|
|
6496
|
+
{
|
|
6497
|
+
name: "createQuadLayer",
|
|
6498
|
+
signatures: [["video","init"]]
|
|
6499
|
+
},
|
|
6500
|
+
{
|
|
6501
|
+
name: "createCylinderLayer",
|
|
6502
|
+
signatures: [["video","init"]]
|
|
6503
|
+
},
|
|
6504
|
+
{
|
|
6505
|
+
name: "createEquirectLayer",
|
|
6506
|
+
signatures: [["video","init"]]
|
|
6507
|
+
},
|
|
6492
6508
|
{
|
|
6493
6509
|
name: "XRRay",
|
|
6494
6510
|
signatures: [["transform"],["?origin","?direction"]]
|
|
@@ -3,15 +3,108 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
6
|
+
import type * as StackTrace from '../../models/stack_trace/stack_trace.js';
|
|
6
7
|
import type * as Workspace from '../../models/workspace/workspace.js';
|
|
8
|
+
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
7
9
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
10
|
+
import * as Lit from '../../ui/lit/lit.js';
|
|
11
|
+
|
|
12
|
+
const {html, render} = Lit;
|
|
8
13
|
|
|
9
14
|
export interface ViewInput {
|
|
10
15
|
error: Bindings.SymbolizedError.SymbolizedError;
|
|
11
16
|
ignoreListManager?: Workspace.IgnoreListManager.IgnoreListManager;
|
|
12
17
|
}
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
function renderHeader(content: Lit.LitTemplate|Node|UI.Widget.Widget, isCause: boolean): Lit.LitTemplate {
|
|
20
|
+
if (isCause) {
|
|
21
|
+
return html`<div class="symbolized-error-header"><span>Caused by: </span><span class="error-message-text">${
|
|
22
|
+
content}</span></div>`;
|
|
23
|
+
}
|
|
24
|
+
return html`<span class="error-message-text">${content}</span>`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function renderFramePrefix(
|
|
28
|
+
frame: StackTrace.StackTrace.ParsedErrorStackFrame,
|
|
29
|
+
_options: Components.Linkifier.LinkifyOptions): Lit.LitTemplate {
|
|
30
|
+
const asyncPrefix = frame.isAsync ? 'async ' : '';
|
|
31
|
+
if (frame.promiseIndex !== undefined) {
|
|
32
|
+
const name = frame.name || 'Promise.all';
|
|
33
|
+
return html`${asyncPrefix}${name} (index ${frame.promiseIndex})`;
|
|
34
|
+
}
|
|
35
|
+
const constructorPrefix = frame.isConstructor ? 'new ' : '';
|
|
36
|
+
let name = frame.name || '';
|
|
37
|
+
const isInline = Boolean(frame.rawName) && frame.name !== frame.rawName;
|
|
38
|
+
if (!isInline && frame.methodName && name && name !== frame.methodName && !name.endsWith('.' + frame.methodName) &&
|
|
39
|
+
!name.endsWith(' ' + frame.methodName)) {
|
|
40
|
+
name += ` [as ${frame.methodName}]`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (name) {
|
|
44
|
+
return html`${asyncPrefix}${constructorPrefix}${name} (`;
|
|
45
|
+
}
|
|
46
|
+
return html`${asyncPrefix}${constructorPrefix}`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function renderFrameSuffix(frame: StackTrace.StackTrace.ParsedErrorStackFrame): Lit.LitTemplate {
|
|
50
|
+
if (frame.promiseIndex !== undefined) {
|
|
51
|
+
return Lit.nothing;
|
|
52
|
+
}
|
|
53
|
+
if (frame.name) {
|
|
54
|
+
return html`)`;
|
|
55
|
+
}
|
|
56
|
+
return Lit.nothing;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const DEFAULT_VIEW = (input: ViewInput, _output: object, target: HTMLElement): void => {
|
|
60
|
+
const renderError = (error: Bindings.SymbolizedError.SymbolizedError, isCause: boolean): Lit.LitTemplate => {
|
|
61
|
+
if (!(error instanceof Bindings.SymbolizedError.SymbolizedErrorObject)) {
|
|
62
|
+
console.error('SymbolizedErrorWidget received an unsupported error type:', error);
|
|
63
|
+
return Lit.nothing;
|
|
64
|
+
}
|
|
65
|
+
const linkOptions: Components.Linkifier.LinkifyOptions = {
|
|
66
|
+
showColumnNumber: true,
|
|
67
|
+
inlineFrameIndex: 0,
|
|
68
|
+
maxLength: UI.UIUtils.MaxLengthForDisplayedURLsInConsole,
|
|
69
|
+
ignoreListManager: input.ignoreListManager,
|
|
70
|
+
};
|
|
71
|
+
const headerContent = html`${error.message}`;
|
|
72
|
+
const header = renderHeader(headerContent, isCause);
|
|
73
|
+
const syncFrames = error.stackTrace.syncFragment.frames;
|
|
74
|
+
// clang-format off
|
|
75
|
+
return html`
|
|
76
|
+
<span class=${isCause ? 'console-message-stack-trace-wrapper' : ''}
|
|
77
|
+
>${header}${syncFrames.length > 0 ? '\n' : ''}${syncFrames.map((frame: StackTrace.StackTrace.ParsedErrorStackFrame, i: number) => {
|
|
78
|
+
let linkElement: HTMLElement|Lit.LitTemplate = Lit.nothing;
|
|
79
|
+
let isBuiltin = false;
|
|
80
|
+
if (frame.promiseIndex !== undefined) {
|
|
81
|
+
// Promise.all doesn't have a linkable location.
|
|
82
|
+
isBuiltin = true;
|
|
83
|
+
} else if (frame.url || frame.uiSourceCode) {
|
|
84
|
+
const link = Components.Linkifier.Linkifier.linkifyStackTraceFrame(frame, linkOptions);
|
|
85
|
+
link.tabIndex = -1;
|
|
86
|
+
linkElement = link;
|
|
87
|
+
} else {
|
|
88
|
+
linkElement = html`<span><anonymous></span>`;
|
|
89
|
+
isBuiltin = true;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const newline = i < error.stackTrace.syncFragment.frames.length - 1 ? '\n' : '';
|
|
93
|
+
const frameClass = isBuiltin ? 'formatted-builtin-stack-frame' : 'formatted-stack-frame';
|
|
94
|
+
return html`
|
|
95
|
+
<span class=${frameClass}>${' at '}${renderFramePrefix(frame, linkOptions)}${linkElement}${renderFrameSuffix(frame)}${newline}</span>
|
|
96
|
+
`;
|
|
97
|
+
})}
|
|
98
|
+
</span>
|
|
99
|
+
${error.cause ? renderError(error.cause, true) : Lit.nothing}
|
|
100
|
+
`;
|
|
101
|
+
// clang-format on
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// clang-format off
|
|
105
|
+
render(html`<span class="symbolized-error-widget">${renderError(input.error, false)}</span>`, target);
|
|
106
|
+
// clang-format on
|
|
107
|
+
};
|
|
15
108
|
|
|
16
109
|
export class SymbolizedErrorWidget extends UI.Widget.Widget {
|
|
17
110
|
#error?: Bindings.SymbolizedError.SymbolizedError;
|
|
@@ -19,7 +112,8 @@ export class SymbolizedErrorWidget extends UI.Widget.Widget {
|
|
|
19
112
|
#ignoreListManager?: Workspace.IgnoreListManager.IgnoreListManager;
|
|
20
113
|
|
|
21
114
|
constructor(element?: HTMLElement, view: typeof DEFAULT_VIEW = DEFAULT_VIEW) {
|
|
22
|
-
|
|
115
|
+
const host = element || document.createElement('span');
|
|
116
|
+
super(host, {classes: ['symbolized-error-widget-host']});
|
|
23
117
|
this.#view = view;
|
|
24
118
|
}
|
|
25
119
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 The Chromium Authors
|
|
3
|
+
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
.symbolized-error-widget {
|
|
8
|
+
white-space: pre-wrap;
|
|
9
|
+
word-break: break-all;
|
|
10
|
+
|
|
11
|
+
--display-formatted-stack-frame-default: block;
|
|
12
|
+
--display-ignored-formatted-stack-frame-local: var(--display-ignored-formatted-stack-frame, none);
|
|
13
|
+
|
|
14
|
+
&.show-hidden-rows {
|
|
15
|
+
--display-ignored-formatted-stack-frame-local: var(--display-formatted-stack-frame-default);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.symbolized-error-widget .formatted-stack-frame {
|
|
20
|
+
display: var(--display-formatted-stack-frame-default);
|
|
21
|
+
|
|
22
|
+
&:has(.ignore-list-link) {
|
|
23
|
+
display: var(--display-ignored-formatted-stack-frame-local);
|
|
24
|
+
opacity: 60%;
|
|
25
|
+
|
|
26
|
+
/* Subsequent builtin stack frames are also treated as ignored */
|
|
27
|
+
& + .formatted-builtin-stack-frame {
|
|
28
|
+
display: var(--display-ignored-formatted-stack-frame-local);
|
|
29
|
+
opacity: 60%;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.symbolized-error-widget .formatted-builtin-stack-frame {
|
|
35
|
+
display: var(--display-formatted-stack-frame-default);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.symbolized-error-widget-host {
|
|
39
|
+
display: inline;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.symbolized-error-header {
|
|
43
|
+
display: block;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.error-message-text {
|
|
47
|
+
display: inline;
|
|
48
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Name: Dependencies sourced from the upstream `chromium` repository
|
|
2
2
|
URL: Internal
|
|
3
3
|
Version: N/A
|
|
4
|
-
Revision:
|
|
4
|
+
Revision: 2d046db188ecad76b2859f8baeb9685cb8fe9c08
|
|
5
5
|
Update Mechanism: Manual (https://crbug.com/428069060)
|
|
6
6
|
License: BSD-3-Clause
|
|
7
7
|
License File: LICENSE
|
|
@@ -80,6 +80,12 @@ export async function addDocument(document: Document): Promise<void> {
|
|
|
80
80
|
}
|
|
81
81
|
document.addEventListener('visibilitychange', scheduleProcessing);
|
|
82
82
|
document.addEventListener('scroll', scheduleProcessing);
|
|
83
|
+
const resizeListener = (): void => {
|
|
84
|
+
viewportRects.delete(document);
|
|
85
|
+
scheduleProcessing();
|
|
86
|
+
};
|
|
87
|
+
document.defaultView?.addEventListener('resize', resizeListener);
|
|
88
|
+
resizeListeners.set(document, resizeListener);
|
|
83
89
|
observeMutations([document.body]);
|
|
84
90
|
}
|
|
85
91
|
|
|
@@ -90,12 +96,18 @@ export async function stopLogging(): Promise<void> {
|
|
|
90
96
|
for (const document of documents) {
|
|
91
97
|
document.removeEventListener('visibilitychange', scheduleProcessing);
|
|
92
98
|
document.removeEventListener('scroll', scheduleProcessing);
|
|
99
|
+
const resizeListener = resizeListeners.get(document);
|
|
100
|
+
if (resizeListener) {
|
|
101
|
+
document.defaultView?.removeEventListener('resize', resizeListener);
|
|
102
|
+
resizeListeners.delete(document);
|
|
103
|
+
}
|
|
93
104
|
}
|
|
94
105
|
mutationObserver.disconnect();
|
|
95
106
|
resizeObserver.disconnect();
|
|
96
107
|
intersectionObserver.disconnect();
|
|
97
108
|
documents.length = 0;
|
|
98
109
|
viewportRects.clear();
|
|
110
|
+
resizeListeners.clear();
|
|
99
111
|
processingThrottler = noOpThrottler;
|
|
100
112
|
pendingResize.clear();
|
|
101
113
|
pendingChange.clear();
|
|
@@ -130,6 +142,7 @@ export function scheduleProcessing(): void {
|
|
|
130
142
|
}
|
|
131
143
|
|
|
132
144
|
const viewportRects = new Map<Document, DOMRect>();
|
|
145
|
+
const resizeListeners = new Map<Document, () => void>();
|
|
133
146
|
const viewportRectFor = (element: Element): DOMRect => {
|
|
134
147
|
const ownerDocument = element.ownerDocument;
|
|
135
148
|
const viewportRect = viewportRects.get(ownerDocument) ||
|
package/package.json
CHANGED