chrome-devtools-frontend 1.0.1649421 → 1.0.1650100
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/sdk/CSSMetadata.ts +38 -2
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +15 -0
- package/front_end/generated/Deprecation.ts +8 -0
- package/front_end/generated/SupportedCSSProperties.js +342 -114
- package/front_end/models/ai_assistance/AiConversation.ts +2 -1
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +10 -57
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_assistance/contexts/AccessibilityContext.snapshot.txt +26 -0
- package/front_end/models/ai_assistance/contexts/AccessibilityContext.ts +63 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +3 -2
- package/front_end/models/javascript_metadata/NativeFunctions.js +2 -2
- package/front_end/models/stack_trace/DetailedErrorStackParser.ts +18 -0
- package/front_end/models/stack_trace/stack_trace.ts +0 -4
- package/front_end/panels/accessibility/ARIAAttributesView.ts +1 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
- package/front_end/panels/ai_assistance/components/ChatInput.ts +1 -1
- package/front_end/panels/console/ConsolePinPane.ts +1 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +97 -57
- package/front_end/panels/profiler/HeapSnapshotView.ts +6 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +10 -10
- package/front_end/ui/legacy/components/utils/Linkifier.ts +12 -6
- package/package.json +1 -1
- package/front_end/models/stack_trace/ErrorStackParser.ts +0 -174
|
@@ -1060,15 +1060,21 @@ export class LinkHandlerSettingUI {
|
|
|
1060
1060
|
|
|
1061
1061
|
update(): void {
|
|
1062
1062
|
this.element.removeChildren();
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1063
|
+
// Populate the dropdown with extension origins. The first option is the
|
|
1064
|
+
// special "Auto" value which is not a real origin.
|
|
1065
|
+
const origins = [...linkHandlers.keys()];
|
|
1066
|
+
origins.unshift(i18nString(UIStrings.auto));
|
|
1067
|
+
for (const origin of origins) {
|
|
1066
1068
|
const option = document.createElement('option');
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
+
const registration = linkHandlers.get(origin);
|
|
1070
|
+
// If the origin has a registered handler, display its user-friendly title.
|
|
1071
|
+
// Otherwise, fallback to the origin string itself (e.g. for the "Auto" option).
|
|
1072
|
+
option.textContent = registration === undefined ? origin : registration.title;
|
|
1073
|
+
option.value = origin;
|
|
1074
|
+
option.selected = origin === Linkifier.linkHandlerSetting().get();
|
|
1069
1075
|
this.element.appendChild(option);
|
|
1070
1076
|
}
|
|
1071
|
-
this.element.disabled =
|
|
1077
|
+
this.element.disabled = origins.length <= 1;
|
|
1072
1078
|
}
|
|
1073
1079
|
|
|
1074
1080
|
private onChange(event: Event): void {
|
package/package.json
CHANGED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 The Chromium Authors
|
|
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 type * as Platform from '../../core/platform/platform.js';
|
|
7
|
-
import type * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
-
import type * as Protocol from '../../generated/protocol.js';
|
|
9
|
-
|
|
10
|
-
export interface ParsedErrorFrame {
|
|
11
|
-
line: string;
|
|
12
|
-
isCallFrame?: boolean;
|
|
13
|
-
link?: {
|
|
14
|
-
url: Platform.DevToolsPath.UrlString,
|
|
15
|
-
prefix: string,
|
|
16
|
-
suffix: string,
|
|
17
|
-
enclosedInBraces: boolean,
|
|
18
|
-
lineNumber?: number,
|
|
19
|
-
columnNumber?: number,
|
|
20
|
-
scriptId?: Protocol.Runtime.ScriptId,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Combines the error description (essentially the `Error#stack` property value)
|
|
26
|
-
* with the `issueSummary`.
|
|
27
|
-
*
|
|
28
|
-
* @param description the `description` property of the `Error` remote object.
|
|
29
|
-
* @param issueSummary the optional `issueSummary` of the `exceptionMetaData`.
|
|
30
|
-
* @returns the enriched description.
|
|
31
|
-
* @see https://goo.gle/devtools-reduce-network-noise-design
|
|
32
|
-
*/
|
|
33
|
-
export function concatErrorDescriptionAndIssueSummary(description: string, issueSummary: string): string {
|
|
34
|
-
// Insert the issue summary right after the error message.
|
|
35
|
-
const pos = description.indexOf('\n');
|
|
36
|
-
const prefix = pos === -1 ? description : description.substring(0, pos);
|
|
37
|
-
const suffix = pos === -1 ? '' : description.substring(pos);
|
|
38
|
-
description = `${prefix}. ${issueSummary}${suffix}`;
|
|
39
|
-
return description;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Takes a V8 Error#stack string and extracts source position information.
|
|
44
|
-
*
|
|
45
|
-
* The result includes the url, line and column number, as well as where
|
|
46
|
-
* the url is found in the raw line.
|
|
47
|
-
*
|
|
48
|
-
* @returns Null if the provided string has an unexpected format. A
|
|
49
|
-
* populated `ParsedErrorFrame[]` otherwise.
|
|
50
|
-
*/
|
|
51
|
-
export function parseSourcePositionsFromErrorStack(
|
|
52
|
-
runtimeModel: SDK.RuntimeModel.RuntimeModel, stack: string): ParsedErrorFrame[]|null {
|
|
53
|
-
if (!(/\n\s*at\s/.test(stack) || stack.startsWith('SyntaxError:'))) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
const debuggerModel = runtimeModel.debuggerModel();
|
|
57
|
-
const baseURL = runtimeModel.target().inspectedURL();
|
|
58
|
-
|
|
59
|
-
const lines = stack.split('\n');
|
|
60
|
-
const linkInfos = [];
|
|
61
|
-
for (const line of lines) {
|
|
62
|
-
const match = /^\s*at\s(async\s)?/.exec(line);
|
|
63
|
-
if (!match) {
|
|
64
|
-
if (linkInfos.length && linkInfos[linkInfos.length - 1].isCallFrame) {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
linkInfos.push({line});
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const isCallFrame = true;
|
|
72
|
-
let left = match[0].length;
|
|
73
|
-
let right = line.length;
|
|
74
|
-
let enclosedInBraces = false;
|
|
75
|
-
if (line[right - 1] === ')') {
|
|
76
|
-
right--;
|
|
77
|
-
enclosedInBraces = true;
|
|
78
|
-
left = line.lastIndexOf(' (', right);
|
|
79
|
-
if (left < 0) {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
left += 2;
|
|
83
|
-
// Relevant in the `eval at ...` case.
|
|
84
|
-
const newRight = line.indexOf('), ', left);
|
|
85
|
-
if (newRight > left) {
|
|
86
|
-
right = newRight;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const linkCandidate = line.substring(left, right);
|
|
91
|
-
const splitResult = Common.ParsedURL.ParsedURL.splitLineAndColumn(linkCandidate);
|
|
92
|
-
if (splitResult.url === '<anonymous>') {
|
|
93
|
-
if (linkInfos.length && linkInfos[linkInfos.length - 1].isCallFrame && !linkInfos[linkInfos.length - 1].link) {
|
|
94
|
-
// Combine builtin frames.
|
|
95
|
-
linkInfos[linkInfos.length - 1].line += `\n${line}`;
|
|
96
|
-
} else {
|
|
97
|
-
linkInfos.push({line, isCallFrame});
|
|
98
|
-
}
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
let url = parseOrScriptMatch(debuggerModel, splitResult.url);
|
|
102
|
-
if (!url && Common.ParsedURL.ParsedURL.isRelativeURL(splitResult.url)) {
|
|
103
|
-
url = parseOrScriptMatch(debuggerModel, Common.ParsedURL.ParsedURL.completeURL(baseURL, splitResult.url));
|
|
104
|
-
}
|
|
105
|
-
if (!url) {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
linkInfos.push({
|
|
110
|
-
line,
|
|
111
|
-
isCallFrame,
|
|
112
|
-
link: {
|
|
113
|
-
url,
|
|
114
|
-
prefix: line.substring(0, left),
|
|
115
|
-
suffix: line.substring(right),
|
|
116
|
-
enclosedInBraces,
|
|
117
|
-
lineNumber: splitResult.lineNumber,
|
|
118
|
-
columnNumber: splitResult.columnNumber,
|
|
119
|
-
},
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
return linkInfos;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function parseOrScriptMatch(debuggerModel: SDK.DebuggerModel.DebuggerModel, url: Platform.DevToolsPath.UrlString|null):
|
|
126
|
-
Platform.DevToolsPath.UrlString|null {
|
|
127
|
-
if (!url) {
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
if (Common.ParsedURL.ParsedURL.isValidUrlString(url)) {
|
|
131
|
-
return url;
|
|
132
|
-
}
|
|
133
|
-
if (debuggerModel.scriptsForSourceURL(url).length) {
|
|
134
|
-
return url;
|
|
135
|
-
}
|
|
136
|
-
// nodejs stack traces contain (absolute) file paths, but v8 reports them as file: urls.
|
|
137
|
-
const fileUrl = new URL(url, 'file://');
|
|
138
|
-
if (debuggerModel.scriptsForSourceURL(fileUrl.href).length) {
|
|
139
|
-
return fileUrl.href as Platform.DevToolsPath.UrlString;
|
|
140
|
-
}
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Error#stack output only contains script URLs. In some cases we are able to
|
|
146
|
-
* retrieve additional exception details from V8 that we can use to augment
|
|
147
|
-
* the parsed Error#stack with script IDs.
|
|
148
|
-
* This function sets the `scriptId` field in `ParsedErrorFrame` when it finds
|
|
149
|
-
* the corresponding info in `Protocol.Runtime.StackTrace`.
|
|
150
|
-
*/
|
|
151
|
-
export function augmentErrorStackWithScriptIds(
|
|
152
|
-
parsedFrames: ParsedErrorFrame[], protocolStackTrace: Protocol.Runtime.StackTrace): void {
|
|
153
|
-
// Note that the number of frames between the two stack traces can differ. The
|
|
154
|
-
// parsed Error#stack can contain Builtin frames which are not present in the protocol
|
|
155
|
-
// stack. This means its easier to always search the whole protocol stack for a matching
|
|
156
|
-
// frame rather then trying to detect the Builtin frames and skipping them.
|
|
157
|
-
for (const parsedFrame of parsedFrames) {
|
|
158
|
-
const protocolFrame = protocolStackTrace.callFrames.find(frame => framesMatch(parsedFrame, frame));
|
|
159
|
-
if (protocolFrame && parsedFrame.link) {
|
|
160
|
-
parsedFrame.link.scriptId = protocolFrame.scriptId;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/** Returns true iff both stack frames have the same url and line/column numbers. The function name is ignored */
|
|
166
|
-
function framesMatch(parsedFrame: ParsedErrorFrame, protocolFrame: Protocol.Runtime.CallFrame): boolean {
|
|
167
|
-
if (!parsedFrame.link) {
|
|
168
|
-
return false;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const {url, lineNumber, columnNumber} = parsedFrame.link;
|
|
172
|
-
return url === protocolFrame.url && lineNumber === protocolFrame.lineNumber &&
|
|
173
|
-
columnNumber === protocolFrame.columnNumber;
|
|
174
|
-
}
|