chrome-devtools-frontend 1.0.1660788 → 1.0.1661063
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/.agents/skills/evaluate-ai-css-completion/SKILL.md +133 -0
- package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +76 -0
- package/eslint.config.mjs +7 -0
- package/extension-api/ExtensionAPI.d.ts +88 -0
- package/front_end/core/host/InspectorFrontendHost.ts +1 -0
- package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
- package/front_end/core/platform/StringUtilities.ts +20 -4
- package/front_end/core/sdk/CPUThrottlingManager.ts +2 -0
- package/front_end/core/sdk/DOMDebuggerModel.ts +2 -0
- package/front_end/core/sdk/DOMModel.ts +1 -0
- package/front_end/core/sdk/DebuggerModel.ts +4 -4
- package/front_end/core/sdk/EventBreakpointsModel.ts +2 -0
- package/front_end/core/sdk/FrameManager.ts +1 -0
- package/front_end/core/sdk/IsolateManager.ts +1 -0
- package/front_end/core/sdk/NetworkManager.ts +2 -0
- package/front_end/core/sdk/NetworkRequest.ts +1 -0
- package/front_end/core/sdk/PageResourceLoader.ts +2 -0
- package/front_end/core/sdk/SourceMap.ts +5 -5
- package/front_end/core/sdk/SourceMapManager.ts +3 -2
- package/front_end/core/sdk/TargetManager.ts +4 -0
- package/front_end/entrypoints/main/MainImpl.ts +2 -1
- package/front_end/models/bindings/CompilerScriptMapping.ts +5 -6
- package/front_end/models/bindings/ContentProviderBasedProject.ts +4 -4
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +3 -4
- package/front_end/models/bindings/DefaultScriptMapping.ts +3 -3
- package/front_end/models/bindings/NetworkProject.ts +1 -10
- package/front_end/models/bindings/ResourceMapping.ts +3 -4
- package/front_end/models/bindings/ResourceScriptMapping.ts +2 -3
- package/front_end/models/bindings/SASSSourceMapping.ts +3 -4
- package/front_end/models/bindings/StylesSourceMapping.ts +3 -3
- package/front_end/models/bindings/TempFile.ts +8 -3
- package/front_end/models/extensions/ExtensionAPI.ts +110 -46
- package/front_end/models/formatter/ScriptFormatter.ts +8 -11
- package/front_end/models/issues_manager/CookieIssue.ts +21 -9
- package/front_end/models/issues_manager/Issue.ts +3 -4
- package/front_end/models/issues_manager/IssueAggregator.ts +0 -9
- package/front_end/models/issues_manager/IssueResolver.ts +2 -2
- package/front_end/models/issues_manager/IssuesManager.ts +136 -137
- package/front_end/models/issues_manager/issues_manager.ts +0 -2
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +5 -0
- package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +13 -10
- package/front_end/models/workspace/WorkspaceImpl.ts +10 -1
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +10 -4
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +2 -1
- package/front_end/panels/application/FrameDetailsView.ts +1 -1
- package/front_end/panels/application/WebMCPView.ts +38 -43
- package/front_end/panels/application/components/AdsView.ts +201 -30
- package/front_end/panels/application/components/adsView.css +25 -0
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -2
- package/front_end/panels/console/ConsoleView.ts +2 -1
- package/front_end/panels/console/PromptBuilder.ts +2 -1
- package/front_end/panels/emulation/DeviceModeView.ts +52 -70
- package/front_end/panels/issues/IssueView.ts +0 -2
- package/front_end/panels/issues/IssuesPane.ts +1 -8
- package/front_end/panels/js_timeline/js_timeline-meta.ts +3 -2
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +3 -3
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +5 -5
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +4 -4
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +2 -2
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +6 -6
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +3 -3
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +8 -9
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplayUtils.ts +2 -2
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -1
- package/front_end/panels/linear_memory_inspector/linear_memory_inspector-meta.ts +2 -2
- package/front_end/panels/network/RequestPayloadView.ts +15 -13
- package/front_end/panels/network/RequestTimingView.ts +95 -127
- package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
- package/front_end/panels/profiler/WritableProfileHeader.ts +2 -2
- package/front_end/panels/recorder/{components/ControlButton.ts → ControlButton.ts} +9 -10
- package/front_end/panels/recorder/{components/CreateRecordingView.ts → CreateRecordingView.ts} +48 -47
- package/front_end/panels/recorder/{components/ExtensionView.ts → ExtensionView.ts} +8 -8
- package/front_end/panels/recorder/RecorderController.ts +88 -77
- package/front_end/panels/recorder/{components/RecordingListView.ts → RecordingListView.ts} +19 -20
- package/front_end/panels/recorder/{components/RecordingView.ts → RecordingView.ts} +88 -88
- package/front_end/panels/recorder/{components/ReplaySection.ts → ReplaySection.ts} +11 -11
- package/front_end/panels/recorder/{components/SelectorPicker.ts → SelectorPicker.ts} +13 -13
- package/front_end/panels/recorder/{components/StepEditor.ts → StepEditor.ts} +15 -15
- package/front_end/panels/recorder/{components/StepView.ts → StepView.ts} +10 -10
- package/front_end/panels/recorder/{components/TimelineSection.ts → TimelineSection.ts} +2 -2
- package/front_end/panels/recorder/recorder.ts +23 -1
- package/front_end/panels/recorder/util/util.ts +113 -0
- package/front_end/panels/sources/InplaceFormatterEditorAction.ts +2 -2
- package/front_end/panels/sources/SourcesNavigator.ts +2 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
- package/front_end/panels/timeline/IsolateSelector.ts +10 -8
- package/front_end/panels/timeline/TimelinePanel.ts +18 -7
- package/front_end/panels/timeline/TimelineUIUtils.ts +144 -129
- package/front_end/panels/timeline/timeline-meta.ts +3 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/legacy/Treeoutline.ts +3 -0
- package/front_end/ui/legacy/Widget.ts +14 -15
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +11 -7
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -1
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +10 -1
- package/package.json +1 -1
- package/front_end/models/issues_manager/AttributionReportingIssue.ts +0 -247
- package/front_end/models/issues_manager/descriptions/arInsecureContext.md +0 -7
- package/front_end/models/issues_manager/descriptions/arInvalidInfoHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsSourceHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsTriggerHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +0 -6
- package/front_end/models/issues_manager/descriptions/arNoRegisterOsSourceHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNoRegisterOsTriggerHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNoRegisterSourceHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNoRegisterTriggerHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNoWebOrOsSupport.md +0 -4
- package/front_end/models/issues_manager/descriptions/arOsSourceIgnored.md +0 -18
- package/front_end/models/issues_manager/descriptions/arOsTriggerIgnored.md +0 -19
- package/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +0 -8
- package/front_end/models/issues_manager/descriptions/arSourceAndTriggerHeaders.md +0 -9
- package/front_end/models/issues_manager/descriptions/arSourceIgnored.md +0 -13
- package/front_end/models/issues_manager/descriptions/arTriggerIgnored.md +0 -12
- package/front_end/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +0 -10
- package/front_end/models/issues_manager/descriptions/arWebAndOsHeaders.md +0 -11
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +0 -182
- package/front_end/panels/recorder/components/components.ts +0 -25
- package/front_end/panels/recorder/components/util.ts +0 -116
- /package/front_end/panels/recorder/{components/controlButton.css → controlButton.css} +0 -0
- /package/front_end/panels/recorder/{components/createRecordingView.css → createRecordingView.css} +0 -0
- /package/front_end/panels/recorder/{components/extensionView.css → extensionView.css} +0 -0
- /package/front_end/panels/recorder/{components/recordingListView.css → recordingListView.css} +0 -0
- /package/front_end/panels/recorder/{components/recordingView.css → recordingView.css} +0 -0
- /package/front_end/panels/recorder/{components/replaySection.css → replaySection.css} +0 -0
- /package/front_end/panels/recorder/{components/selectorPicker.css → selectorPicker.css} +0 -0
- /package/front_end/panels/recorder/{components/startView.css → startView.css} +0 -0
- /package/front_end/panels/recorder/{components/stepEditor.css → stepEditor.css} +0 -0
- /package/front_end/panels/recorder/{components/stepView.css → stepView.css} +0 -0
- /package/front_end/panels/recorder/{components/timelineSection.css → timelineSection.css} +0 -0
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
|
+
import * as Root from '../../core/root/root.js';
|
|
6
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
7
8
|
import * as Protocol from '../../generated/protocol.js';
|
|
8
9
|
|
|
9
|
-
import {AttributionReportingIssue} from './AttributionReportingIssue.js';
|
|
10
10
|
import {BounceTrackingIssue} from './BounceTrackingIssue.js';
|
|
11
11
|
import {ClientHintIssue} from './ClientHintIssue.js';
|
|
12
12
|
import {ConnectionAllowlistIssue} from './ConnectionAllowlistIssue.js';
|
|
@@ -38,8 +38,6 @@ import {UnencodedDigestIssue} from './UnencodedDigestIssue.js';
|
|
|
38
38
|
|
|
39
39
|
export {Events} from './IssuesManagerEvents.js';
|
|
40
40
|
|
|
41
|
-
let issuesManagerInstance: IssuesManager|null = null;
|
|
42
|
-
|
|
43
41
|
function createIssuesForBlockedByResponseIssue(
|
|
44
42
|
issuesModel: SDK.IssuesModel.IssuesModel|null,
|
|
45
43
|
inspectorIssue: Protocol.Audits.InspectorIssue): CrossOriginEmbedderPolicyIssue[] {
|
|
@@ -54,111 +52,109 @@ function createIssuesForBlockedByResponseIssue(
|
|
|
54
52
|
return [];
|
|
55
53
|
}
|
|
56
54
|
|
|
57
|
-
const issueCodeHandlers =
|
|
58
|
-
Protocol.Audits.InspectorIssueCode,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
],
|
|
161
|
-
]);
|
|
55
|
+
const issueCodeHandlers =
|
|
56
|
+
new Map<Protocol.Audits.InspectorIssueCode,
|
|
57
|
+
(model: SDK.IssuesModel.IssuesModel|null, inspectorIssue: Protocol.Audits.InspectorIssue,
|
|
58
|
+
frameManager: SDK.FrameManager.FrameManager) => Issue[]>(
|
|
59
|
+
[
|
|
60
|
+
[
|
|
61
|
+
Protocol.Audits.InspectorIssueCode.CookieIssue,
|
|
62
|
+
CookieIssue.fromInspectorIssue,
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
Protocol.Audits.InspectorIssueCode.MixedContentIssue,
|
|
66
|
+
MixedContentIssue.fromInspectorIssue,
|
|
67
|
+
],
|
|
68
|
+
[
|
|
69
|
+
Protocol.Audits.InspectorIssueCode.HeavyAdIssue,
|
|
70
|
+
HeavyAdIssue.fromInspectorIssue,
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
Protocol.Audits.InspectorIssueCode.ContentSecurityPolicyIssue,
|
|
74
|
+
ContentSecurityPolicyIssue.fromInspectorIssue,
|
|
75
|
+
],
|
|
76
|
+
[Protocol.Audits.InspectorIssueCode.BlockedByResponseIssue, createIssuesForBlockedByResponseIssue],
|
|
77
|
+
[
|
|
78
|
+
Protocol.Audits.InspectorIssueCode.SharedArrayBufferIssue,
|
|
79
|
+
SharedArrayBufferIssue.fromInspectorIssue,
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
Protocol.Audits.InspectorIssueCode.SharedDictionaryIssue,
|
|
83
|
+
SharedDictionaryIssue.fromInspectorIssue,
|
|
84
|
+
],
|
|
85
|
+
[
|
|
86
|
+
Protocol.Audits.InspectorIssueCode.CorsIssue,
|
|
87
|
+
CorsIssue.fromInspectorIssue,
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
Protocol.Audits.InspectorIssueCode.QuirksModeIssue,
|
|
91
|
+
QuirksModeIssue.fromInspectorIssue,
|
|
92
|
+
],
|
|
93
|
+
[
|
|
94
|
+
Protocol.Audits.InspectorIssueCode.GenericIssue,
|
|
95
|
+
GenericIssue.fromInspectorIssue,
|
|
96
|
+
],
|
|
97
|
+
[
|
|
98
|
+
Protocol.Audits.InspectorIssueCode.DeprecationIssue,
|
|
99
|
+
DeprecationIssue.fromInspectorIssue,
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
Protocol.Audits.InspectorIssueCode.ClientHintIssue,
|
|
103
|
+
ClientHintIssue.fromInspectorIssue,
|
|
104
|
+
],
|
|
105
|
+
[
|
|
106
|
+
Protocol.Audits.InspectorIssueCode.EmailVerificationRequestIssue,
|
|
107
|
+
EmailVerificationRequestIssue.fromInspectorIssue,
|
|
108
|
+
],
|
|
109
|
+
[
|
|
110
|
+
Protocol.Audits.InspectorIssueCode.FederatedAuthRequestIssue,
|
|
111
|
+
FederatedAuthRequestIssue.fromInspectorIssue,
|
|
112
|
+
],
|
|
113
|
+
[
|
|
114
|
+
Protocol.Audits.InspectorIssueCode.BounceTrackingIssue,
|
|
115
|
+
BounceTrackingIssue.fromInspectorIssue,
|
|
116
|
+
],
|
|
117
|
+
[
|
|
118
|
+
Protocol.Audits.InspectorIssueCode.StylesheetLoadingIssue,
|
|
119
|
+
StylesheetLoadingIssue.fromInspectorIssue,
|
|
120
|
+
],
|
|
121
|
+
[
|
|
122
|
+
Protocol.Audits.InspectorIssueCode.PartitioningBlobURLIssue,
|
|
123
|
+
PartitioningBlobURLIssue.fromInspectorIssue,
|
|
124
|
+
],
|
|
125
|
+
[
|
|
126
|
+
Protocol.Audits.InspectorIssueCode.PropertyRuleIssue,
|
|
127
|
+
PropertyRuleIssue.fromInspectorIssue,
|
|
128
|
+
],
|
|
129
|
+
[
|
|
130
|
+
Protocol.Audits.InspectorIssueCode.CookieDeprecationMetadataIssue,
|
|
131
|
+
CookieDeprecationMetadataIssue.fromInspectorIssue,
|
|
132
|
+
],
|
|
133
|
+
[
|
|
134
|
+
Protocol.Audits.InspectorIssueCode.ElementAccessibilityIssue,
|
|
135
|
+
ElementAccessibilityIssue.fromInspectorIssue,
|
|
136
|
+
],
|
|
137
|
+
[
|
|
138
|
+
Protocol.Audits.InspectorIssueCode.SRIMessageSignatureIssue,
|
|
139
|
+
SRIMessageSignatureIssue.fromInspectorIssue,
|
|
140
|
+
],
|
|
141
|
+
[
|
|
142
|
+
Protocol.Audits.InspectorIssueCode.UnencodedDigestIssue,
|
|
143
|
+
UnencodedDigestIssue.fromInspectorIssue,
|
|
144
|
+
],
|
|
145
|
+
[
|
|
146
|
+
Protocol.Audits.InspectorIssueCode.ConnectionAllowlistIssue,
|
|
147
|
+
ConnectionAllowlistIssue.fromInspectorIssue,
|
|
148
|
+
],
|
|
149
|
+
[
|
|
150
|
+
Protocol.Audits.InspectorIssueCode.PermissionElementIssue,
|
|
151
|
+
PermissionElementIssue.fromInspectorIssue,
|
|
152
|
+
],
|
|
153
|
+
[
|
|
154
|
+
Protocol.Audits.InspectorIssueCode.SelectivePermissionsInterventionIssue,
|
|
155
|
+
SelectivePermissionsInterventionIssue.fromInspectorIssue,
|
|
156
|
+
],
|
|
157
|
+
]);
|
|
162
158
|
|
|
163
159
|
export function isIssueCodeSupported(code: Protocol.Audits.InspectorIssueCode): boolean {
|
|
164
160
|
return issueCodeHandlers.has(code);
|
|
@@ -169,10 +165,11 @@ export function isIssueCodeSupported(code: Protocol.Audits.InspectorIssueCode):
|
|
|
169
165
|
* Handlers are simple functions hard-coded into a map.
|
|
170
166
|
*/
|
|
171
167
|
export function createIssuesFromProtocolIssue(
|
|
172
|
-
issuesModel: SDK.IssuesModel.IssuesModel|null, inspectorIssue: Protocol.Audits.InspectorIssue
|
|
168
|
+
issuesModel: SDK.IssuesModel.IssuesModel|null, inspectorIssue: Protocol.Audits.InspectorIssue,
|
|
169
|
+
frameManager: SDK.FrameManager.FrameManager = SDK.FrameManager.FrameManager.instance()): Issue[] {
|
|
173
170
|
const handler = issueCodeHandlers.get(inspectorIssue.code);
|
|
174
171
|
if (handler) {
|
|
175
|
-
return handler(issuesModel, inspectorIssue);
|
|
172
|
+
return handler(issuesModel, inspectorIssue, frameManager);
|
|
176
173
|
}
|
|
177
174
|
console.warn(`No handler registered for issue code ${inspectorIssue.code}`);
|
|
178
175
|
return [];
|
|
@@ -199,9 +196,9 @@ export function defaultHideIssueByCodeSetting(): HideIssueMenuSetting {
|
|
|
199
196
|
return setting;
|
|
200
197
|
}
|
|
201
198
|
|
|
202
|
-
export function getHideIssueByCodeSetting(
|
|
203
|
-
|
|
204
|
-
|
|
199
|
+
export function getHideIssueByCodeSetting(settings: Common.Settings.Settings = Common.Settings.Settings.instance()):
|
|
200
|
+
Common.Settings.Setting<HideIssueMenuSetting> {
|
|
201
|
+
return settings.createSetting('hide-issue-by-code-setting-experiment-2021', defaultHideIssueByCodeSetting());
|
|
205
202
|
}
|
|
206
203
|
|
|
207
204
|
/**
|
|
@@ -226,17 +223,20 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
226
223
|
#issuesById = new Map<string, Issue>();
|
|
227
224
|
#issuesByOutermostTarget: WeakMap<SDK.Target.Target, Set<Issue>> = new Map();
|
|
228
225
|
#frameManager: SDK.FrameManager.FrameManager;
|
|
226
|
+
#targetManager: SDK.TargetManager.TargetManager;
|
|
229
227
|
|
|
230
228
|
constructor(private readonly showThirdPartyIssuesSetting?: Common.Settings.Setting<boolean>,
|
|
231
229
|
private readonly hideIssueSetting?: Common.Settings.Setting<HideIssueMenuSetting>,
|
|
232
|
-
frameManager: SDK.FrameManager.FrameManager = SDK.FrameManager.FrameManager.instance()
|
|
230
|
+
frameManager: SDK.FrameManager.FrameManager = SDK.FrameManager.FrameManager.instance(),
|
|
231
|
+
targetManager: SDK.TargetManager.TargetManager = SDK.TargetManager.TargetManager.instance()) {
|
|
233
232
|
super();
|
|
234
233
|
this.#frameManager = frameManager;
|
|
234
|
+
this.#targetManager = targetManager;
|
|
235
235
|
new SourceFrameIssuesManager(this);
|
|
236
|
-
|
|
237
|
-
SDK.
|
|
238
|
-
|
|
239
|
-
|
|
236
|
+
this.#targetManager.observeModels(SDK.IssuesModel.IssuesModel, this);
|
|
237
|
+
this.#targetManager.addModelListener(SDK.ResourceTreeModel.ResourceTreeModel,
|
|
238
|
+
SDK.ResourceTreeModel.Events.PrimaryPageChanged, this.#onPrimaryPageChanged,
|
|
239
|
+
this);
|
|
240
240
|
this.#frameManager.addEventListener(SDK.FrameManager.Events.FRAME_ADDED_TO_TARGET, this.#onFrameAddedToTarget,
|
|
241
241
|
this);
|
|
242
242
|
|
|
@@ -244,37 +244,36 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
244
244
|
// a full update when the setting changes to get an up-to-date issues list.
|
|
245
245
|
this.showThirdPartyIssuesSetting?.addChangeListener(() => this.#updateFilteredIssues());
|
|
246
246
|
this.hideIssueSetting?.addChangeListener(() => this.#updateFilteredIssues());
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
{scoped: true});
|
|
247
|
+
this.#targetManager.observeTargets({
|
|
248
|
+
targetAdded: (target: SDK.Target.Target) => {
|
|
249
|
+
if (target.outermostTarget() === target) {
|
|
250
|
+
this.#updateFilteredIssues();
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
targetRemoved: (_: SDK.Target.Target) => {},
|
|
254
|
+
},
|
|
255
|
+
{scoped: true});
|
|
257
256
|
}
|
|
258
257
|
|
|
259
258
|
static instance(opts: IssuesManagerCreationOptions = {
|
|
260
259
|
forceNew: false,
|
|
261
260
|
ensureFirst: false,
|
|
262
261
|
}): IssuesManager {
|
|
263
|
-
if (
|
|
262
|
+
if (Root.DevToolsContext.globalInstance().has(IssuesManager) && opts.ensureFirst) {
|
|
264
263
|
throw new Error(
|
|
265
264
|
'IssuesManager was already created. Either set "ensureFirst" to false or make sure that this invocation is really the first one.');
|
|
266
265
|
}
|
|
267
266
|
|
|
268
|
-
if (!
|
|
269
|
-
|
|
270
|
-
new IssuesManager(opts.showThirdPartyIssuesSetting, opts.hideIssueSetting, opts.frameManager);
|
|
267
|
+
if (!Root.DevToolsContext.globalInstance().has(IssuesManager) || opts.forceNew) {
|
|
268
|
+
Root.DevToolsContext.globalInstance().set(
|
|
269
|
+
IssuesManager, new IssuesManager(opts.showThirdPartyIssuesSetting, opts.hideIssueSetting, opts.frameManager));
|
|
271
270
|
}
|
|
272
271
|
|
|
273
|
-
return
|
|
272
|
+
return Root.DevToolsContext.globalInstance().get(IssuesManager);
|
|
274
273
|
}
|
|
275
274
|
|
|
276
275
|
static removeInstance(): void {
|
|
277
|
-
|
|
276
|
+
Root.DevToolsContext.globalInstance().delete(IssuesManager);
|
|
278
277
|
}
|
|
279
278
|
|
|
280
279
|
#onPrimaryPageChanged(
|
|
@@ -311,7 +310,7 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
311
310
|
// When DevTools is opened after navigation has completed, issues may be received
|
|
312
311
|
// before the outermost frame is available. Thus, we trigger a recalcuation of third-party-ness
|
|
313
312
|
// when we attach to the outermost frame.
|
|
314
|
-
if (frame.isOutermostFrame() &&
|
|
313
|
+
if (frame.isOutermostFrame() && this.#targetManager.isInScope(frame.resourceTreeModel())) {
|
|
315
314
|
this.#updateFilteredIssues();
|
|
316
315
|
}
|
|
317
316
|
}
|
|
@@ -331,7 +330,7 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
331
330
|
#onIssueAddedEvent(event: Common.EventTarget.EventTargetEvent<SDK.IssuesModel.IssueAddedEvent>): void {
|
|
332
331
|
const {issuesModel, inspectorIssue} = event.data;
|
|
333
332
|
|
|
334
|
-
const issues = createIssuesFromProtocolIssue(issuesModel, inspectorIssue);
|
|
333
|
+
const issues = createIssuesFromProtocolIssue(issuesModel, inspectorIssue, this.#frameManager);
|
|
335
334
|
for (const issue of issues) {
|
|
336
335
|
this.addIssue(issuesModel, issue);
|
|
337
336
|
const message = issue.maybeCreateConsoleMessage();
|
|
@@ -425,7 +424,7 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
425
424
|
}
|
|
426
425
|
|
|
427
426
|
#issueFilter(issue: Issue): boolean {
|
|
428
|
-
const scopeTarget =
|
|
427
|
+
const scopeTarget = this.#targetManager.scopeTarget();
|
|
429
428
|
if (!scopeTarget) {
|
|
430
429
|
return false;
|
|
431
430
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
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 AttributionReportingIssue from './AttributionReportingIssue.js';
|
|
6
5
|
import * as CheckFormsIssuesTrigger from './CheckFormsIssuesTrigger.js';
|
|
7
6
|
import * as ClientHintIssue from './ClientHintIssue.js';
|
|
8
7
|
import * as ConnectionAllowlistIssue from './ConnectionAllowlistIssue.js';
|
|
@@ -37,7 +36,6 @@ import * as StylesheetLoadingIssue from './StylesheetLoadingIssue.js';
|
|
|
37
36
|
import * as UnencodedDigestIssue from './UnencodedDigestIssue.js';
|
|
38
37
|
|
|
39
38
|
export {
|
|
40
|
-
AttributionReportingIssue,
|
|
41
39
|
CheckFormsIssuesTrigger,
|
|
42
40
|
ClientHintIssue,
|
|
43
41
|
ConnectionAllowlistIssue,
|
|
@@ -6,6 +6,7 @@ import * as Common from '../../core/common/common.js';
|
|
|
6
6
|
import * as Host from '../../core/host/host.js';
|
|
7
7
|
import type * as Platform from '../../core/platform/platform.js';
|
|
8
8
|
import * as Root from '../../core/root/root.js';
|
|
9
|
+
import type * as SDK from '../../core/sdk/sdk.js';
|
|
9
10
|
import type {ContentDataOrError} from '../text_utils/ContentData.js';
|
|
10
11
|
import type {SearchMatch} from '../text_utils/ContentProvider.js';
|
|
11
12
|
import * as Workspace from '../workspace/workspace.js';
|
|
@@ -168,6 +169,10 @@ export class FileSystem implements Workspace.Workspace.Project {
|
|
|
168
169
|
uiSourceCodes(): Iterable<Workspace.UISourceCode.UISourceCode> {
|
|
169
170
|
return [];
|
|
170
171
|
}
|
|
172
|
+
|
|
173
|
+
target(): SDK.Target.Target|null {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
171
176
|
}
|
|
172
177
|
|
|
173
178
|
/**
|
|
@@ -2,6 +2,7 @@
|
|
|
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 type * as Common from '../../core/common/common.js';
|
|
5
6
|
import type * as Platform from '../../core/platform/platform.js';
|
|
6
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
7
8
|
import * as Bindings from '../bindings/bindings.js';
|
|
@@ -41,8 +42,9 @@ interface InputData {
|
|
|
41
42
|
|
|
42
43
|
const inputCache = new WeakMap<Workspace.UISourceCode.UISourceCode, Promise<InputData>>();
|
|
43
44
|
|
|
44
|
-
async function prepareInput(uiSourceCode: Workspace.UISourceCode.UISourceCode, content: string
|
|
45
|
-
|
|
45
|
+
async function prepareInput(uiSourceCode: Workspace.UISourceCode.UISourceCode, content: string,
|
|
46
|
+
settings: Common.Settings.Settings): Promise<InputData> {
|
|
47
|
+
const formattedContent = await format(uiSourceCode, content, settings);
|
|
46
48
|
const text = new TextUtils.Text.Text(formattedContent ? formattedContent.formattedContent : content);
|
|
47
49
|
let performanceData = uiSourceCode.getDecorationData(Workspace.UISourceCode.DecoratorType.PERFORMANCE) as
|
|
48
50
|
Workspace.UISourceCode.LineColumnProfileMap |
|
|
@@ -59,14 +61,14 @@ async function prepareInput(uiSourceCode: Workspace.UISourceCode.UISourceCode, c
|
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
/** Formatting and parsing line endings for Text is expensive, so cache it. */
|
|
62
|
-
async function prepareInputAndCache(
|
|
63
|
-
|
|
64
|
+
async function prepareInputAndCache(uiSourceCode: Workspace.UISourceCode.UISourceCode, content: string,
|
|
65
|
+
settings: Common.Settings.Settings): Promise<InputData> {
|
|
64
66
|
let cachedPromise = inputCache.get(uiSourceCode);
|
|
65
67
|
if (cachedPromise) {
|
|
66
68
|
return await cachedPromise;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
cachedPromise = prepareInput(uiSourceCode, content);
|
|
71
|
+
cachedPromise = prepareInput(uiSourceCode, content, settings);
|
|
70
72
|
inputCache.set(uiSourceCode, cachedPromise);
|
|
71
73
|
return await cachedPromise;
|
|
72
74
|
}
|
|
@@ -224,7 +226,7 @@ export async function getFunctionCodeFromLocation(
|
|
|
224
226
|
const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance();
|
|
225
227
|
const projects = debuggerWorkspaceBinding.workspace.projectsForType(Workspace.Workspace.projectTypes.Network);
|
|
226
228
|
for (const project of projects) {
|
|
227
|
-
if (
|
|
229
|
+
if (project.target() !== target) {
|
|
228
230
|
continue;
|
|
229
231
|
}
|
|
230
232
|
uiSourceCode = project.uiSourceCodeForURL(url);
|
|
@@ -246,8 +248,8 @@ export async function getFunctionCodeFromLocation(
|
|
|
246
248
|
return await getFunctionCodeFromRawLocation(rawLocation, options);
|
|
247
249
|
}
|
|
248
250
|
|
|
249
|
-
async function format(uiSourceCode: Workspace.UISourceCode.UISourceCode, content: string
|
|
250
|
-
|
|
251
|
+
async function format(uiSourceCode: Workspace.UISourceCode.UISourceCode, content: string,
|
|
252
|
+
settings: Common.Settings.Settings): Promise<Formatter.ScriptFormatter.FormattedContent|null> {
|
|
251
253
|
const contentType = uiSourceCode.contentType();
|
|
252
254
|
const shouldFormat = !contentType.isFromSourceMap() && (contentType.isDocument() || contentType.isScript()) &&
|
|
253
255
|
TextUtils.TextUtils.isMinified(content);
|
|
@@ -255,7 +257,7 @@ async function format(uiSourceCode: Workspace.UISourceCode.UISourceCode, content
|
|
|
255
257
|
return null;
|
|
256
258
|
}
|
|
257
259
|
|
|
258
|
-
return await Formatter.ScriptFormatter.formatScriptContent(contentType.canonicalMimeType(), content, '\t');
|
|
260
|
+
return await Formatter.ScriptFormatter.formatScriptContent(settings, contentType.canonicalMimeType(), content, '\t');
|
|
259
261
|
}
|
|
260
262
|
|
|
261
263
|
/**
|
|
@@ -275,6 +277,7 @@ export async function getFunctionCodeFromRawLocation(
|
|
|
275
277
|
return null;
|
|
276
278
|
}
|
|
277
279
|
|
|
278
|
-
const
|
|
280
|
+
const settings = rawLocation.debuggerModel.target().targetManager().settings;
|
|
281
|
+
const inputData = await prepareInputAndCache(functionBounds.uiSourceCode, content, settings);
|
|
279
282
|
return createFunctionCode(inputData, functionBounds, options);
|
|
280
283
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import type * as Platform from '../../core/platform/platform.js';
|
|
7
7
|
import * as Root from '../../core/root/root.js';
|
|
8
|
+
import type * as SDK from '../../core/sdk/sdk.js';
|
|
8
9
|
import type * as TextUtils from '../text_utils/text_utils.js';
|
|
9
10
|
|
|
10
11
|
import type {SearchConfig} from './SearchConfig.js';
|
|
@@ -54,6 +55,7 @@ export interface Project {
|
|
|
54
55
|
* @returns an iterator for the sources provided by this project.
|
|
55
56
|
*/
|
|
56
57
|
uiSourceCodes(): Iterable<UISourceCode>;
|
|
58
|
+
target(): SDK.Target.Target|null;
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
/* eslint-disable @typescript-eslint/naming-convention -- Used by web_tests. */
|
|
@@ -74,12 +76,15 @@ export abstract class ProjectStore implements Project {
|
|
|
74
76
|
readonly #type: projectTypes;
|
|
75
77
|
readonly #displayName: string;
|
|
76
78
|
readonly #uiSourceCodes = new Map<Platform.DevToolsPath.UrlString, UISourceCode>();
|
|
79
|
+
readonly #target: SDK.Target.Target|null = null;
|
|
77
80
|
|
|
78
|
-
constructor(workspace: WorkspaceImpl, id: string, type: projectTypes, displayName: string
|
|
81
|
+
constructor(workspace: WorkspaceImpl, id: string, type: projectTypes, displayName: string,
|
|
82
|
+
target: SDK.Target.Target|null = null) {
|
|
79
83
|
this.#workspace = workspace;
|
|
80
84
|
this.#id = id;
|
|
81
85
|
this.#type = type;
|
|
82
86
|
this.#displayName = displayName;
|
|
87
|
+
this.#target = target;
|
|
83
88
|
}
|
|
84
89
|
|
|
85
90
|
id(): string {
|
|
@@ -135,6 +140,10 @@ export abstract class ProjectStore implements Project {
|
|
|
135
140
|
return this.#uiSourceCodes.values();
|
|
136
141
|
}
|
|
137
142
|
|
|
143
|
+
target(): SDK.Target.Target|null {
|
|
144
|
+
return this.#target;
|
|
145
|
+
}
|
|
146
|
+
|
|
138
147
|
renameUISourceCode(uiSourceCode: UISourceCode, newName: string): void {
|
|
139
148
|
const oldPath = uiSourceCode.url();
|
|
140
149
|
const newPath = uiSourceCode.parentURL() ?
|
|
@@ -19,6 +19,7 @@ interface DiffResponse {
|
|
|
19
19
|
export class WorkspaceDiffImpl extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
20
20
|
readonly #persistence: Persistence.Persistence.PersistenceImpl;
|
|
21
21
|
readonly #networkPersistenceManager: Persistence.NetworkPersistenceManager.NetworkPersistenceManager;
|
|
22
|
+
readonly #settings: Common.Settings.Settings;
|
|
22
23
|
readonly #diffs = new WeakMap<Workspace.UISourceCode.UISourceCode, UISourceCodeDiff>();
|
|
23
24
|
/** used in web tests */
|
|
24
25
|
private readonly loadingUISourceCodes =
|
|
@@ -30,10 +31,12 @@ export class WorkspaceDiffImpl extends Common.ObjectWrapper.ObjectWrapper<EventT
|
|
|
30
31
|
persistence: Persistence.Persistence.PersistenceImpl = Persistence.Persistence.PersistenceImpl.instance(),
|
|
31
32
|
networkPersistenceManager: Persistence.NetworkPersistenceManager.NetworkPersistenceManager =
|
|
32
33
|
Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance(),
|
|
34
|
+
settings: Common.Settings.Settings = Common.Settings.Settings.instance(),
|
|
33
35
|
) {
|
|
34
36
|
super();
|
|
35
37
|
this.#persistence = persistence;
|
|
36
38
|
this.#networkPersistenceManager = networkPersistenceManager;
|
|
39
|
+
this.#settings = settings;
|
|
37
40
|
workspace.addEventListener(Workspace.Workspace.Events.WorkingCopyChanged, this.#uiSourceCodeChanged, this);
|
|
38
41
|
workspace.addEventListener(Workspace.Workspace.Events.WorkingCopyCommitted, this.#uiSourceCodeChanged, this);
|
|
39
42
|
workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, this.#uiSourceCodeAdded, this);
|
|
@@ -63,7 +66,7 @@ export class WorkspaceDiffImpl extends Common.ObjectWrapper.ObjectWrapper<EventT
|
|
|
63
66
|
#uiSourceCodeDiff(uiSourceCode: Workspace.UISourceCode.UISourceCode): UISourceCodeDiff {
|
|
64
67
|
let diff = this.#diffs.get(uiSourceCode);
|
|
65
68
|
if (!diff) {
|
|
66
|
-
diff = new UISourceCodeDiff(uiSourceCode, this.#networkPersistenceManager);
|
|
69
|
+
diff = new UISourceCodeDiff(uiSourceCode, this.#networkPersistenceManager, this.#settings);
|
|
67
70
|
this.#diffs.set(uiSourceCode, diff);
|
|
68
71
|
}
|
|
69
72
|
return diff;
|
|
@@ -205,16 +208,19 @@ export interface EventTypes {
|
|
|
205
208
|
export class UISourceCodeDiff extends Common.ObjectWrapper.ObjectWrapper<UISourceCodeDiffEventTypes> {
|
|
206
209
|
#uiSourceCode: Workspace.UISourceCode.UISourceCode;
|
|
207
210
|
readonly #networkPersistenceManager: Persistence.NetworkPersistenceManager.NetworkPersistenceManager;
|
|
211
|
+
readonly #settings: Common.Settings.Settings;
|
|
208
212
|
#requestDiffPromise: Promise<DiffResponse|null>|null = null;
|
|
209
213
|
#pendingChanges: number|null = null;
|
|
210
214
|
dispose = false;
|
|
211
215
|
constructor(
|
|
212
216
|
uiSourceCode: Workspace.UISourceCode.UISourceCode,
|
|
213
217
|
networkPersistenceManager: Persistence.NetworkPersistenceManager.NetworkPersistenceManager,
|
|
218
|
+
settings: Common.Settings.Settings = Common.Settings.Settings.instance(),
|
|
214
219
|
) {
|
|
215
220
|
super();
|
|
216
221
|
this.#uiSourceCode = uiSourceCode;
|
|
217
222
|
this.#networkPersistenceManager = networkPersistenceManager;
|
|
223
|
+
this.#settings = settings;
|
|
218
224
|
uiSourceCode.addEventListener(Workspace.UISourceCode.Events.WorkingCopyChanged, this.#uiSourceCodeChanged, this);
|
|
219
225
|
uiSourceCode.addEventListener(Workspace.UISourceCode.Events.WorkingCopyCommitted, this.#uiSourceCodeChanged, this);
|
|
220
226
|
}
|
|
@@ -293,11 +299,11 @@ export class UISourceCodeDiff extends Common.ObjectWrapper.ObjectWrapper<UISourc
|
|
|
293
299
|
return null;
|
|
294
300
|
}
|
|
295
301
|
|
|
296
|
-
baseline = (await FormatterModule.ScriptFormatter.format(
|
|
297
|
-
|
|
302
|
+
baseline = (await FormatterModule.ScriptFormatter.format(this.#settings, this.#uiSourceCode.contentType(),
|
|
303
|
+
this.#uiSourceCode.mimeType(), baseline))
|
|
298
304
|
.formattedContent;
|
|
299
305
|
const formatCurrentResult = await FormatterModule.ScriptFormatter.format(
|
|
300
|
-
this.#uiSourceCode.contentType(), this.#uiSourceCode.mimeType(), current);
|
|
306
|
+
this.#settings, this.#uiSourceCode.contentType(), this.#uiSourceCode.mimeType(), current);
|
|
301
307
|
current = formatCurrentResult.formattedContent;
|
|
302
308
|
const formattedCurrentMapping = formatCurrentResult.formattedMapping;
|
|
303
309
|
const reNewline = /\r\n?|\n/;
|
|
@@ -1409,7 +1409,8 @@ async function makeSourceCodeWidget(widgetData: SourceCodeAiWidget): Promise<Wid
|
|
|
1409
1409
|
let code = widgetData.data.code;
|
|
1410
1410
|
if (TextUtils.TextUtils.isMinified(code)) {
|
|
1411
1411
|
const canonicalMimeType = uiSourceCode?.contentType().canonicalMimeType() || 'text/javascript';
|
|
1412
|
-
const formatted = await Formatter.ScriptFormatter.formatScriptContent(
|
|
1412
|
+
const formatted = await Formatter.ScriptFormatter.formatScriptContent(Common.Settings.Settings.instance(),
|
|
1413
|
+
canonicalMimeType, code, ' ');
|
|
1413
1414
|
code = formatted.formattedContent;
|
|
1414
1415
|
}
|
|
1415
1416
|
|
|
@@ -932,7 +932,7 @@ export class FrameDetailsReportView extends UI.Widget.Widget {
|
|
|
932
932
|
|
|
933
933
|
#uiSourceCodeForFrame(frame: SDK.ResourceTreeModel.ResourceTreeFrame): Workspace.UISourceCode.UISourceCode|null {
|
|
934
934
|
for (const project of Workspace.Workspace.WorkspaceImpl.instance().projects()) {
|
|
935
|
-
const projectTarget =
|
|
935
|
+
const projectTarget = project.target();
|
|
936
936
|
if (projectTarget && projectTarget === frame.resourceTreeModel().target()) {
|
|
937
937
|
const uiSourceCode = project.uiSourceCodeForURL(frame.url);
|
|
938
938
|
if (uiSourceCode) {
|