chrome-devtools-frontend 1.0.971140 → 1.0.971727
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 +8 -7
- package/front_end/core/common/ParsedURL.ts +9 -3
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/sdk/CSSModel.ts +21 -0
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +10 -10
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +6 -4
- package/front_end/core/sdk/DOMDebuggerModel.ts +4 -3
- package/front_end/core/sdk/DebuggerModel.ts +17 -16
- package/front_end/core/sdk/NetworkManager.ts +2 -2
- package/front_end/core/sdk/NetworkRequest.ts +5 -5
- package/front_end/core/sdk/Resource.ts +10 -10
- package/front_end/core/sdk/ResourceTreeModel.ts +18 -13
- package/front_end/core/sdk/Script.ts +10 -10
- package/front_end/core/sdk/SourceMap.ts +3 -1
- package/front_end/entrypoints/main/MainImpl.ts +5 -0
- package/front_end/generated/InspectorBackendCommands.js +14 -8
- package/front_end/generated/SupportedCSSProperties.js +2 -0
- package/front_end/generated/protocol-mapping.d.ts +5 -0
- package/front_end/generated/protocol-proxy-api.d.ts +5 -0
- package/front_end/generated/protocol.ts +20 -12
- package/front_end/models/bindings/BreakpointManager.ts +7 -5
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +2 -1
- package/front_end/models/bindings/ResourceMapping.ts +2 -1
- package/front_end/models/bindings/ResourceScriptMapping.ts +2 -1
- package/front_end/models/bindings/StylesSourceMapping.ts +2 -1
- package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +12 -12
- package/front_end/models/issues_manager/descriptions/{federatedAuthRequestClientIdMetadataHttpNotFound.md → federatedAuthRequestClientMetadataHttpNotFound.md} +0 -0
- package/front_end/models/issues_manager/descriptions/{federatedAuthRequestClientIdMetadataInvalidResponse.md → federatedAuthRequestClientMetadataInvalidResponse.md} +0 -0
- package/front_end/models/issues_manager/descriptions/{federatedAuthRequestClientIdMetadataNoResponse.md → federatedAuthRequestClientMetadataNoResponse.md} +0 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +1 -1
- package/front_end/models/persistence/IsolatedFileSystem.ts +10 -12
- package/front_end/models/persistence/PersistenceActions.ts +1 -4
- package/front_end/models/persistence/PlatformFileSystem.ts +3 -3
- package/front_end/{panels/sources/SourceMapNamesResolver.ts → models/source_map_scopes/NamesResolver.ts} +5 -5
- package/front_end/models/source_map_scopes/source_map_scopes.ts +7 -0
- package/front_end/models/text_utils/ContentProvider.ts +2 -1
- package/front_end/models/text_utils/StaticContentProvider.ts +5 -4
- package/front_end/models/workspace/UISourceCode.ts +7 -7
- package/front_end/models/workspace/WorkspaceImpl.ts +1 -3
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
- package/front_end/panels/console/ConsolePrompt.ts +25 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +41 -8
- package/front_end/panels/coverage/CoverageModel.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +0 -6
- package/front_end/panels/elements/StylesSidebarPane.ts +16 -18
- package/front_end/panels/issues/AffectedResourcesView.ts +1 -1
- package/front_end/panels/issues/AffectedSourcesView.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +0 -5
- package/front_end/panels/network/NetworkDataGridNode.ts +1 -1
- package/front_end/panels/profiler/CPUProfileView.ts +1 -1
- package/front_end/panels/profiler/HeapProfileView.ts +0 -2
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +0 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +2 -3
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +5 -4
- package/front_end/panels/sources/NavigatorView.ts +1 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +6 -3
- package/front_end/panels/sources/SourcesNavigator.ts +7 -1
- package/front_end/panels/sources/sources-legacy.ts +5 -3
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/panels/timeline/TimelineUIUtils.ts +4 -47
- package/front_end/ui/legacy/ViewManager.ts +2 -1
- package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -1
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +2 -3
- package/front_end/ui/legacy/components/utils/Linkifier.ts +20 -59
- package/package.json +1 -1
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownHttpNotFound.md +0 -1
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownInvalidResponse.md +0 -1
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownNoResponse.md +0 -1
@@ -5,7 +5,9 @@
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
6
6
|
import * as Host from '../../core/host/host.js';
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
8
|
+
import * as Root from '../../core/root/root.js';
|
8
9
|
import * as SDK from '../../core/sdk/sdk.js';
|
10
|
+
import * as SourceMapScopes from '../../models/source_map_scopes/source_map_scopes.js';
|
9
11
|
import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
10
12
|
import * as TextEditor from '../../ui/components/text_editor/text_editor.js';
|
11
13
|
import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
|
@@ -280,14 +282,35 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
280
282
|
const executionContext = currentExecutionContext;
|
281
283
|
const message = SDK.ConsoleModel.ConsoleModel.instance().addCommandMessage(executionContext, text);
|
282
284
|
const expression = ObjectUI.JavaScriptREPL.JavaScriptREPL.preprocessExpression(text);
|
283
|
-
void
|
284
|
-
executionContext, message, expression, useCommandLineAPI);
|
285
|
+
void this.evaluateCommandInConsole(executionContext, message, expression, useCommandLineAPI);
|
285
286
|
if (ConsolePanel.instance().isShowing()) {
|
286
287
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.CommandEvaluatedInConsolePanel);
|
287
288
|
}
|
288
289
|
}
|
289
290
|
}
|
290
291
|
|
292
|
+
private async evaluateCommandInConsole(
|
293
|
+
executionContext: SDK.RuntimeModel.ExecutionContext, message: SDK.ConsoleModel.ConsoleMessage, expression: string,
|
294
|
+
useCommandLineAPI: boolean): Promise<void> {
|
295
|
+
if (Root.Runtime.experiments.isEnabled('evaluateExpressionsWithSourceMaps')) {
|
296
|
+
const callFrame = executionContext.debuggerModel.selectedCallFrame();
|
297
|
+
if (callFrame) {
|
298
|
+
const nameMap = await SourceMapScopes.NamesResolver.allVariablesInCallFrame(callFrame);
|
299
|
+
expression = this.substituteNames(expression, nameMap);
|
300
|
+
}
|
301
|
+
}
|
302
|
+
|
303
|
+
await SDK.ConsoleModel.ConsoleModel.instance().evaluateCommandInConsole(
|
304
|
+
executionContext, message, expression, useCommandLineAPI);
|
305
|
+
}
|
306
|
+
|
307
|
+
private substituteNames(expression: string, mapping: Map<string, string>): string {
|
308
|
+
// TODO(jarin) Build a more reliable replacer, based on the parsed AST.
|
309
|
+
// Here, we just replace exact occurrences.
|
310
|
+
const replacement = mapping.get(expression);
|
311
|
+
return replacement ?? expression;
|
312
|
+
}
|
313
|
+
|
291
314
|
private editorUpdate(update: CodeMirror.ViewUpdate): void {
|
292
315
|
if (update.docChanged ||
|
293
316
|
CodeMirror.selectedCompletion(update.state) !== CodeMirror.selectedCompletion(update.startState)) {
|
@@ -548,8 +548,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
548
548
|
return null;
|
549
549
|
}
|
550
550
|
return this.linkifier.linkifyScriptLocation(
|
551
|
-
runtimeModel.target(), /* scriptId */ null, url, lineNumber,
|
552
|
-
{columnNumber, className: undefined, tabStop: undefined, inlineFrameIndex: 0});
|
551
|
+
runtimeModel.target(), /* scriptId */ null, url, lineNumber, {columnNumber, inlineFrameIndex: 0});
|
553
552
|
}
|
554
553
|
|
555
554
|
private linkifyStackTraceTopFrame(stackTrace: Protocol.Runtime.StackTrace): HTMLElement|null {
|
@@ -567,8 +566,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
567
566
|
return null;
|
568
567
|
}
|
569
568
|
return this.linkifier.linkifyScriptLocation(
|
570
|
-
runtimeModel.target(), scriptId, url, lineNumber,
|
571
|
-
{columnNumber, className: undefined, tabStop: undefined, inlineFrameIndex: 0});
|
569
|
+
runtimeModel.target(), scriptId, url, lineNumber, {columnNumber, inlineFrameIndex: 0});
|
572
570
|
}
|
573
571
|
|
574
572
|
private format(rawParameters: (string|SDK.RemoteObject.RemoteObject|Protocol.Runtime.RemoteObject|undefined)[]):
|
@@ -1435,8 +1433,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
1435
1433
|
const formattedLine = document.createElement('span');
|
1436
1434
|
formattedLine.appendChild(this.linkifyStringAsFragment(`${prefix} ${name} (`));
|
1437
1435
|
const scriptLocationLink = this.linkifier.linkifyScriptLocation(
|
1438
|
-
debuggerModel.target(), null, url, lineNumber,
|
1439
|
-
{columnNumber, className: undefined, tabStop: undefined, inlineFrameIndex: f});
|
1436
|
+
debuggerModel.target(), null, url, lineNumber, {columnNumber, inlineFrameIndex: f});
|
1440
1437
|
scriptLocationLink.tabIndex = -1;
|
1441
1438
|
this.selectableChildren.push({element: scriptLocationLink, forceSelect: (): void => scriptLocationLink.focus()});
|
1442
1439
|
formattedLine.appendChild(scriptLocationLink);
|
@@ -1446,6 +1443,30 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
1446
1443
|
return true;
|
1447
1444
|
}
|
1448
1445
|
|
1446
|
+
private createScriptLocationLinkForSyntaxError(
|
1447
|
+
debuggerModel: SDK.DebuggerModel.DebuggerModel, exceptionDetails: Protocol.Runtime.ExceptionDetails): HTMLElement
|
1448
|
+
|undefined {
|
1449
|
+
const {scriptId, lineNumber, columnNumber} = exceptionDetails;
|
1450
|
+
if (!scriptId) {
|
1451
|
+
return;
|
1452
|
+
}
|
1453
|
+
|
1454
|
+
// SyntaxErrors might not populate the URL field. Try to resolve it via scriptId.
|
1455
|
+
const url = exceptionDetails.url || debuggerModel.scriptForId(scriptId)?.sourceURL;
|
1456
|
+
if (!url) {
|
1457
|
+
return;
|
1458
|
+
}
|
1459
|
+
|
1460
|
+
const scriptLocationLink = this.linkifier.linkifyScriptLocation(
|
1461
|
+
debuggerModel.target(), exceptionDetails.scriptId || null, url, lineNumber, {
|
1462
|
+
columnNumber,
|
1463
|
+
inlineFrameIndex: 0,
|
1464
|
+
showColumnNumber: true,
|
1465
|
+
});
|
1466
|
+
scriptLocationLink.tabIndex = -1;
|
1467
|
+
return scriptLocationLink;
|
1468
|
+
}
|
1469
|
+
|
1449
1470
|
private tryFormatAsError(string: string, exceptionDetails?: Protocol.Runtime.ExceptionDetails): HTMLElement|null {
|
1450
1471
|
const runtimeModel = this.message.runtimeModel();
|
1451
1472
|
if (!runtimeModel) {
|
@@ -1465,6 +1486,20 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
1465
1486
|
for (let i = 0; i < linkInfos.length; ++i) {
|
1466
1487
|
const newline = i < linkInfos.length - 1 ? '\n' : '';
|
1467
1488
|
const {line, link} = linkInfos[i];
|
1489
|
+
// Syntax errors don't have a stack frame that points to the source position
|
1490
|
+
// where the error occurred. We use the source location from the
|
1491
|
+
// exceptionDetails and append it to the end of the message instead.
|
1492
|
+
if (!link && exceptionDetails && line.startsWith('SyntaxError')) {
|
1493
|
+
formattedResult.appendChild(this.linkifyStringAsFragment(line));
|
1494
|
+
const maybeScriptLocation = this.createScriptLocationLinkForSyntaxError(debuggerModel, exceptionDetails);
|
1495
|
+
if (maybeScriptLocation) {
|
1496
|
+
formattedResult.append(' (at ');
|
1497
|
+
formattedResult.appendChild(maybeScriptLocation);
|
1498
|
+
formattedResult.append(')');
|
1499
|
+
}
|
1500
|
+
formattedResult.append(newline);
|
1501
|
+
continue;
|
1502
|
+
}
|
1468
1503
|
if (!link) {
|
1469
1504
|
formattedResult.appendChild(this.linkifyStringAsFragment(`${line}${newline}`));
|
1470
1505
|
continue;
|
@@ -1475,8 +1510,6 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
1475
1510
|
const scriptLocationLink = this.linkifier.linkifyScriptLocation(
|
1476
1511
|
debuggerModel.target(), link.scriptId || null, link.url, link.lineNumber, {
|
1477
1512
|
columnNumber: link.columnNumber,
|
1478
|
-
className: undefined,
|
1479
|
-
tabStop: undefined,
|
1480
1513
|
inlineFrameIndex: 0,
|
1481
1514
|
showColumnNumber: true,
|
1482
1515
|
});
|
@@ -1514,14 +1514,8 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
1514
1514
|
Components.Linkifier.Linkifier.linkifyURL(rewrittenHref, {
|
1515
1515
|
text: value,
|
1516
1516
|
preventClick: true,
|
1517
|
-
className: undefined,
|
1518
|
-
lineNumber: undefined,
|
1519
|
-
columnNumber: undefined,
|
1520
1517
|
showColumnNumber: false,
|
1521
1518
|
inlineFrameIndex: 0,
|
1522
|
-
maxLength: undefined,
|
1523
|
-
tabStop: undefined,
|
1524
|
-
bypassURLTrimming: undefined,
|
1525
1519
|
});
|
1526
1520
|
return ImagePreviewPopover.setImageUrl(link, rewrittenHref);
|
1527
1521
|
}
|
@@ -2465,9 +2465,9 @@ export class StylePropertiesSection {
|
|
2465
2465
|
return true;
|
2466
2466
|
}
|
2467
2467
|
|
2468
|
-
private editingMediaCommitted(
|
2468
|
+
private async editingMediaCommitted(
|
2469
2469
|
query: SDK.CSSQuery.CSSQuery, element: Element, newContent: string, _oldContent: string,
|
2470
|
-
_context: Context|undefined, _moveDirection: string): void {
|
2470
|
+
_context: Context|undefined, _moveDirection: string): Promise<void> {
|
2471
2471
|
this.parentPane.setEditingStyle(false);
|
2472
2472
|
this.editingMediaFinished(element);
|
2473
2473
|
|
@@ -2475,7 +2475,20 @@ export class StylePropertiesSection {
|
|
2475
2475
|
newContent = newContent.trim();
|
2476
2476
|
}
|
2477
2477
|
|
2478
|
-
|
2478
|
+
// This gets deleted in finishOperation(), which is called both on success and failure.
|
2479
|
+
this.parentPane.setUserOperation(true);
|
2480
|
+
const cssModel = this.parentPane.cssModel();
|
2481
|
+
if (cssModel && query.styleSheetId) {
|
2482
|
+
const range = query.range as TextUtils.TextRange.TextRange;
|
2483
|
+
let success = false;
|
2484
|
+
if (query instanceof SDK.CSSContainerQuery.CSSContainerQuery) {
|
2485
|
+
success = await cssModel.setContainerQueryText(query.styleSheetId, range, newContent);
|
2486
|
+
} else if (query instanceof SDK.CSSSupports.CSSSupports) {
|
2487
|
+
success = await cssModel.setSupportsText(query.styleSheetId, range, newContent);
|
2488
|
+
} else {
|
2489
|
+
success = await cssModel.setMediaText(query.styleSheetId, range, newContent);
|
2490
|
+
}
|
2491
|
+
|
2479
2492
|
if (success) {
|
2480
2493
|
this.matchedStyles.resetActiveProperties();
|
2481
2494
|
this.parentPane.refreshUpdate(this);
|
@@ -2483,16 +2496,6 @@ export class StylePropertiesSection {
|
|
2483
2496
|
this.parentPane.setUserOperation(false);
|
2484
2497
|
this.editingMediaTextCommittedForTest();
|
2485
2498
|
}
|
2486
|
-
|
2487
|
-
// This gets deleted in finishOperation(), which is called both on success and failure.
|
2488
|
-
this.parentPane.setUserOperation(true);
|
2489
|
-
const cssModel = this.parentPane.cssModel();
|
2490
|
-
if (cssModel && query.styleSheetId) {
|
2491
|
-
const setQueryText =
|
2492
|
-
query instanceof SDK.CSSMedia.CSSMedia ? cssModel.setMediaText : cssModel.setContainerQueryText;
|
2493
|
-
void setQueryText.call(cssModel, query.styleSheetId, (query.range as TextUtils.TextRange.TextRange), newContent)
|
2494
|
-
.then(userCallback.bind(this));
|
2495
|
-
}
|
2496
2499
|
}
|
2497
2500
|
|
2498
2501
|
private editingMediaTextCommittedForTest(): void {
|
@@ -3389,13 +3392,8 @@ export class StylesSidebarPropertyRenderer {
|
|
3389
3392
|
// so that we don't have to keep two versions (original vs. trimmed) of URL
|
3390
3393
|
// at the same time, which complicates both StylesSidebarPane and StylePropertyTreeElement.
|
3391
3394
|
bypassURLTrimming: true,
|
3392
|
-
className: undefined,
|
3393
|
-
lineNumber: undefined,
|
3394
|
-
columnNumber: undefined,
|
3395
3395
|
showColumnNumber: false,
|
3396
3396
|
inlineFrameIndex: 0,
|
3397
|
-
maxLength: undefined,
|
3398
|
-
tabStop: undefined,
|
3399
3397
|
}),
|
3400
3398
|
hrefUrl || url);
|
3401
3399
|
container.appendChild(link);
|
@@ -256,7 +256,7 @@ export abstract class AffectedResourcesView extends UI.TreeOutline.TreeElement {
|
|
256
256
|
const linkifier = new Components.Linkifier.Linkifier(maxLengthForDisplayedURLs);
|
257
257
|
const sourceAnchor = linkifier.linkifyScriptLocation(
|
258
258
|
target || null, sourceLocation.scriptId || null, sourceLocation.url, sourceLocation.lineNumber,
|
259
|
-
{columnNumber: sourceLocation.columnNumber, inlineFrameIndex: 0
|
259
|
+
{columnNumber: sourceLocation.columnNumber, inlineFrameIndex: 0});
|
260
260
|
sourceCodeLocation.appendChild(sourceAnchor);
|
261
261
|
}
|
262
262
|
element.appendChild(sourceCodeLocation);
|
@@ -36,7 +36,7 @@ export class AffectedSourcesView extends AffectedResourcesView {
|
|
36
36
|
const cellElement = document.createElement('td');
|
37
37
|
// TODO(chromium:1072331): Check feasibility of plumping through scriptId for `linkifyScriptLocation`
|
38
38
|
// to support source maps and formatted scripts.
|
39
|
-
const linkifierURLOptions =
|
39
|
+
const linkifierURLOptions = {columnNumber, lineNumber, tabStop: true, showColumnNumber: false, inlineFrameIndex: 0};
|
40
40
|
// An element created with linkifyURL can subscribe to the events
|
41
41
|
// 'click' neither 'keydown' if that key is the 'Enter' key.
|
42
42
|
// Also, this element has a context menu, so we should be able to
|
@@ -127,11 +127,6 @@ export class LighthouseReportRenderer extends LighthouseReport.ReportRenderer {
|
|
127
127
|
showColumnNumber: false,
|
128
128
|
inlineFrameIndex: 0,
|
129
129
|
maxLength: MaxLengthForLinks,
|
130
|
-
bypassURLTrimming: undefined,
|
131
|
-
className: undefined,
|
132
|
-
preventClick: undefined,
|
133
|
-
tabStop: undefined,
|
134
|
-
text: undefined,
|
135
130
|
});
|
136
131
|
UI.Tooltip.Tooltip.install(origHTMLElement, '');
|
137
132
|
origHTMLElement.textContent = '';
|
@@ -1216,7 +1216,7 @@ export class NetworkRequestNode extends NetworkNode {
|
|
1216
1216
|
} else {
|
1217
1217
|
this.linkifiedInitiatorAnchor = linkifier.linkifyScriptLocation(
|
1218
1218
|
networkManager.target(), initiator.scriptId, initiator.url, initiator.lineNumber,
|
1219
|
-
{columnNumber: initiator.columnNumber, inlineFrameIndex: 0
|
1219
|
+
{columnNumber: initiator.columnNumber, inlineFrameIndex: 0});
|
1220
1220
|
}
|
1221
1221
|
UI.Tooltip.Tooltip.install((this.linkifiedInitiatorAnchor), '');
|
1222
1222
|
cell.appendChild(this.linkifiedInitiatorAnchor);
|
@@ -310,7 +310,7 @@ export class NodeFormatter implements Formatter {
|
|
310
310
|
linkifyNode(node: ProfileDataGridNode): Element|null {
|
311
311
|
const cpuProfilerModel = this.profileView.profileHeader.cpuProfilerModel;
|
312
312
|
const target = cpuProfilerModel ? cpuProfilerModel.target() : null;
|
313
|
-
const options = {className: 'profile-node-file',
|
313
|
+
const options = {className: 'profile-node-file', inlineFrameIndex: 0};
|
314
314
|
return this.profileView.linkifier().maybeLinkifyConsoleCallFrame(target, node.profileNode.callFrame, options);
|
315
315
|
}
|
316
316
|
}
|
@@ -620,9 +620,7 @@ export class NodeFormatter implements Formatter {
|
|
620
620
|
const target = heapProfilerModel ? heapProfilerModel.target() : null;
|
621
621
|
const options = {
|
622
622
|
className: 'profile-node-file',
|
623
|
-
columnNumber: undefined,
|
624
623
|
inlineFrameIndex: 0,
|
625
|
-
tabStop: undefined,
|
626
624
|
};
|
627
625
|
return this.profileView.linkifier().maybeLinkifyConsoleCallFrame(target, node.profileNode.callFrame, options);
|
628
626
|
}
|
@@ -1301,7 +1301,6 @@ export class AllocationGridNode extends HeapSnapshotGridNode {
|
|
1301
1301
|
columnNumber: allocationNode.column - 1,
|
1302
1302
|
inlineFrameIndex: 0,
|
1303
1303
|
className: 'profile-node-file',
|
1304
|
-
tabStop: undefined,
|
1305
1304
|
});
|
1306
1305
|
urlElement.style.maxWidth = '75%';
|
1307
1306
|
cell.insertBefore(urlElement, cell.firstChild);
|
@@ -1887,10 +1887,9 @@ export class HeapAllocationStackView extends UI.Widget.Widget {
|
|
1887
1887
|
continue;
|
1888
1888
|
}
|
1889
1889
|
const target = this.heapProfilerModel ? this.heapProfilerModel.target() : null;
|
1890
|
-
const options = {columnNumber: frame.column - 1};
|
1890
|
+
const options = {columnNumber: frame.column - 1, inlineFrameIndex: 0};
|
1891
1891
|
const urlElement = this.linkifier.linkifyScriptLocation(
|
1892
|
-
target, String(frame.scriptId) as Protocol.Runtime.ScriptId, frame.scriptName, frame.line - 1,
|
1893
|
-
(options as Components.Linkifier.LinkifyOptions));
|
1892
|
+
target, String(frame.scriptId) as Protocol.Runtime.ScriptId, frame.scriptName, frame.line - 1, options);
|
1894
1893
|
frameDiv.appendChild(urlElement);
|
1895
1894
|
stackFrameToURLElement.set(frameDiv, urlElement);
|
1896
1895
|
frameDiv.addEventListener('contextmenu', this.onContextMenu.bind(this, urlElement));
|
@@ -126,7 +126,7 @@ export class SnippetFileSystem extends Persistence.PlatformFileSystem.PlatformFi
|
|
126
126
|
return Common.ResourceType.resourceTypes.Script;
|
127
127
|
}
|
128
128
|
|
129
|
-
tooltipForURL(url:
|
129
|
+
tooltipForURL(url: Platform.DevToolsPath.UrlString): string {
|
130
130
|
return i18nString(UIStrings.linkedTo, {PH1: unescapeSnippetName(url.substring(this.path().length))});
|
131
131
|
}
|
132
132
|
|
@@ -36,6 +36,7 @@ import * as Root from '../../core/root/root.js';
|
|
36
36
|
import * as SDK from '../../core/sdk/sdk.js';
|
37
37
|
import * as Protocol from '../../generated/protocol.js';
|
38
38
|
import * as Bindings from '../../models/bindings/bindings.js';
|
39
|
+
import * as SourceMapScopes from '../../models/source_map_scopes/source_map_scopes.js';
|
39
40
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
40
41
|
import * as Workspace from '../../models/workspace/workspace.js';
|
41
42
|
import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
@@ -48,7 +49,6 @@ import {AddSourceMapURLDialog} from './AddSourceMapURLDialog.js';
|
|
48
49
|
import {BreakpointEditDialog, LogpointPrefix} from './BreakpointEditDialog.js';
|
49
50
|
import {Plugin} from './Plugin.js';
|
50
51
|
import {ScriptFormatterEditorAction} from './ScriptFormatterEditorAction.js';
|
51
|
-
import {resolveExpression, resolveScopeInObject} from './SourceMapNamesResolver.js';
|
52
52
|
import {SourcesPanel} from './SourcesPanel.js';
|
53
53
|
import {getRegisteredEditorActions} from './SourcesView.js';
|
54
54
|
|
@@ -476,7 +476,7 @@ export class DebuggerPlugin extends Plugin {
|
|
476
476
|
if (!url) {
|
477
477
|
return;
|
478
478
|
}
|
479
|
-
scriptFile.addSourceMapURL(url);
|
479
|
+
scriptFile.addSourceMapURL(url as Platform.DevToolsPath.UrlString);
|
480
480
|
}
|
481
481
|
|
482
482
|
if (this.uiSourceCode.project().type() === Workspace.Workspace.projectTypes.Network &&
|
@@ -650,7 +650,7 @@ export class DebuggerPlugin extends Plugin {
|
|
650
650
|
}|{
|
651
651
|
error: string,
|
652
652
|
}|null> {
|
653
|
-
const resolvedText = await resolveExpression(
|
653
|
+
const resolvedText = await SourceMapScopes.NamesResolver.resolveExpression(
|
654
654
|
selectedCallFrame, evaluationText, uiSourceCode, highlightLine.number - 1,
|
655
655
|
highlightRange.from - highlightLine.from, highlightRange.to - highlightLine.from);
|
656
656
|
return await selectedCallFrame.evaluate({
|
@@ -887,7 +887,8 @@ export class DebuggerPlugin extends Plugin {
|
|
887
887
|
return null;
|
888
888
|
}
|
889
889
|
|
890
|
-
const {properties} =
|
890
|
+
const {properties} =
|
891
|
+
await SourceMapScopes.NamesResolver.resolveScopeInObject(localScope).getAllProperties(false, false);
|
891
892
|
if (!properties || !properties.length || properties.length > 500) {
|
892
893
|
return null;
|
893
894
|
}
|
@@ -1364,7 +1364,7 @@ export class NavigatorUISourceCodeTreeNode extends NavigatorTreeNode {
|
|
1364
1364
|
this.treeElement.title = titleText;
|
1365
1365
|
this.treeElement.updateIcon();
|
1366
1366
|
|
1367
|
-
let tooltip = this.uiSourceCodeInternal.url();
|
1367
|
+
let tooltip: string = this.uiSourceCodeInternal.url();
|
1368
1368
|
if (this.uiSourceCodeInternal.contentType().isFromSourceMap()) {
|
1369
1369
|
tooltip = i18nString(UIStrings.sFromSourceMap, {PH1: this.uiSourceCodeInternal.displayName()});
|
1370
1370
|
}
|
@@ -34,13 +34,13 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
34
34
|
import * as SDK from '../../core/sdk/sdk.js';
|
35
35
|
import * as Protocol from '../../generated/protocol.js';
|
36
36
|
import * as Bindings from '../../models/bindings/bindings.js';
|
37
|
+
import * as SourceMapScopes from '../../models/source_map_scopes/source_map_scopes.js';
|
37
38
|
import * as LinearMemoryInspector from '../../ui/components/linear_memory_inspector/linear_memory_inspector.js';
|
38
39
|
import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
|
39
40
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
40
41
|
import * as UI from '../../ui/legacy/legacy.js';
|
41
42
|
|
42
43
|
import scopeChainSidebarPaneStyles from './scopeChainSidebarPane.css.js';
|
43
|
-
import {resolveScopeChain, resolveScopeInObject, resolveThisObject} from './SourceMapNamesResolver.js';
|
44
44
|
|
45
45
|
const UIStrings = {
|
46
46
|
/**
|
@@ -168,7 +168,10 @@ export class ScopeChainSidebarPane extends UI.Widget.VBox implements UI.ContextF
|
|
168
168
|
|
169
169
|
const callFrame = UI.Context.Context.instance().flavor(SDK.DebuggerModel.CallFrame);
|
170
170
|
this.setScopeSourceMapSubscription(callFrame);
|
171
|
-
const [thisObject, scopeChain] = await Promise.all([
|
171
|
+
const [thisObject, scopeChain] = await Promise.all([
|
172
|
+
SourceMapScopes.NamesResolver.resolveThisObject(callFrame),
|
173
|
+
SourceMapScopes.NamesResolver.resolveScopeChain(callFrame),
|
174
|
+
]);
|
172
175
|
// By now the developer might have moved on, and we don't want to show stale
|
173
176
|
// scope information, so check again that we're still on the same CallFrame.
|
174
177
|
if (callFrame === UI.Context.Context.instance().flavor(SDK.DebuggerModel.CallFrame)) {
|
@@ -243,7 +246,7 @@ export class ScopeChainSidebarPane extends UI.Widget.VBox implements UI.ContextF
|
|
243
246
|
titleElement.createChild('div', 'scope-chain-sidebar-pane-section-title').textContent = title;
|
244
247
|
|
245
248
|
const section = new ObjectUI.ObjectPropertiesSection.RootElement(
|
246
|
-
resolveScopeInObject(scope), this.linkifier, emptyPlaceholder,
|
249
|
+
SourceMapScopes.NamesResolver.resolveScopeInObject(scope), this.linkifier, emptyPlaceholder,
|
247
250
|
ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.All, extraProperties);
|
248
251
|
section.title = titleElement;
|
249
252
|
section.listItemElement.classList.add('scope-chain-sidebar-pane-section');
|
@@ -33,6 +33,7 @@ import * as Host from '../../core/host/host.js';
|
|
33
33
|
import * as i18n from '../../core/i18n/i18n.js';
|
34
34
|
import * as SDK from '../../core/sdk/sdk.js';
|
35
35
|
import * as Persistence from '../../models/persistence/persistence.js';
|
36
|
+
import type * as Platform from '../../core/platform/platform.js';
|
36
37
|
import * as Workspace from '../../models/workspace/workspace.js';
|
37
38
|
import * as UI from '../../ui/legacy/legacy.js';
|
38
39
|
import * as Snippets from '../snippets/snippets.js';
|
@@ -378,9 +379,14 @@ export class SnippetsNavigatorView extends NavigatorView {
|
|
378
379
|
private async handleSaveAs(uiSourceCode: Workspace.UISourceCode.UISourceCode): Promise<void> {
|
379
380
|
uiSourceCode.commitWorkingCopy();
|
380
381
|
const {content} = await uiSourceCode.requestContent();
|
381
|
-
void Workspace.FileManager.FileManager.instance().save(
|
382
|
+
void Workspace.FileManager.FileManager.instance().save(
|
383
|
+
this.addJSExtension(uiSourceCode.url()), content || '', true);
|
382
384
|
Workspace.FileManager.FileManager.instance().close(uiSourceCode.url());
|
383
385
|
}
|
386
|
+
|
387
|
+
private addJSExtension(url: Platform.DevToolsPath.UrlString): Platform.DevToolsPath.UrlString {
|
388
|
+
return Common.ParsedURL.ParsedURL.concatenate(url, '.js');
|
389
|
+
}
|
384
390
|
}
|
385
391
|
|
386
392
|
let actionDelegateInstance: ActionDelegate;
|
@@ -4,6 +4,8 @@
|
|
4
4
|
|
5
5
|
// @ts-nocheck
|
6
6
|
|
7
|
+
import * as SourceMapScopesModule from '../../models/source_map_scopes/source_map_scopes.js';
|
8
|
+
|
7
9
|
import * as SourcesModule from './sources.js';
|
8
10
|
|
9
11
|
self.Sources = self.Sources || {};
|
@@ -141,11 +143,11 @@ Sources.SourceMapNamesResolver = {};
|
|
141
143
|
|
142
144
|
// Tests can override this global symbol and therefore can't be exported
|
143
145
|
Object.defineProperty(Sources.SourceMapNamesResolver, '_scopeResolvedForTest', {
|
144
|
-
get:
|
145
|
-
set:
|
146
|
+
get: SourceMapScopesModule.NamesResolver.getScopeResolvedForTest,
|
147
|
+
set: SourceMapScopesModule.NamesResolver.setScopeResolvedForTest,
|
146
148
|
});
|
147
149
|
|
148
|
-
Sources.SourceMapNamesResolver.resolveExpression =
|
150
|
+
Sources.SourceMapNamesResolver.resolveExpression = SourceMapScopesModule.NamesResolver.resolveExpression;
|
149
151
|
|
150
152
|
/** @constructor */
|
151
153
|
Sources.NetworkNavigatorView = SourcesModule.SourcesNavigator.NetworkNavigatorView;
|
@@ -24,7 +24,6 @@ import * as ScriptFormatterEditorAction from './ScriptFormatterEditorAction.js';
|
|
24
24
|
import * as ScriptOriginPlugin from './ScriptOriginPlugin.js';
|
25
25
|
import * as SearchSourcesView from './SearchSourcesView.js';
|
26
26
|
import * as SnippetsPlugin from './SnippetsPlugin.js';
|
27
|
-
import * as SourceMapNamesResolver from './SourceMapNamesResolver.js';
|
28
27
|
import * as SourcesNavigator from './SourcesNavigator.js';
|
29
28
|
import * as SourcesPanel from './SourcesPanel.js';
|
30
29
|
import * as SourcesSearchScope from './SourcesSearchScope.js';
|
@@ -57,7 +56,6 @@ export {
|
|
57
56
|
ScriptOriginPlugin,
|
58
57
|
SearchSourcesView,
|
59
58
|
SnippetsPlugin,
|
60
|
-
SourceMapNamesResolver,
|
61
59
|
SourcesNavigator,
|
62
60
|
SourcesPanel,
|
63
61
|
SourcesSearchScope,
|
@@ -1871,15 +1871,8 @@ export class TimelineUIUtils {
|
|
1871
1871
|
if (url) {
|
1872
1872
|
const options = {
|
1873
1873
|
tabStop: true,
|
1874
|
-
className: undefined,
|
1875
|
-
columnNumber: undefined,
|
1876
1874
|
showColumnNumber: false,
|
1877
1875
|
inlineFrameIndex: 0,
|
1878
|
-
text: undefined,
|
1879
|
-
lineNumber: undefined,
|
1880
|
-
preventClick: undefined,
|
1881
|
-
maxLength: undefined,
|
1882
|
-
bypassURLTrimming: undefined,
|
1883
1876
|
};
|
1884
1877
|
details = Components.Linkifier.Linkifier.linkifyURL(url, options);
|
1885
1878
|
}
|
@@ -2126,15 +2119,8 @@ export class TimelineUIUtils {
|
|
2126
2119
|
if (url) {
|
2127
2120
|
const options = {
|
2128
2121
|
tabStop: true,
|
2129
|
-
className: undefined,
|
2130
|
-
columnNumber: undefined,
|
2131
2122
|
showColumnNumber: false,
|
2132
2123
|
inlineFrameIndex: 0,
|
2133
|
-
lineNumber: undefined,
|
2134
|
-
text: undefined,
|
2135
|
-
preventClick: undefined,
|
2136
|
-
maxLength: undefined,
|
2137
|
-
bypassURLTrimming: undefined,
|
2138
2124
|
};
|
2139
2125
|
contentHelper.appendElementRow(
|
2140
2126
|
i18nString(UIStrings.resource), Components.Linkifier.Linkifier.linkifyURL(url, options));
|
@@ -2264,15 +2250,8 @@ export class TimelineUIUtils {
|
|
2264
2250
|
if (url) {
|
2265
2251
|
const options = {
|
2266
2252
|
tabStop: true,
|
2267
|
-
className: undefined,
|
2268
|
-
columnNumber: undefined,
|
2269
2253
|
showColumnNumber: false,
|
2270
|
-
lineNumber: undefined,
|
2271
2254
|
inlineFrameIndex: 0,
|
2272
|
-
text: undefined,
|
2273
|
-
preventClick: undefined,
|
2274
|
-
maxLength: undefined,
|
2275
|
-
bypassURLTrimming: undefined,
|
2276
2255
|
};
|
2277
2256
|
contentHelper.appendElementRow(
|
2278
2257
|
i18nString(UIStrings.imageUrl), Components.Linkifier.Linkifier.linkifyURL(url, options));
|
@@ -2285,15 +2264,8 @@ export class TimelineUIUtils {
|
|
2285
2264
|
if (url) {
|
2286
2265
|
const options = {
|
2287
2266
|
tabStop: true,
|
2288
|
-
className: undefined,
|
2289
|
-
columnNumber: undefined,
|
2290
2267
|
showColumnNumber: false,
|
2291
2268
|
inlineFrameIndex: 0,
|
2292
|
-
lineNumber: undefined,
|
2293
|
-
text: undefined,
|
2294
|
-
preventClick: undefined,
|
2295
|
-
maxLength: undefined,
|
2296
|
-
bypassURLTrimming: undefined,
|
2297
2269
|
};
|
2298
2270
|
contentHelper.appendElementRow(
|
2299
2271
|
i18nString(UIStrings.stylesheetUrl), Components.Linkifier.Linkifier.linkifyURL(url, options));
|
@@ -2641,15 +2613,8 @@ export class TimelineUIUtils {
|
|
2641
2613
|
if (request.url) {
|
2642
2614
|
const options = {
|
2643
2615
|
tabStop: true,
|
2644
|
-
className: undefined,
|
2645
|
-
columnNumber: undefined,
|
2646
2616
|
showColumnNumber: false,
|
2647
|
-
text: undefined,
|
2648
2617
|
inlineFrameIndex: 0,
|
2649
|
-
lineNumber: undefined,
|
2650
|
-
preventClick: undefined,
|
2651
|
-
maxLength: undefined,
|
2652
|
-
bypassURLTrimming: undefined,
|
2653
2618
|
};
|
2654
2619
|
contentHelper.appendElementRow(
|
2655
2620
|
i18n.i18n.lockedString('URL'), Components.Linkifier.Linkifier.linkifyURL(request.url, options));
|
@@ -2711,7 +2676,7 @@ export class TimelineUIUtils {
|
|
2711
2676
|
const topFrame = TimelineModel.TimelineModel.TimelineData.forEvent(sendRequest).topFrame();
|
2712
2677
|
if (topFrame) {
|
2713
2678
|
const link = linkifier.maybeLinkifyConsoleCallFrame(
|
2714
|
-
target, topFrame, {tabStop: true,
|
2679
|
+
target, topFrame, {tabStop: true, inlineFrameIndex: 0, showColumnNumber: true});
|
2715
2680
|
if (link) {
|
2716
2681
|
contentHelper.appendElementRow(title, link);
|
2717
2682
|
}
|
@@ -2720,9 +2685,8 @@ export class TimelineUIUtils {
|
|
2720
2685
|
if (initiator) {
|
2721
2686
|
const initiatorURL = TimelineModel.TimelineModel.TimelineData.forEvent(initiator).url;
|
2722
2687
|
if (initiatorURL) {
|
2723
|
-
const link =
|
2724
|
-
target, null, initiatorURL, 0,
|
2725
|
-
{tabStop: true, className: undefined, inlineFrameIndex: 0, columnNumber: undefined});
|
2688
|
+
const link =
|
2689
|
+
linkifier.maybeLinkifyScriptLocation(target, null, initiatorURL, 0, {tabStop: true, inlineFrameIndex: 0});
|
2726
2690
|
if (link) {
|
2727
2691
|
contentHelper.appendElementRow(title, link);
|
2728
2692
|
}
|
@@ -3714,15 +3678,9 @@ export class TimelineDetailsContentHelper {
|
|
3714
3678
|
|
3715
3679
|
const options = {
|
3716
3680
|
tabStop: true,
|
3717
|
-
className: undefined,
|
3718
3681
|
columnNumber: startColumn,
|
3719
3682
|
showColumnNumber: true,
|
3720
3683
|
inlineFrameIndex: 0,
|
3721
|
-
text: undefined,
|
3722
|
-
lineNumber: undefined,
|
3723
|
-
preventClick: undefined,
|
3724
|
-
maxLength: undefined,
|
3725
|
-
bypassURLTrimming: undefined,
|
3726
3684
|
};
|
3727
3685
|
const link = this.linkifierInternal.maybeLinkifyScriptLocation(this.target, null, url, startLine, options);
|
3728
3686
|
if (!link) {
|
@@ -3737,8 +3695,7 @@ export class TimelineDetailsContentHelper {
|
|
3737
3695
|
}
|
3738
3696
|
const locationContent = document.createElement('span');
|
3739
3697
|
const link = this.linkifierInternal.maybeLinkifyScriptLocation(
|
3740
|
-
this.target, null, url, startLine,
|
3741
|
-
{tabStop: true, className: undefined, inlineFrameIndex: 0, columnNumber: undefined});
|
3698
|
+
this.target, null, url, startLine, {tabStop: true, inlineFrameIndex: 0});
|
3742
3699
|
if (!link) {
|
3743
3700
|
return;
|
3744
3701
|
}
|
@@ -423,7 +423,7 @@ export class _ExpandableContainerWidget extends VBox {
|
|
423
423
|
|
424
424
|
this.titleElement = document.createElement('div');
|
425
425
|
this.titleElement.classList.add('expandable-view-title');
|
426
|
-
ARIAUtils.
|
426
|
+
ARIAUtils.markAsTab(this.titleElement);
|
427
427
|
this.titleExpandIcon = Icon.create('smallicon-triangle-right', 'title-expand-icon');
|
428
428
|
this.titleElement.appendChild(this.titleExpandIcon);
|
429
429
|
const titleText = view.title();
|
@@ -847,6 +847,7 @@ class _StackLocation extends Location implements ViewLocation {
|
|
847
847
|
const vbox = new VBox();
|
848
848
|
super(manager, vbox, revealCallback);
|
849
849
|
this.vbox = vbox;
|
850
|
+
ARIAUtils.markAsTablist(vbox.element);
|
850
851
|
|
851
852
|
this.expandableContainers = new Map();
|
852
853
|
|
@@ -51,7 +51,7 @@ const UIStrings = {
|
|
51
51
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/source_frame/FontView.ts', UIStrings);
|
52
52
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
53
53
|
export class FontView extends UI.View.SimpleView {
|
54
|
-
private readonly url:
|
54
|
+
private readonly url: Platform.DevToolsPath.UrlString;
|
55
55
|
private readonly mimeType: string;
|
56
56
|
private readonly contentProvider: TextUtils.ContentProvider.ContentProvider;
|
57
57
|
private readonly mimeTypeLabel: UI.Toolbar.ToolbarText;
|
@@ -84,7 +84,7 @@ const UIStrings = {
|
|
84
84
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/source_frame/ImageView.ts', UIStrings);
|
85
85
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
86
86
|
export class ImageView extends UI.View.SimpleView {
|
87
|
-
private url:
|
87
|
+
private url: Platform.DevToolsPath.UrlString;
|
88
88
|
private parsedURL: Common.ParsedURL.ParsedURL;
|
89
89
|
private readonly mimeType: string;
|
90
90
|
private readonly contentProvider: TextUtils.ContentProvider.ContentProvider;
|