chrome-devtools-frontend 1.0.970539 → 1.0.972865
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 +12 -7
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/Images/src/ic_changes.svg +5 -0
- package/front_end/core/common/ParsedURL.ts +11 -5
- package/front_end/core/host/UserMetrics.ts +4 -1
- package/front_end/core/i18n/locales/en-US.json +45 -0
- package/front_end/core/i18n/locales/en-XL.json +45 -0
- package/front_end/core/platform/UserVisibleError.ts +28 -0
- package/front_end/core/platform/platform.ts +2 -0
- package/front_end/core/sdk/CSSModel.ts +21 -0
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +10 -10
- package/front_end/core/sdk/ChildTargetManager.ts +0 -1
- 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 +32 -10
- package/front_end/core/sdk/NetworkRequest.ts +29 -16
- package/front_end/core/sdk/Resource.ts +10 -10
- package/front_end/core/sdk/ResourceTreeModel.ts +16 -13
- package/front_end/core/sdk/Script.ts +10 -10
- package/front_end/core/sdk/SourceMap.ts +8 -6
- package/front_end/entrypoints/lighthouse_worker/LighthouseService.ts +35 -12
- package/front_end/entrypoints/main/MainImpl.ts +8 -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/CSSWorkspaceBinding.ts +10 -3
- 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/SASSSourceMapping.ts +4 -3
- package/front_end/models/bindings/StylesSourceMapping.ts +2 -1
- package/front_end/models/har/HARFormat.ts +4 -2
- package/front_end/models/har/Importer.ts +0 -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/Automapping.ts +1 -1
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +7 -7
- package/front_end/models/persistence/IsolatedFileSystem.ts +10 -13
- 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 +7 -5
- package/front_end/models/workspace/UISourceCode.ts +7 -7
- package/front_end/models/workspace/WorkspaceImpl.ts +1 -3
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +20 -8
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +3 -2
- package/front_end/panels/browser_debugger/categorizedBreakpointsSidebarPane.css +0 -1
- package/front_end/panels/changes/ChangesView.ts +4 -4
- 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/ElementsPanel.ts +25 -11
- package/front_end/panels/elements/ElementsTreeElement.ts +0 -6
- package/front_end/panels/elements/StylesSidebarPane.ts +236 -51
- package/front_end/panels/elements/elementsTreeOutline.css +0 -1
- package/front_end/panels/issues/AffectedResourcesView.ts +1 -1
- package/front_end/panels/issues/AffectedSourcesView.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +41 -0
- package/front_end/panels/lighthouse/LighthousePanel.ts +64 -9
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +32 -4
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +0 -5
- package/front_end/panels/lighthouse/LighthouseStartView.ts +8 -4
- package/front_end/panels/lighthouse/LighthouseStartViewFR.ts +100 -0
- package/front_end/panels/lighthouse/LighthouseTimespanView.ts +99 -0
- 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/sensors/sensors.css +0 -1
- 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 +14 -10
- 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 -16
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/panels/sources/sourcesView.css +0 -4
- package/front_end/panels/timeline/TimelineUIUtils.ts +4 -47
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/json.js +2 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +3 -1
- package/front_end/third_party/codemirror.next/package.json +9 -9
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1047 -1158
- package/front_end/third_party/lighthouse/locales/en-US.json +7 -1
- package/front_end/third_party/lighthouse/locales/en-XL.json +7 -1
- package/front_end/third_party/lighthouse/report/bundle.d.ts +0 -3
- package/front_end/third_party/lighthouse/report/bundle.js +38 -24
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
- package/front_end/ui/legacy/ViewManager.ts +2 -1
- package/front_end/ui/legacy/closeButton.css +0 -1
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +7 -4
- 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/front_end/ui/legacy/tabbedPane.css +0 -2
- package/front_end/ui/legacy/toolbar.css +28 -3
- package/package.json +1 -1
- package/scripts/hosted_mode/server.js +13 -0
- package/scripts/npm_test.js +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
@@ -10,6 +10,12 @@ import type * as ReportRenderer from './LighthouseReporterTypes.js';
|
|
10
10
|
|
11
11
|
let lastId = 1;
|
12
12
|
|
13
|
+
export interface LighthouseRun {
|
14
|
+
inspectedURL: string;
|
15
|
+
categoryIDs: string[];
|
16
|
+
flags: Record<string, Object|undefined>;
|
17
|
+
}
|
18
|
+
|
13
19
|
export class ProtocolService {
|
14
20
|
private targetInfo?: {
|
15
21
|
mainSessionId: string,
|
@@ -58,14 +64,36 @@ export class ProtocolService {
|
|
58
64
|
return [i18n.DevToolsLocale.DevToolsLocale.instance().locale];
|
59
65
|
}
|
60
66
|
|
61
|
-
async
|
62
|
-
|
67
|
+
async startTimespan(currentLighthouseRun: LighthouseRun): Promise<void> {
|
68
|
+
const {inspectedURL, categoryIDs, flags} = currentLighthouseRun;
|
69
|
+
|
63
70
|
if (!this.targetInfo) {
|
64
71
|
throw new Error('Unable to get target info required for Lighthouse');
|
65
72
|
}
|
66
|
-
|
73
|
+
|
74
|
+
await this.sendWithResponse('startTimespan', {
|
75
|
+
url: inspectedURL,
|
76
|
+
categoryIDs,
|
77
|
+
flags,
|
78
|
+
locales: this.getLocales(),
|
79
|
+
target: this.targetInfo,
|
80
|
+
});
|
81
|
+
}
|
82
|
+
|
83
|
+
async collectLighthouseResults(currentLighthouseRun: LighthouseRun): Promise<ReportRenderer.RunnerResult> {
|
84
|
+
const {inspectedURL, categoryIDs, flags} = currentLighthouseRun;
|
85
|
+
|
86
|
+
if (!this.targetInfo) {
|
87
|
+
throw new Error('Unable to get target info required for Lighthouse');
|
88
|
+
}
|
89
|
+
|
90
|
+
let mode = flags.mode as string;
|
91
|
+
if (mode === 'timespan') {
|
92
|
+
mode = 'endTimespan';
|
93
|
+
}
|
94
|
+
|
67
95
|
return this.sendWithResponse(mode, {
|
68
|
-
url:
|
96
|
+
url: inspectedURL,
|
69
97
|
categoryIDs,
|
70
98
|
flags,
|
71
99
|
locales: this.getLocales(),
|
@@ -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 = '';
|
@@ -41,9 +41,9 @@ const UIStrings = {
|
|
41
41
|
const str_ = i18n.i18n.registerUIStrings('panels/lighthouse/LighthouseStartView.ts', UIStrings);
|
42
42
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
43
43
|
export class StartView extends UI.Widget.Widget {
|
44
|
-
|
44
|
+
protected controller: LighthouseController;
|
45
45
|
private readonly settingsToolbarInternal: UI.Toolbar.Toolbar;
|
46
|
-
|
46
|
+
protected startButton!: HTMLButtonElement;
|
47
47
|
private helpText?: Element;
|
48
48
|
private warningText?: Element;
|
49
49
|
private shouldConfirm?: boolean;
|
@@ -60,7 +60,7 @@ export class StartView extends UI.Widget.Widget {
|
|
60
60
|
return this.settingsToolbarInternal;
|
61
61
|
}
|
62
62
|
|
63
|
-
|
63
|
+
protected populateRuntimeSettingAsRadio(settingName: string, label: string, parentElement: Element): void {
|
64
64
|
const runtimeSetting = RuntimeSettings.find(item => item.setting.name === settingName);
|
65
65
|
if (!runtimeSetting || !runtimeSetting.options) {
|
66
66
|
throw new Error(`${settingName} is not a setting with options`);
|
@@ -112,7 +112,7 @@ export class StartView extends UI.Widget.Widget {
|
|
112
112
|
UI.ARIAUtils.setAccessibleName(pluginFormElements, i18nString(UIStrings.communityPluginsBeta));
|
113
113
|
}
|
114
114
|
|
115
|
-
|
115
|
+
protected render(): void {
|
116
116
|
this.populateRuntimeSettingAsToolbarCheckbox('lighthouse.legacy_navigation', this.settingsToolbarInternal);
|
117
117
|
this.populateRuntimeSettingAsToolbarCheckbox('lighthouse.clear_storage', this.settingsToolbarInternal);
|
118
118
|
this.populateRuntimeSettingAsToolbarCheckbox('lighthouse.throttling', this.settingsToolbarInternal);
|
@@ -173,6 +173,10 @@ export class StartView extends UI.Widget.Widget {
|
|
173
173
|
this.contentElement.style.overflow = 'auto';
|
174
174
|
}
|
175
175
|
|
176
|
+
updateStartButton(): void {
|
177
|
+
// Do nothing in default case.
|
178
|
+
}
|
179
|
+
|
176
180
|
onResize(): void {
|
177
181
|
const useNarrowLayout = this.contentElement.offsetWidth < 560;
|
178
182
|
const startViewEl = this.contentElement.querySelector('.lighthouse-start-view');
|
@@ -0,0 +1,100 @@
|
|
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 i18n from '../../core/i18n/i18n.js';
|
6
|
+
import * as UI from '../../ui/legacy/legacy.js';
|
7
|
+
import type * as Platform from '../../core/platform/platform.js';
|
8
|
+
|
9
|
+
import {StartView} from './LighthouseStartView.js';
|
10
|
+
import {Events} from './LighthouseController.js';
|
11
|
+
|
12
|
+
const UIStrings = {
|
13
|
+
/**
|
14
|
+
* @description Text that refers to the Lighthouse mode
|
15
|
+
*/
|
16
|
+
mode: 'Mode',
|
17
|
+
/**
|
18
|
+
* @description Label for a button to start analyzing a page navigation with Lighthouse
|
19
|
+
*/
|
20
|
+
analyzeNavigation: 'Analyze navigation',
|
21
|
+
/**
|
22
|
+
* @description Label for a button to start analyzing the current page state with Lighthouse
|
23
|
+
*/
|
24
|
+
analyzeSnapshot: 'Analyze snapshot',
|
25
|
+
/**
|
26
|
+
* @description Label for a button that ends a Lighthouse timespan
|
27
|
+
*/
|
28
|
+
startTimespan: 'Start timespan',
|
29
|
+
};
|
30
|
+
|
31
|
+
const str_ = i18n.i18n.registerUIStrings('panels/lighthouse/LighthouseStartViewFR.ts', UIStrings);
|
32
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
33
|
+
|
34
|
+
export class StartViewFR extends StartView {
|
35
|
+
protected render(): void {
|
36
|
+
super.render();
|
37
|
+
const fragment = UI.Fragment.Fragment.build`
|
38
|
+
<div class="lighthouse-form-section">
|
39
|
+
<div class="lighthouse-form-section-label">
|
40
|
+
${i18nString(UIStrings.mode)}
|
41
|
+
</div>
|
42
|
+
<div class="lighthouse-form-elements" $="mode-form-elements"></div>
|
43
|
+
</div>
|
44
|
+
`;
|
45
|
+
|
46
|
+
// Populate the Lighthouse mode
|
47
|
+
const modeFormElements = fragment.$('mode-form-elements');
|
48
|
+
this.populateRuntimeSettingAsRadio('lighthouse.mode', i18nString(UIStrings.mode), modeFormElements);
|
49
|
+
|
50
|
+
const form = this.contentElement.querySelector('form');
|
51
|
+
form?.appendChild(fragment.element());
|
52
|
+
this.updateStartButton();
|
53
|
+
}
|
54
|
+
|
55
|
+
updateStartButton(): void {
|
56
|
+
const {mode} = this.controller.getFlags();
|
57
|
+
|
58
|
+
let label: Platform.UIString.LocalizedString;
|
59
|
+
let callback: () => void;
|
60
|
+
|
61
|
+
if (mode === 'timespan') {
|
62
|
+
label = i18nString(UIStrings.startTimespan);
|
63
|
+
callback = (): void => {
|
64
|
+
this.controller.dispatchEventToListeners(
|
65
|
+
Events.RequestLighthouseTimespanStart,
|
66
|
+
/* keyboardInitiated */ this.startButton.matches(':focus-visible'),
|
67
|
+
);
|
68
|
+
};
|
69
|
+
} else if (mode === 'snapshot') {
|
70
|
+
label = i18nString(UIStrings.analyzeSnapshot);
|
71
|
+
callback = (): void => {
|
72
|
+
this.controller.dispatchEventToListeners(
|
73
|
+
Events.RequestLighthouseStart,
|
74
|
+
/* keyboardInitiated */ this.startButton.matches(':focus-visible'),
|
75
|
+
);
|
76
|
+
};
|
77
|
+
} else {
|
78
|
+
label = i18nString(UIStrings.analyzeNavigation);
|
79
|
+
callback = (): void => {
|
80
|
+
this.controller.dispatchEventToListeners(
|
81
|
+
Events.RequestLighthouseStart,
|
82
|
+
/* keyboardInitiated */ this.startButton.matches(':focus-visible'),
|
83
|
+
);
|
84
|
+
};
|
85
|
+
}
|
86
|
+
|
87
|
+
this.startButton = UI.UIUtils.createTextButton(
|
88
|
+
label,
|
89
|
+
callback,
|
90
|
+
/* className */ '',
|
91
|
+
/* primary */ true,
|
92
|
+
);
|
93
|
+
|
94
|
+
const startButtonContainer = this.contentElement.querySelector('.lighthouse-start-button-container');
|
95
|
+
if (startButtonContainer) {
|
96
|
+
startButtonContainer.textContent = '';
|
97
|
+
startButtonContainer.appendChild(this.startButton);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
@@ -0,0 +1,99 @@
|
|
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 i18n from '../../core/i18n/i18n.js';
|
6
|
+
import * as UI from '../../ui/legacy/legacy.js';
|
7
|
+
|
8
|
+
import type {LighthouseController} from './LighthouseController.js';
|
9
|
+
import {Events} from './LighthouseController.js';
|
10
|
+
import lighthouseDialogStyles from './lighthouseDialog.css.js';
|
11
|
+
|
12
|
+
const UIStrings = {
|
13
|
+
/**
|
14
|
+
* @description Header indicating that a Lighthouse timespan is starting.
|
15
|
+
*/
|
16
|
+
timespanStarting: 'Timespan starting…',
|
17
|
+
/**
|
18
|
+
* @description Header indicating that a Lighthouse timespan has started.
|
19
|
+
*/
|
20
|
+
timespanStarted: 'Timespan started, interact with the page',
|
21
|
+
/**
|
22
|
+
* @description Label for a button that ends a Lighthouse timespan.
|
23
|
+
*/
|
24
|
+
endTimespan: 'End timespan',
|
25
|
+
/**
|
26
|
+
* @description Label for a button that cancels a Lighthouse timespan.
|
27
|
+
*/
|
28
|
+
cancel: 'Cancel',
|
29
|
+
};
|
30
|
+
|
31
|
+
const str_ = i18n.i18n.registerUIStrings('panels/lighthouse/LighthouseTimespanView.ts', UIStrings);
|
32
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
33
|
+
|
34
|
+
export class TimespanView extends UI.Dialog.Dialog {
|
35
|
+
private controller: LighthouseController;
|
36
|
+
private statusHeader: Element|null;
|
37
|
+
private endButton: HTMLButtonElement|null;
|
38
|
+
|
39
|
+
constructor(controller: LighthouseController) {
|
40
|
+
super();
|
41
|
+
this.controller = controller;
|
42
|
+
this.statusHeader = null;
|
43
|
+
this.endButton = null;
|
44
|
+
this.setDimmed(true);
|
45
|
+
this.setCloseOnEscape(false);
|
46
|
+
this.setOutsideClickCallback(event => event.consume(true));
|
47
|
+
this.render();
|
48
|
+
}
|
49
|
+
|
50
|
+
show(dialogRenderElement: Element): void {
|
51
|
+
this.reset();
|
52
|
+
super.show(dialogRenderElement);
|
53
|
+
}
|
54
|
+
|
55
|
+
reset(): void {
|
56
|
+
if (this.statusHeader && this.endButton) {
|
57
|
+
this.statusHeader.textContent = i18nString(UIStrings.timespanStarting);
|
58
|
+
this.endButton.disabled = true;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
ready(): void {
|
63
|
+
if (this.statusHeader && this.endButton) {
|
64
|
+
this.statusHeader.textContent = i18nString(UIStrings.timespanStarted);
|
65
|
+
this.endButton.disabled = false;
|
66
|
+
this.endButton.focus();
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
render(): void {
|
71
|
+
const dialogRoot = UI.Utils.createShadowRootWithCoreStyles(
|
72
|
+
this.contentElement, {cssFile: [lighthouseDialogStyles], delegatesFocus: undefined});
|
73
|
+
|
74
|
+
this.endButton = UI.UIUtils.createTextButton(i18nString(UIStrings.endTimespan), this.endTimespan.bind(this));
|
75
|
+
const cancelButton = UI.UIUtils.createTextButton(i18nString(UIStrings.cancel), this.cancel.bind(this));
|
76
|
+
const fragment = UI.Fragment.Fragment.build`
|
77
|
+
<div class="lighthouse-view vbox">
|
78
|
+
<h2 $="status-header"></h2>
|
79
|
+
${this.endButton}
|
80
|
+
${cancelButton}
|
81
|
+
</div>
|
82
|
+
`;
|
83
|
+
|
84
|
+
this.statusHeader = fragment.$('status-header');
|
85
|
+
dialogRoot.appendChild(fragment.element());
|
86
|
+
|
87
|
+
this.setSizeBehavior(UI.GlassPane.SizeBehavior.SetExactWidthMaxHeight);
|
88
|
+
this.setMaxContentSize(new UI.Geometry.Size(500, 400));
|
89
|
+
this.reset();
|
90
|
+
}
|
91
|
+
|
92
|
+
private endTimespan(): void {
|
93
|
+
this.controller.dispatchEventToListeners(Events.RequestLighthouseTimespanEnd, false);
|
94
|
+
}
|
95
|
+
|
96
|
+
private cancel(): void {
|
97
|
+
this.controller.dispatchEventToListeners(Events.RequestLighthouseCancel);
|
98
|
+
}
|
99
|
+
}
|
@@ -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
|
}
|
@@ -400,7 +400,9 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
400
400
|
|
401
401
|
const removedFrame = (event.data.frame as SDK.ResourceTreeModel.ResourceTreeFrame | null);
|
402
402
|
const node = Array.from(this.uiSourceCodeNodes.get(uiSourceCode)).find(node => node.frame() === removedFrame);
|
403
|
-
|
403
|
+
if (node) {
|
404
|
+
this.removeUISourceCodeNode(node);
|
405
|
+
}
|
404
406
|
}
|
405
407
|
|
406
408
|
private acceptsUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): boolean {
|
@@ -428,9 +430,12 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
428
430
|
const isFromSourceMap = uiSourceCode.contentType().isFromSourceMap();
|
429
431
|
let path;
|
430
432
|
if (uiSourceCode.project().type() === Workspace.Workspace.projectTypes.FileSystem) {
|
431
|
-
path =
|
433
|
+
path =
|
434
|
+
Persistence.FileSystemWorkspaceBinding.FileSystemWorkspaceBinding.relativePath(uiSourceCode).slice(0, -1) as
|
435
|
+
Platform.DevToolsPath.EncodedPathString[];
|
432
436
|
} else {
|
433
|
-
path = Common.ParsedURL.ParsedURL.extractPath(uiSourceCode.url()).split('/').slice(1, -1)
|
437
|
+
path = Common.ParsedURL.ParsedURL.extractPath(uiSourceCode.url()).split('/').slice(1, -1) as
|
438
|
+
Platform.DevToolsPath.EncodedPathString[];
|
434
439
|
}
|
435
440
|
|
436
441
|
const project = uiSourceCode.project();
|
@@ -503,7 +508,8 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
503
508
|
const commonPrefix = reversedIndex.longestPrefix(reversedPath, false /* fullWordOnly */);
|
504
509
|
reversedIndex.add(reversedPath);
|
505
510
|
const prefixPath = reversedPath.substring(0, commonPrefix.length + 1);
|
506
|
-
const path =
|
511
|
+
const path = Common.ParsedURL.ParsedURL.encodedPathToRawPathString(
|
512
|
+
encoder.decode(Platform.StringUtilities.reverse(prefixPath)) as Platform.DevToolsPath.EncodedPathString);
|
507
513
|
|
508
514
|
const fileSystemNode = this.rootNode.child(project.id());
|
509
515
|
if (fileSystemNode) {
|
@@ -539,7 +545,7 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
539
545
|
private folderNode(
|
540
546
|
uiSourceCode: Workspace.UISourceCode.UISourceCode, project: Workspace.Workspace.Project,
|
541
547
|
target: SDK.Target.Target|null, frame: SDK.ResourceTreeModel.ResourceTreeFrame|null, projectOrigin: string,
|
542
|
-
path:
|
548
|
+
path: Platform.DevToolsPath.EncodedPathString[], fromSourceMap: boolean): NavigatorTreeNode {
|
543
549
|
if (Snippets.ScriptSnippetFileSystem.isSnippetsUISourceCode(uiSourceCode)) {
|
544
550
|
return this.rootNode;
|
545
551
|
}
|
@@ -568,7 +574,7 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
568
574
|
if (project.type() === Workspace.Workspace.projectTypes.FileSystem) {
|
569
575
|
type = Types.FileSystemFolder;
|
570
576
|
}
|
571
|
-
const name = path[path.length - 1];
|
577
|
+
const name = Common.ParsedURL.ParsedURL.encodedPathToRawPathString(path[path.length - 1]);
|
572
578
|
|
573
579
|
folderNode = new NavigatorFolderTreeNode(this, project, folderId, type, folderPath, name);
|
574
580
|
this.subfolderNodes.set(folderId, folderNode);
|
@@ -848,10 +854,8 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
848
854
|
}
|
849
855
|
|
850
856
|
if (project.type() === Workspace.Workspace.projectTypes.FileSystem) {
|
851
|
-
// TODO(crbug.com/1253323): Cast to RawPathString will be removed when migration to branded types is complete.
|
852
857
|
const folderPath = Common.ParsedURL.ParsedURL.urlToRawPathString(
|
853
|
-
Persistence.FileSystemWorkspaceBinding.FileSystemWorkspaceBinding.completeURL(project, path)
|
854
|
-
Platform.DevToolsPath.UrlString,
|
858
|
+
Persistence.FileSystemWorkspaceBinding.FileSystemWorkspaceBinding.completeURL(project, path),
|
855
859
|
Host.Platform.isWin());
|
856
860
|
contextMenu.revealSection().appendItem(
|
857
861
|
i18nString(UIStrings.openFolder),
|
@@ -1360,7 +1364,7 @@ export class NavigatorUISourceCodeTreeNode extends NavigatorTreeNode {
|
|
1360
1364
|
this.treeElement.title = titleText;
|
1361
1365
|
this.treeElement.updateIcon();
|
1362
1366
|
|
1363
|
-
let tooltip = this.uiSourceCodeInternal.url();
|
1367
|
+
let tooltip: string = this.uiSourceCodeInternal.url();
|
1364
1368
|
if (this.uiSourceCodeInternal.contentType().isFromSourceMap()) {
|
1365
1369
|
tooltip = i18nString(UIStrings.sFromSourceMap, {PH1: this.uiSourceCodeInternal.displayName()});
|
1366
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 || {};
|
@@ -139,26 +141,13 @@ Sources.SnippetsPlugin = SourcesModule.SnippetsPlugin.SnippetsPlugin;
|
|
139
141
|
|
140
142
|
Sources.SourceMapNamesResolver = {};
|
141
143
|
|
142
|
-
Sources.SourceMapNamesResolver.setScopeResolvedForTest = SourcesModule.SourceMapNamesResolver.setScopeResolvedForTest;
|
143
|
-
|
144
144
|
// Tests can override this global symbol and therefore can't be exported
|
145
145
|
Object.defineProperty(Sources.SourceMapNamesResolver, '_scopeResolvedForTest', {
|
146
|
-
get:
|
147
|
-
set:
|
146
|
+
get: SourceMapScopesModule.NamesResolver.getScopeResolvedForTest,
|
147
|
+
set: SourceMapScopesModule.NamesResolver.setScopeResolvedForTest,
|
148
148
|
});
|
149
149
|
|
150
|
-
Sources.SourceMapNamesResolver.
|
151
|
-
Sources.SourceMapNamesResolver._resolveScope = SourcesModule.SourceMapNamesResolver.resolveScope;
|
152
|
-
Sources.SourceMapNamesResolver._allVariablesInCallFrame = SourcesModule.SourceMapNamesResolver.allVariablesInCallFrame;
|
153
|
-
Sources.SourceMapNamesResolver.resolveExpression = SourcesModule.SourceMapNamesResolver.resolveExpression;
|
154
|
-
Sources.SourceMapNamesResolver.resolveThisObject = SourcesModule.SourceMapNamesResolver.resolveThisObject;
|
155
|
-
Sources.SourceMapNamesResolver.resolveScopeInObject = SourcesModule.SourceMapNamesResolver.resolveScopeInObject;
|
156
|
-
|
157
|
-
/** @constructor */
|
158
|
-
Sources.SourceMapNamesResolver.Identifier = SourcesModule.SourceMapNamesResolver.Identifier;
|
159
|
-
|
160
|
-
/** @constructor */
|
161
|
-
Sources.SourceMapNamesResolver.RemoteObject = SourcesModule.SourceMapNamesResolver.RemoteObject;
|
150
|
+
Sources.SourceMapNamesResolver.resolveExpression = SourceMapScopesModule.NamesResolver.resolveExpression;
|
162
151
|
|
163
152
|
/** @constructor */
|
164
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,
|