chrome-devtools-frontend 1.0.1669021 → 1.0.1672388
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/fixing-skipped-tests/SKILL.md +6 -6
- package/.agents/skills/gerrit-cli/SKILL.md +4 -10
- package/.agents/skills/gerrit-cli/references/commands.md +45 -2
- package/.agents/skills/gerrit-cli/references/workflows.md +7 -0
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +34 -152
- package/config/typescript/tsconfig.eslint.json +1 -1
- package/docs/contributing/settings-experiments-features.md +2 -8
- package/docs/ecosystem/automatic_workspace_folders.md +0 -19
- package/eslint.config.mjs +2 -2
- package/front_end/core/common/Lazy.ts +3 -3
- package/front_end/core/common/SettingRegistration.ts +0 -7
- package/front_end/core/common/Settings.ts +0 -38
- package/front_end/core/host/UserMetrics.ts +187 -953
- package/front_end/core/host/UserMetricsEnums.d.ts +949 -0
- package/front_end/core/root/Runtime.ts +21 -133
- package/front_end/core/sdk/CSSMetadata.ts +70 -65
- package/front_end/core/sdk/CategorizedBreakpoint.ts +0 -1
- package/front_end/core/sdk/ChildTargetManager.ts +0 -2
- package/front_end/core/sdk/EmulationModel.ts +0 -2
- package/front_end/core/sdk/EventBreakpointsModel.ts +0 -4
- package/front_end/core/sdk/NetworkManager.ts +0 -3
- package/front_end/core/sdk/PageResourceLoader.ts +9 -9
- package/front_end/core/sdk/RehydratingConnection.ts +52 -4
- package/front_end/core/sdk/Target.ts +0 -4
- package/front_end/devtools_compatibility.js +886 -0
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +7 -6
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +0 -1
- package/front_end/entrypoints/main/MainImpl.ts +18 -22
- package/front_end/foundation/Universe.ts +7 -2
- package/front_end/generated/InspectorBackendCommands.ts +3 -10
- package/front_end/generated/protocol-mapping.d.ts +0 -42
- package/front_end/generated/protocol-proxy-api.d.ts +0 -38
- package/front_end/generated/protocol.ts +9 -169
- package/front_end/models/ai_assistance/AiAgent2.ts +11 -3
- package/front_end/models/ai_assistance/AiConversation.ts +1 -0
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +8 -5
- package/front_end/models/ai_assistance/AiSetting.ts +108 -0
- package/front_end/models/ai_assistance/AiUtils.ts +47 -0
- package/front_end/models/ai_assistance/ChangeManager.ts +1 -0
- package/front_end/models/ai_assistance/ExtensionScope.ts +3 -12
- package/front_end/models/ai_assistance/agents/AiAgent.ts +11 -18
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +3 -0
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +42 -17
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +3 -2
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +253 -155
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +12 -6
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +3 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +1 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -0
- package/front_end/models/ai_assistance/injected.ts +1 -0
- package/front_end/models/ai_assistance/performance/AICallTree.ts +1 -0
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +2 -0
- package/front_end/models/ai_assistance/skills/performance.md +10 -0
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +52 -5
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +4 -4
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +4 -4
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +5 -4
- package/front_end/models/ai_assistance/tools/GetStyles.ts +5 -4
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +5 -4
- package/front_end/models/ai_assistance/tools/README.md +1 -1
- package/front_end/models/ai_assistance/tools/RecordPerformanceTrace.ts +63 -0
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +5 -5
- package/front_end/models/ai_assistance/tools/Tool.ts +118 -24
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +2 -0
- package/front_end/models/badges/UserBadges.ts +2 -0
- package/front_end/models/bindings/NetworkProject.ts +5 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +2 -0
- package/front_end/models/bindings/ResourceUtils.ts +3 -0
- package/front_end/models/crux-manager/CrUXManager.ts +1 -0
- package/front_end/models/emulation/DeviceModeModel.ts +140 -7
- package/front_end/models/emulation/EmulatedDevices.ts +246 -793
- package/front_end/models/issues_manager/IssuesManager.ts +10 -2
- package/front_end/models/live-metrics/LiveMetrics.ts +41 -9
- package/front_end/models/logs/LogManager.ts +8 -5
- package/front_end/models/logs/NetworkLog.ts +1 -0
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +21 -3
- package/front_end/models/persistence/NetworkPersistenceManager.ts +6 -0
- package/front_end/models/project_settings/ProjectSettingsModel.ts +8 -12
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +3 -1
- package/front_end/models/workspace/IgnoreListManager.ts +2 -0
- package/front_end/models/workspace/UISourceCode.ts +2 -0
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +4 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +22 -22
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -7
- package/front_end/panels/ai_assistance/components/ChatInput.ts +4 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +79 -34
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +1 -2
- package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +9 -106
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +1 -1
- package/front_end/panels/application/application.ts +0 -10
- package/front_end/panels/application/components/components.ts +0 -4
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +0 -5
- package/front_end/panels/browser_debugger/EventListenerBreakpointsSidebarPane.ts +6 -12
- package/front_end/panels/browser_debugger/browser_debugger-meta.ts +5 -3
- package/front_end/panels/console/ConsoleFormat.ts +2 -62
- package/front_end/panels/console/ConsoleViewMessage.ts +14 -7
- package/front_end/panels/emulation/AdvancedApp.ts +1 -2
- package/front_end/panels/emulation/DeviceModeToolbar.ts +83 -69
- package/front_end/panels/emulation/DeviceModeView.ts +4 -134
- package/front_end/panels/emulation/DeviceModeWrapper.ts +52 -69
- package/front_end/panels/emulation/MediaQueryInspector.ts +2 -2
- package/front_end/panels/emulation/emulation-meta.ts +12 -12
- package/front_end/panels/issues/IssuesPane.ts +3 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +6 -0
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +17 -21
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +206 -126
- package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +1 -1
- package/front_end/panels/mobile_throttling/CalibrationController.ts +1 -1
- package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +3 -3
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +6 -6
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +11 -11
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +13 -13
- package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +10 -10
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +28 -28
- package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +6 -6
- package/front_end/panels/network/RequestHeadersView.ts +1 -1
- package/front_end/panels/network/ResourceChunkView.ts +243 -144
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +52 -29
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +21 -35
- package/front_end/panels/network/resourceChunkView.css +41 -36
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +21 -12
- package/front_end/panels/profiler/profiler.ts +4 -0
- package/front_end/panels/recorder/RecorderPanel.ts +6 -14
- package/front_end/panels/sensors/LocationsSettingsTab.ts +7 -7
- package/front_end/panels/settings/AISettingsTab.ts +75 -31
- package/front_end/panels/settings/SettingsScreen.ts +8 -13
- package/front_end/panels/settings/components/SyncSection.ts +3 -4
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +200 -18
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +18 -0
- package/front_end/panels/settings/settings-meta.ts +0 -1
- package/front_end/panels/sources/CategorizedBreakpointL10n.ts +0 -2
- package/front_end/panels/sources/DebuggerPausedMessage.ts +11 -5
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/EditingLocationHistoryManager.ts +12 -9
- package/front_end/panels/sources/SourcesPanel.ts +19 -17
- package/front_end/panels/sources/SourcesView.ts +191 -96
- package/front_end/panels/sources/TabbedEditorContainer.ts +3 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -5
- package/front_end/panels/timeline/TimelineUIUtils.ts +15 -0
- package/front_end/panels/timeline/timeline-meta.ts +3 -5
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +1332 -193
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
- package/front_end/tsconfig.compatibility.json +2 -1
- package/front_end/tsconfig.json +1 -1
- package/front_end/ui/components/icon_button/IconButton.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +4 -7
- package/front_end/ui/components/settings/settings.ts +1 -2
- package/front_end/ui/legacy/Treeoutline.ts +52 -30
- package/front_end/ui/legacy/components/object_ui/CSSStyleSanitizer.ts +74 -0
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +6 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +47 -54
- package/front_end/ui/legacy/components/object_ui/object_ui.ts +2 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +5 -27
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +10 -12
- package/front_end/ui/settings/SettingUIRegistration.ts +0 -8
- package/front_end/ui/visual_logging/KnownContextValues.ts +21 -0
- package/inspector_overlay/tsconfig.json +8 -2
- package/package.json +3 -2
- package/.agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py +0 -47
- package/front_end/core/sdk/CSSModel.test.api.ts +0 -102
- package/front_end/core/sdk/DOMModel.test.api.ts +0 -104
- package/front_end/foundation/Universe.test.api.ts +0 -73
- package/front_end/panels/application/SharedStorageEventsView.ts +0 -128
- package/front_end/panels/application/SharedStorageItemsView.ts +0 -179
- package/front_end/panels/application/SharedStorageListTreeElement.ts +0 -65
- package/front_end/panels/application/SharedStorageModel.ts +0 -249
- package/front_end/panels/application/SharedStorageTreeElement.ts +0 -40
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +0 -191
- package/front_end/panels/application/components/SharedStorageMetadataView.ts +0 -133
- package/front_end/panels/application/components/sharedStorageAccessGrid.css +0 -29
- package/front_end/panels/application/components/sharedStorageMetadataView.css +0 -29
- package/front_end/panels/application/sharedStorageEventsView.css +0 -9
- package/front_end/panels/network/OriginalResourceChunkView.ts +0 -340
- package/front_end/panels/network/originalResourceChunkView.css +0 -49
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +0 -47
- package/front_end/ui/components/settings/settingDeprecationWarning.css +0 -14
|
@@ -173,19 +173,15 @@ export interface Option {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
export class ExperimentsSupport {
|
|
176
|
-
#experiments
|
|
177
|
-
#hostExperiments = new Map<ExperimentName, HostExperiment>();
|
|
178
|
-
readonly #experimentNames = new Set<ExperimentName>();
|
|
176
|
+
#experiments = new Map<ExperimentName, Experiment>();
|
|
179
177
|
readonly #enabledForTests = new Set<ExperimentName>();
|
|
180
|
-
readonly #enabledByDefault = new Set<ExperimentName>();
|
|
181
|
-
readonly #serverEnabled = new Set<ExperimentName>();
|
|
182
178
|
readonly #storage = new ExperimentStorage();
|
|
183
179
|
|
|
184
|
-
allConfigurableExperiments():
|
|
185
|
-
return [...this.#experiments
|
|
180
|
+
allConfigurableExperiments(): Experiment[] {
|
|
181
|
+
return [...this.#experiments.values()];
|
|
186
182
|
}
|
|
187
183
|
|
|
188
|
-
|
|
184
|
+
register(params: {
|
|
189
185
|
name: ExperimentName,
|
|
190
186
|
title: string,
|
|
191
187
|
aboutFlag: string,
|
|
@@ -193,44 +189,18 @@ export class ExperimentsSupport {
|
|
|
193
189
|
requiresChromeRestart: boolean,
|
|
194
190
|
docLink?: Platform.DevToolsPath.UrlString,
|
|
195
191
|
readonly feedbackLink?: Platform.DevToolsPath.UrlString,
|
|
196
|
-
}):
|
|
197
|
-
if (this.#
|
|
192
|
+
}): Experiment {
|
|
193
|
+
if (this.#isExperiment(params.name)) {
|
|
198
194
|
throw new Error(`Duplicate registration of experiment '${params.name}'`);
|
|
199
195
|
}
|
|
200
|
-
const
|
|
201
|
-
this.#
|
|
202
|
-
return
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
register(experimentName: ExperimentName, experimentTitle: string, docLink?: string, feedbackLink?: string): void {
|
|
206
|
-
if (this.#isHostExperiment(experimentName) || this.#isExperiment(experimentName)) {
|
|
207
|
-
throw new Error(`Duplicate registration of experiment '${experimentName}'`);
|
|
208
|
-
}
|
|
209
|
-
this.#experimentNames.add(experimentName);
|
|
210
|
-
this.#experiments.push(new Experiment(
|
|
211
|
-
this, experimentName, experimentTitle,
|
|
212
|
-
docLink as Platform.DevToolsPath.UrlString ?? Platform.DevToolsPath.EmptyUrlString,
|
|
213
|
-
feedbackLink as Platform.DevToolsPath.UrlString ?? Platform.DevToolsPath.EmptyUrlString));
|
|
196
|
+
const experiment = new Experiment({...params, experiments: this});
|
|
197
|
+
this.#experiments.set(params.name, experiment);
|
|
198
|
+
return experiment;
|
|
214
199
|
}
|
|
215
200
|
|
|
216
201
|
isEnabled(experimentName: ExperimentName): boolean {
|
|
217
|
-
if (this.#isHostExperiment(experimentName)) {
|
|
218
|
-
return this.#enabledForTests.has(experimentName) ||
|
|
219
|
-
(this.#hostExperiments.get(experimentName)?.isEnabled() ?? false);
|
|
220
|
-
}
|
|
221
202
|
if (this.#isExperiment(experimentName)) {
|
|
222
|
-
|
|
223
|
-
// on the experiment enabled by default and we should respect that.
|
|
224
|
-
if (this.#storage.get(experimentName) === false) {
|
|
225
|
-
return false;
|
|
226
|
-
}
|
|
227
|
-
if (this.#enabledForTests.has(experimentName) || this.#enabledByDefault.has(experimentName)) {
|
|
228
|
-
return true;
|
|
229
|
-
}
|
|
230
|
-
if (this.#serverEnabled.has(experimentName)) {
|
|
231
|
-
return true;
|
|
232
|
-
}
|
|
233
|
-
return Boolean(this.#storage.get(experimentName));
|
|
203
|
+
return this.#enabledForTests.has(experimentName) || (this.#experiments.get(experimentName)?.isEnabled() ?? false);
|
|
234
204
|
}
|
|
235
205
|
throw new Error(`Unknown experiment '${experimentName}'`);
|
|
236
206
|
}
|
|
@@ -240,47 +210,22 @@ export class ExperimentsSupport {
|
|
|
240
210
|
}
|
|
241
211
|
|
|
242
212
|
setEnabled(experimentName: ExperimentName, enabled: boolean): void {
|
|
243
|
-
if (this.#isHostExperiment(experimentName)) {
|
|
244
|
-
this.#hostExperiments.get(experimentName)?.setEnabled(enabled);
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
213
|
if (this.#isExperiment(experimentName)) {
|
|
248
|
-
this.#
|
|
214
|
+
this.#experiments.get(experimentName)?.setEnabled(enabled);
|
|
249
215
|
return;
|
|
250
216
|
}
|
|
251
217
|
throw new Error(`Unknown experiment '${experimentName}'`);
|
|
252
218
|
}
|
|
253
219
|
|
|
254
|
-
// Only applicable to legacy experiments.
|
|
255
|
-
enableExperimentsByDefault(experimentNames: ExperimentName[]): void {
|
|
256
|
-
for (const experimentName of experimentNames) {
|
|
257
|
-
if (!this.#isExperiment(experimentName)) {
|
|
258
|
-
throw new Error(`Unknown (legacy) experiment '${experimentName}'`);
|
|
259
|
-
}
|
|
260
|
-
this.#enabledByDefault.add(experimentName);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
// Only applicable to legacy experiments.
|
|
265
|
-
setServerEnabledExperiments(experiments: string[]): void {
|
|
266
|
-
for (const experiment of experiments) {
|
|
267
|
-
const experimentName = experiment as ExperimentName;
|
|
268
|
-
if (!this.#isExperiment(experimentName)) {
|
|
269
|
-
throw new Error(`Unknown (legacy) experiment '${experimentName}'`);
|
|
270
|
-
}
|
|
271
|
-
this.#serverEnabled.add(experimentName);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
220
|
enableForTest(experimentName: ExperimentName): void {
|
|
276
|
-
if (!this.#
|
|
221
|
+
if (!this.#isExperiment(experimentName)) {
|
|
277
222
|
throw new Error(`Unknown experiment '${experimentName}'`);
|
|
278
223
|
}
|
|
279
224
|
this.#enabledForTests.add(experimentName);
|
|
280
225
|
}
|
|
281
226
|
|
|
282
227
|
disableForTest(experimentName: ExperimentName): void {
|
|
283
|
-
if (!this.#
|
|
228
|
+
if (!this.#isExperiment(experimentName)) {
|
|
284
229
|
throw new Error(`Unknown experiment '${experimentName}'`);
|
|
285
230
|
}
|
|
286
231
|
this.#enabledForTests.delete(experimentName);
|
|
@@ -291,27 +236,21 @@ export class ExperimentsSupport {
|
|
|
291
236
|
}
|
|
292
237
|
|
|
293
238
|
clearForTest(): void {
|
|
294
|
-
this.#experiments
|
|
295
|
-
this.#hostExperiments.clear();
|
|
296
|
-
this.#experimentNames.clear();
|
|
239
|
+
this.#experiments.clear();
|
|
297
240
|
this.#enabledForTests.clear();
|
|
298
|
-
this.#enabledByDefault.clear();
|
|
299
|
-
this.#serverEnabled.clear();
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
cleanUpStaleExperiments(): void {
|
|
303
|
-
this.#storage.cleanUpStaleExperiments(this.#experimentNames);
|
|
304
241
|
}
|
|
305
242
|
|
|
306
|
-
|
|
307
|
-
|
|
243
|
+
// TODO(crbug.com/464173054) remove after M156
|
|
244
|
+
removeAllExperimentsFromLocalStorage(): void {
|
|
245
|
+
this.#storage.removeAllExperimentsFromLocalStorage();
|
|
308
246
|
}
|
|
309
247
|
|
|
310
248
|
#isExperiment(experimentName: ExperimentName): boolean {
|
|
311
|
-
return this.#
|
|
249
|
+
return this.#experiments.has(experimentName);
|
|
312
250
|
}
|
|
313
251
|
}
|
|
314
252
|
|
|
253
|
+
// TODO(crbug.com/464173054) remove after M156
|
|
315
254
|
/** Manages the 'experiments' dictionary in globalThis.localStorage */
|
|
316
255
|
class ExperimentStorage {
|
|
317
256
|
readonly #experiments: Record<string, boolean|undefined> = {};
|
|
@@ -337,55 +276,12 @@ class ExperimentStorage {
|
|
|
337
276
|
return this.#experiments[experimentName];
|
|
338
277
|
}
|
|
339
278
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
this.#syncToLocalStorage();
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
cleanUpStaleExperiments(validExperiments: Set<string>): void {
|
|
346
|
-
for (const [key] of Object.entries(this.#experiments)) {
|
|
347
|
-
if (!validExperiments.has(key)) {
|
|
348
|
-
delete this.#experiments[key];
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
this.#syncToLocalStorage();
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
#syncToLocalStorage(): void {
|
|
355
|
-
Platform.HostRuntime.HOST_RUNTIME.getLocalStorage()?.setItem('experiments', JSON.stringify(this.#experiments));
|
|
279
|
+
removeAllExperimentsFromLocalStorage(): void {
|
|
280
|
+
Platform.HostRuntime.HOST_RUNTIME.getLocalStorage()?.removeItem('experiments');
|
|
356
281
|
}
|
|
357
282
|
}
|
|
358
283
|
|
|
359
|
-
/**
|
|
360
|
-
* @deprecated Experiments should not be used anymore, instead use base::Feature.
|
|
361
|
-
* See docs/contributing/settings-experiments-features.md
|
|
362
|
-
*/
|
|
363
284
|
export class Experiment {
|
|
364
|
-
name: ExperimentName;
|
|
365
|
-
title: string;
|
|
366
|
-
docLink?: Platform.DevToolsPath.UrlString;
|
|
367
|
-
readonly feedbackLink?: Platform.DevToolsPath.UrlString;
|
|
368
|
-
readonly #experiments: ExperimentsSupport;
|
|
369
|
-
constructor(
|
|
370
|
-
experiments: ExperimentsSupport, name: ExperimentName, title: string, docLink: Platform.DevToolsPath.UrlString,
|
|
371
|
-
feedbackLink: Platform.DevToolsPath.UrlString) {
|
|
372
|
-
this.name = name;
|
|
373
|
-
this.title = title;
|
|
374
|
-
this.docLink = docLink;
|
|
375
|
-
this.feedbackLink = feedbackLink;
|
|
376
|
-
this.#experiments = experiments;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
isEnabled(): boolean {
|
|
380
|
-
return this.#experiments.isEnabled(this.name);
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
setEnabled(enabled: boolean): void {
|
|
384
|
-
this.#experiments.setEnabled(this.name, enabled);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
export class HostExperiment {
|
|
389
285
|
name: ExperimentName;
|
|
390
286
|
title: string;
|
|
391
287
|
readonly #experiments: ExperimentsSupport;
|
|
@@ -536,13 +432,6 @@ export interface HostConfigVeLogging {
|
|
|
536
432
|
testing: boolean;
|
|
537
433
|
}
|
|
538
434
|
|
|
539
|
-
/**
|
|
540
|
-
* @see https://goo.gle/devtools-json-design
|
|
541
|
-
*/
|
|
542
|
-
export interface HostConfigWellKnown {
|
|
543
|
-
enabled: boolean;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
435
|
export interface HostConfigPrivacyUI {
|
|
547
436
|
enabled: boolean;
|
|
548
437
|
}
|
|
@@ -678,7 +567,6 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
|
|
|
678
567
|
devToolsAiCodeGeneration: HostConfigAiCodeGeneration,
|
|
679
568
|
devToolsAiCodeCompletionStyles: HostConfigAiCodeCompletionStyles,
|
|
680
569
|
devToolsVeLogging: HostConfigVeLogging,
|
|
681
|
-
devToolsWellKnown: HostConfigWellKnown,
|
|
682
570
|
/**
|
|
683
571
|
* OffTheRecord here indicates that the user's profile is either incognito,
|
|
684
572
|
* or guest mode, rather than a "normal" profile.
|
|
@@ -485,15 +485,15 @@ export function cssMetadata(): CSSMetadata {
|
|
|
485
485
|
* <conic-gradient()> | <repeating-conic-gradient()> ]
|
|
486
486
|
*/
|
|
487
487
|
const imageValuePresetMap = new Map([
|
|
488
|
-
['linear-gradient
|
|
489
|
-
['radial-gradient
|
|
490
|
-
['conic-gradient
|
|
491
|
-
['repeating-linear-gradient
|
|
492
|
-
['repeating-radial-gradient
|
|
493
|
-
['repeating-conic-gradient
|
|
494
|
-
['url
|
|
495
|
-
['image-set
|
|
496
|
-
['cross-fade
|
|
488
|
+
['linear-gradient', 'linear-gradient(|45deg, black, transparent|)'],
|
|
489
|
+
['radial-gradient', 'radial-gradient(|black, transparent|)'],
|
|
490
|
+
['conic-gradient', 'conic-gradient(|from 45deg, red, orange, yellow, green, teal, blue, purple|)'],
|
|
491
|
+
['repeating-linear-gradient', 'repeating-linear-gradient(|45deg, black, transparent 100px|)'],
|
|
492
|
+
['repeating-radial-gradient', 'repeating-radial-gradient(|black, transparent 100px|)'],
|
|
493
|
+
['repeating-conic-gradient', 'repeating-conic-gradient(|black 0deg 25%, white 0deg 50%|)'], // Checkerboard
|
|
494
|
+
['url', 'url(||)'],
|
|
495
|
+
['image-set', 'image-set(|url("") 1x, url("") 2x|)'],
|
|
496
|
+
['cross-fade', 'cross-fade(|url("") 50%, url("") 50%|)'],
|
|
497
497
|
]);
|
|
498
498
|
|
|
499
499
|
const filterValuePresetMap = new Map([
|
|
@@ -524,7 +524,7 @@ const valuePresets = new Map([
|
|
|
524
524
|
['-webkit-mask-image', imageValuePresetMap],
|
|
525
525
|
['list-style', imageValuePresetMap],
|
|
526
526
|
['list-style-image', imageValuePresetMap],
|
|
527
|
-
['border-image', imageValuePresetMap],
|
|
527
|
+
['border-image', new Map([...imageValuePresetMap, ['fill', 'fill 10%']])],
|
|
528
528
|
['border-image-source', imageValuePresetMap],
|
|
529
529
|
[
|
|
530
530
|
'transform',
|
|
@@ -617,6 +617,12 @@ const valuePresets = new Map([
|
|
|
617
617
|
['ex', 'ex alphabetic'],
|
|
618
618
|
]),
|
|
619
619
|
],
|
|
620
|
+
[
|
|
621
|
+
'border-image-slice',
|
|
622
|
+
new Map([
|
|
623
|
+
['fill', 'fill 10%'],
|
|
624
|
+
]),
|
|
625
|
+
],
|
|
620
626
|
]);
|
|
621
627
|
|
|
622
628
|
const partialValueKeywordsNoPresets = new Map<string, Set<string>>([
|
|
@@ -898,17 +904,16 @@ const extraPropertyValues = new Map<string, Set<string>>([
|
|
|
898
904
|
'stretch',
|
|
899
905
|
'space',
|
|
900
906
|
'round',
|
|
901
|
-
'auto', // border-image-width
|
|
902
907
|
'fill', // border-image-slice
|
|
903
|
-
'linear-gradient
|
|
904
|
-
'radial-gradient
|
|
905
|
-
'conic-gradient
|
|
906
|
-
'repeating-linear-gradient
|
|
907
|
-
'repeating-radial-gradient
|
|
908
|
-
'repeating-conic-gradient
|
|
909
|
-
'image-set
|
|
910
|
-
'cross-fade
|
|
911
|
-
'url
|
|
908
|
+
'linear-gradient',
|
|
909
|
+
'radial-gradient',
|
|
910
|
+
'conic-gradient',
|
|
911
|
+
'repeating-linear-gradient',
|
|
912
|
+
'repeating-radial-gradient',
|
|
913
|
+
'repeating-conic-gradient',
|
|
914
|
+
'image-set',
|
|
915
|
+
'cross-fade',
|
|
916
|
+
'url',
|
|
912
917
|
]),
|
|
913
918
|
],
|
|
914
919
|
['border-image-width', new Set(['auto'])],
|
|
@@ -917,15 +922,15 @@ const extraPropertyValues = new Map<string, Set<string>>([
|
|
|
917
922
|
'border-image-source',
|
|
918
923
|
new Set([
|
|
919
924
|
'none',
|
|
920
|
-
'linear-gradient
|
|
921
|
-
'radial-gradient
|
|
922
|
-
'conic-gradient
|
|
923
|
-
'repeating-linear-gradient
|
|
924
|
-
'repeating-radial-gradient
|
|
925
|
-
'repeating-conic-gradient
|
|
926
|
-
'image-set
|
|
927
|
-
'cross-fade
|
|
928
|
-
'url
|
|
925
|
+
'linear-gradient',
|
|
926
|
+
'radial-gradient',
|
|
927
|
+
'conic-gradient',
|
|
928
|
+
'repeating-linear-gradient',
|
|
929
|
+
'repeating-radial-gradient',
|
|
930
|
+
'repeating-conic-gradient',
|
|
931
|
+
'image-set',
|
|
932
|
+
'cross-fade',
|
|
933
|
+
'url',
|
|
929
934
|
]),
|
|
930
935
|
],
|
|
931
936
|
[
|
|
@@ -1241,29 +1246,29 @@ const extraPropertyValues = new Map<string, Set<string>>([
|
|
|
1241
1246
|
'content-box',
|
|
1242
1247
|
'padding-box',
|
|
1243
1248
|
'text', // background-clip
|
|
1244
|
-
'linear-gradient
|
|
1245
|
-
'radial-gradient
|
|
1246
|
-
'conic-gradient
|
|
1247
|
-
'repeating-linear-gradient
|
|
1248
|
-
'repeating-radial-gradient
|
|
1249
|
-
'repeating-conic-gradient
|
|
1250
|
-
'image-set
|
|
1251
|
-
'cross-fade
|
|
1252
|
-
'url
|
|
1249
|
+
'linear-gradient',
|
|
1250
|
+
'radial-gradient',
|
|
1251
|
+
'conic-gradient',
|
|
1252
|
+
'repeating-linear-gradient',
|
|
1253
|
+
'repeating-radial-gradient',
|
|
1254
|
+
'repeating-conic-gradient',
|
|
1255
|
+
'image-set',
|
|
1256
|
+
'cross-fade',
|
|
1257
|
+
'url',
|
|
1253
1258
|
]),
|
|
1254
1259
|
],
|
|
1255
1260
|
[
|
|
1256
1261
|
'background-image',
|
|
1257
1262
|
new Set([
|
|
1258
|
-
'linear-gradient
|
|
1259
|
-
'radial-gradient
|
|
1260
|
-
'conic-gradient
|
|
1261
|
-
'repeating-linear-gradient
|
|
1262
|
-
'repeating-radial-gradient
|
|
1263
|
-
'repeating-conic-gradient
|
|
1264
|
-
'image-set
|
|
1265
|
-
'cross-fade
|
|
1266
|
-
'url
|
|
1263
|
+
'linear-gradient',
|
|
1264
|
+
'radial-gradient',
|
|
1265
|
+
'conic-gradient',
|
|
1266
|
+
'repeating-linear-gradient',
|
|
1267
|
+
'repeating-radial-gradient',
|
|
1268
|
+
'repeating-conic-gradient',
|
|
1269
|
+
'image-set',
|
|
1270
|
+
'cross-fade',
|
|
1271
|
+
'url',
|
|
1267
1272
|
]),
|
|
1268
1273
|
],
|
|
1269
1274
|
['background-position', new Set(['top', 'bottom', 'left', 'right', 'center'])],
|
|
@@ -1519,29 +1524,29 @@ const extraPropertyValues = new Map<string, Set<string>>([
|
|
|
1519
1524
|
[
|
|
1520
1525
|
'mask-image',
|
|
1521
1526
|
new Set([
|
|
1522
|
-
'linear-gradient
|
|
1523
|
-
'radial-gradient
|
|
1524
|
-
'conic-gradient
|
|
1525
|
-
'repeating-linear-gradient
|
|
1526
|
-
'repeating-radial-gradient
|
|
1527
|
-
'repeating-conic-gradient
|
|
1528
|
-
'image-set
|
|
1529
|
-
'cross-fade
|
|
1530
|
-
'url
|
|
1527
|
+
'linear-gradient',
|
|
1528
|
+
'radial-gradient',
|
|
1529
|
+
'conic-gradient',
|
|
1530
|
+
'repeating-linear-gradient',
|
|
1531
|
+
'repeating-radial-gradient',
|
|
1532
|
+
'repeating-conic-gradient',
|
|
1533
|
+
'image-set',
|
|
1534
|
+
'cross-fade',
|
|
1535
|
+
'url',
|
|
1531
1536
|
]),
|
|
1532
1537
|
],
|
|
1533
1538
|
[
|
|
1534
1539
|
'-webkit-mask-image',
|
|
1535
1540
|
new Set([
|
|
1536
|
-
'linear-gradient
|
|
1537
|
-
'radial-gradient
|
|
1538
|
-
'conic-gradient
|
|
1539
|
-
'repeating-linear-gradient
|
|
1540
|
-
'repeating-radial-gradient
|
|
1541
|
-
'repeating-conic-gradient
|
|
1542
|
-
'image-set
|
|
1543
|
-
'cross-fade
|
|
1544
|
-
'url
|
|
1541
|
+
'linear-gradient',
|
|
1542
|
+
'radial-gradient',
|
|
1543
|
+
'conic-gradient',
|
|
1544
|
+
'repeating-linear-gradient',
|
|
1545
|
+
'repeating-radial-gradient',
|
|
1546
|
+
'repeating-conic-gradient',
|
|
1547
|
+
'image-set',
|
|
1548
|
+
'cross-fade',
|
|
1549
|
+
'url',
|
|
1545
1550
|
]),
|
|
1546
1551
|
],
|
|
1547
1552
|
['-webkit-mask-origin', new Set(['border', 'border-box', 'content', 'content-box', 'padding', 'padding-box'])],
|
|
@@ -21,7 +21,6 @@ export const enum Category {
|
|
|
21
21
|
PICTURE_IN_PICTURE = 'picture-in-picture',
|
|
22
22
|
POINTER = 'pointer',
|
|
23
23
|
SCRIPT = 'script',
|
|
24
|
-
SHARED_STORAGE_WORKLET = 'shared-storage-worklet',
|
|
25
24
|
TIMER = 'timer',
|
|
26
25
|
TOUCH = 'touch',
|
|
27
26
|
TRUSTED_TYPE_VIOLATION = 'trusted-type-violation',
|
|
@@ -182,8 +182,6 @@ export class ChildTargetManager extends SDKModel<EventTypes> implements Protocol
|
|
|
182
182
|
type = Type.WORKLET;
|
|
183
183
|
} else if (targetInfo.type === 'shared_worker') {
|
|
184
184
|
type = Type.SHARED_WORKER;
|
|
185
|
-
} else if (targetInfo.type === 'shared_storage_worklet') {
|
|
186
|
-
type = Type.SHARED_STORAGE_WORKLET;
|
|
187
185
|
} else if (targetInfo.type === 'service_worker') {
|
|
188
186
|
type = Type.ServiceWorker;
|
|
189
187
|
} else if (targetInfo.type === 'auction_worklet') {
|
|
@@ -164,12 +164,10 @@ export class EmulationModel extends SDKModel<EmulationModelEventTypes> implement
|
|
|
164
164
|
const autoDarkModeSetting = settings.moduleSetting('emulate-auto-dark-mode');
|
|
165
165
|
autoDarkModeSetting.addChangeListener(() => {
|
|
166
166
|
const enabled = autoDarkModeSetting.get();
|
|
167
|
-
mediaFeaturePrefersColorSchemeSetting.setDisabled(enabled);
|
|
168
167
|
mediaFeaturePrefersColorSchemeSetting.set(enabled ? 'dark' : '');
|
|
169
168
|
void this.emulateAutoDarkMode(enabled);
|
|
170
169
|
});
|
|
171
170
|
if (autoDarkModeSetting.get()) {
|
|
172
|
-
mediaFeaturePrefersColorSchemeSetting.setDisabled(true);
|
|
173
171
|
mediaFeaturePrefersColorSchemeSetting.set('dark');
|
|
174
172
|
void this.emulateAutoDarkMode(true);
|
|
175
173
|
}
|
|
@@ -24,7 +24,6 @@ export const enum InstrumentationNames {
|
|
|
24
24
|
SET_INTERVAL_CALLBACK = 'setInterval.callback',
|
|
25
25
|
SCRIPT_FIRST_STATEMENT = 'scriptFirstStatement',
|
|
26
26
|
SCRIPT_BLOCKED_BY_CSP = 'scriptBlockedByCSP',
|
|
27
|
-
SHARED_STORAGE_WORKLET_SCRIPT_FIRST_STATEMENT = 'sharedStorageWorkletScriptFirstStatement',
|
|
28
27
|
REQUEST_ANIMATION_FRAME = 'requestAnimationFrame',
|
|
29
28
|
CANCEL_ANIMATION_FRAME = 'cancelAnimationFrame',
|
|
30
29
|
REQUEST_ANIMATION_FRAME_CALLBACK = 'requestAnimationFrame.callback',
|
|
@@ -122,9 +121,6 @@ export class EventBreakpointsManager implements SDKModelObserver<EventBreakpoint
|
|
|
122
121
|
InstrumentationNames.SCRIPT_FIRST_STATEMENT,
|
|
123
122
|
InstrumentationNames.SCRIPT_BLOCKED_BY_CSP,
|
|
124
123
|
]);
|
|
125
|
-
this.createInstrumentationBreakpoints(Category.SHARED_STORAGE_WORKLET, [
|
|
126
|
-
InstrumentationNames.SHARED_STORAGE_WORKLET_SCRIPT_FIRST_STATEMENT,
|
|
127
|
-
]);
|
|
128
124
|
this.createInstrumentationBreakpoints(Category.TIMER, [
|
|
129
125
|
InstrumentationNames.SET_TIMEOUT,
|
|
130
126
|
InstrumentationNames.CLEAR_TIMEOUT,
|
|
@@ -1207,9 +1207,6 @@ export class NetworkDispatcher implements ProtocolProxyApi.NetworkDispatcher {
|
|
|
1207
1207
|
networkRequest.addEventSourceMessage(time, eventName, eventId, data);
|
|
1208
1208
|
}
|
|
1209
1209
|
|
|
1210
|
-
requestIntercepted({}: Protocol.Network.RequestInterceptedEvent): void {
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
1210
|
requestWillBeSentExtraInfo({
|
|
1214
1211
|
requestId,
|
|
1215
1212
|
associatedCookies,
|
|
@@ -336,8 +336,12 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
336
336
|
initiator.target;
|
|
337
337
|
Host.userMetrics.developerResourceScheme(this.getDeveloperResourceScheme(parsedURL));
|
|
338
338
|
if (eligibleForLoadFromTarget) {
|
|
339
|
-
let mustEnforceCSP = false;
|
|
340
339
|
const isHttp = parsedURL.scheme === 'http' || parsedURL.scheme === 'https';
|
|
340
|
+
// Default to enforcing CSP for http(s) resources (fail-closed). Only relax
|
|
341
|
+
// if the isolation-status query positively confirms no connect-src/default-src
|
|
342
|
+
// directive is present. A null/error response keeps the guard armed so that a
|
|
343
|
+
// detached-frame or protocol-error path cannot fall through to loadFromHostBindings.
|
|
344
|
+
let mustEnforceCSP = isHttp;
|
|
341
345
|
if (isHttp && initiator.target) {
|
|
342
346
|
const networkManager = initiator.target.model(NetworkManager);
|
|
343
347
|
if (networkManager) {
|
|
@@ -345,14 +349,10 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
345
349
|
if (!status && initiator.frameId) {
|
|
346
350
|
status = await networkManager.getSecurityIsolationStatus(null);
|
|
347
351
|
}
|
|
348
|
-
if (status
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
mustEnforceCSP = true;
|
|
353
|
-
break;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
352
|
+
if (status) {
|
|
353
|
+
const csps = status.csp ?? [];
|
|
354
|
+
mustEnforceCSP = csps.some(csp => csp.effectiveDirectives.includes('connect-src') ||
|
|
355
|
+
csp.effectiveDirectives.includes('default-src'));
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
}
|
|
@@ -53,6 +53,35 @@ const UIStrings = {
|
|
|
53
53
|
const str_ = i18n.i18n.registerUIStrings('core/sdk/RehydratingConnection.ts', UIStrings);
|
|
54
54
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* The `traceURL` (and legacy `loadTimelineFromURL`) query parameter is attacker-controllable, and its
|
|
58
|
+
* fetched response is replayed into the trusted DevTools front-end as synthetic CDP events. Rather
|
|
59
|
+
* than relying solely on the page-wide `connect-src` CSP, restrict fetches to trusted locations:
|
|
60
|
+
* - the same origin as the DevTools front-end,
|
|
61
|
+
* - the `devtools:` scheme (bundled resources),
|
|
62
|
+
* - a loopback address, the documented way to load a local trace while developing
|
|
63
|
+
* (see front_end/panels/timeline/README.md).
|
|
64
|
+
*/
|
|
65
|
+
export function isTraceUrlAllowed(traceUrl: string): boolean {
|
|
66
|
+
let url: URL;
|
|
67
|
+
try {
|
|
68
|
+
url = new URL(traceUrl, window.location.href);
|
|
69
|
+
} catch {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
if (url.protocol === 'devtools:') {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
if (url.origin === window.location.origin) {
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
if (url.protocol === 'http:' || url.protocol === 'https:') {
|
|
79
|
+
const host = url.hostname.toLowerCase();
|
|
80
|
+
return host === 'localhost' || host === '127.0.0.1' || host === '[::1]';
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
|
|
56
85
|
export interface RehydratingConnectionInterface {
|
|
57
86
|
postToFrontend: (arg: ServerMessage) => void;
|
|
58
87
|
}
|
|
@@ -69,6 +98,12 @@ export class RehydratingConnectionTransport implements ProtocolClient.Connection
|
|
|
69
98
|
onMessage: ((arg0: Object) => void)|null = null;
|
|
70
99
|
trace: TraceObject|null = null;
|
|
71
100
|
sessions = new Map<number, RehydratingSessionBase>();
|
|
101
|
+
/**
|
|
102
|
+
* Set to the in-flight `traceURL` fetch (including its hydration/error handling) so tests can await
|
|
103
|
+
* the load deterministically. Stays `undefined` when loading via message passing, or when a
|
|
104
|
+
* disallowed URL is rejected without fetching.
|
|
105
|
+
*/
|
|
106
|
+
fetchPromiseForTest?: Promise<void>;
|
|
72
107
|
#onConnectionLost: (message: Platform.UIString.LocalizedString) => void;
|
|
73
108
|
#rehydratingWindow = window;
|
|
74
109
|
#onReceiveHostWindowPayloadBound = this.onReceiveHostWindowPayload.bind(this);
|
|
@@ -94,10 +129,23 @@ export class RehydratingConnectionTransport implements ProtocolClient.Connection
|
|
|
94
129
|
}
|
|
95
130
|
|
|
96
131
|
if (traceUrl) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
132
|
+
// `traceUrl` comes from the page query string and its response is replayed into the trusted
|
|
133
|
+
// front-end as synthetic CDP events. Only fetch from trusted origins instead of relying on the
|
|
134
|
+
// page CSP alone.
|
|
135
|
+
if (!isTraceUrlAllowed(traceUrl)) {
|
|
136
|
+
this.#onConnectionLost(i18nString(UIStrings.errorLoadingLog));
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
this.fetchPromiseForTest = fetch(traceUrl)
|
|
140
|
+
.then(r => r.arrayBuffer())
|
|
141
|
+
.then(b => Common.Gzip.arrayBufferToString(b))
|
|
142
|
+
.then(async traceJson => {
|
|
143
|
+
const trace = new TraceObject(JSON.parse(traceJson));
|
|
144
|
+
await this.startHydration(trace);
|
|
145
|
+
})
|
|
146
|
+
.catch(() => {
|
|
147
|
+
this.#onConnectionLost(i18nString(UIStrings.errorLoadingLog));
|
|
148
|
+
});
|
|
101
149
|
return true;
|
|
102
150
|
}
|
|
103
151
|
|
|
@@ -80,9 +80,6 @@ export class Target extends ProtocolClient.InspectorBackend.TargetBase {
|
|
|
80
80
|
this.#capabilitiesMask |= Capability.STORAGE;
|
|
81
81
|
}
|
|
82
82
|
break;
|
|
83
|
-
case Type.SHARED_STORAGE_WORKLET:
|
|
84
|
-
this.#capabilitiesMask = Capability.JS | Capability.LOG | Capability.INSPECTOR | Capability.EVENT_BREAKPOINTS;
|
|
85
|
-
break;
|
|
86
83
|
case Type.Worker:
|
|
87
84
|
this.#capabilitiesMask = Capability.JS | Capability.LOG | Capability.NETWORK | Capability.TARGET |
|
|
88
85
|
Capability.IO | Capability.MEDIA | Capability.EMULATION | Capability.EVENT_BREAKPOINTS;
|
|
@@ -291,7 +288,6 @@ export enum Type {
|
|
|
291
288
|
// eslint-disable-next-line @typescript-eslint/naming-convention -- Used by web_tests.
|
|
292
289
|
Worker = 'worker',
|
|
293
290
|
SHARED_WORKER = 'shared-worker',
|
|
294
|
-
SHARED_STORAGE_WORKLET = 'shared-storage-worklet',
|
|
295
291
|
NODE = 'node',
|
|
296
292
|
BROWSER = 'browser',
|
|
297
293
|
AUCTION_WORKLET = 'auction-worklet',
|