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
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// Copyright 2025 The Chromium Authors
|
|
3
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
// found in the LICENSE file.
|
|
5
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
6
|
-
|
|
7
|
-
import * as Common from '../../core/common/common.js';
|
|
8
|
-
import * as Host from '../../core/host/host.js';
|
|
9
|
-
import * as i18n from '../../core/i18n/i18n.js';
|
|
10
|
-
import * as Platform from '../../core/platform/platform.js';
|
|
11
|
-
import type * as SDK from '../../core/sdk/sdk.js';
|
|
12
|
-
import * as TextUtils from '../../core/text_utils/text_utils.js';
|
|
13
|
-
import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
|
|
14
|
-
import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
15
|
-
import * as UI from '../../ui/legacy/legacy.js';
|
|
16
|
-
|
|
17
|
-
import type {BinaryResourceView} from './BinaryResourceView.js';
|
|
18
|
-
import viewStyles from './originalResourceChunkView.css.js';
|
|
19
|
-
|
|
20
|
-
const UIStrings = {
|
|
21
|
-
/**
|
|
22
|
-
* @description Text in Event Source Messages View of the Network panel
|
|
23
|
-
*/
|
|
24
|
-
data: 'Data',
|
|
25
|
-
/**
|
|
26
|
-
* @description Text in Messages View of the Network panel
|
|
27
|
-
*/
|
|
28
|
-
length: 'Length',
|
|
29
|
-
/**
|
|
30
|
-
* @description Text that refers to the time
|
|
31
|
-
*/
|
|
32
|
-
time: 'Time',
|
|
33
|
-
/**
|
|
34
|
-
* @description Text to clear everything
|
|
35
|
-
*/
|
|
36
|
-
clearAll: 'Clear All',
|
|
37
|
-
/**
|
|
38
|
-
* @description Text to filter result items
|
|
39
|
-
*/
|
|
40
|
-
filter: 'Filter',
|
|
41
|
-
/**
|
|
42
|
-
* @description Text in Messages View of the Network panel that shows if no message is selected for viewing its content
|
|
43
|
-
*/
|
|
44
|
-
noMessageSelected: 'No message selected',
|
|
45
|
-
/**
|
|
46
|
-
* @description Text in Messages View of the Network panel
|
|
47
|
-
*/
|
|
48
|
-
selectMessageToBrowseItsContent: 'Select message to browse its content.',
|
|
49
|
-
/**
|
|
50
|
-
* @description Text in Messages View of the Network panel
|
|
51
|
-
*/
|
|
52
|
-
copyMessageD: 'Copy message…',
|
|
53
|
-
/**
|
|
54
|
-
* @description A context menu item in the Messages View of the Network panel
|
|
55
|
-
*/
|
|
56
|
-
copyMessage: 'Copy message',
|
|
57
|
-
/**
|
|
58
|
-
* @description Text for everything
|
|
59
|
-
*/
|
|
60
|
-
all: 'All',
|
|
61
|
-
/**
|
|
62
|
-
* @description Text in Messages View of the Network panel
|
|
63
|
-
*/
|
|
64
|
-
send: 'Send',
|
|
65
|
-
/**
|
|
66
|
-
* @description Text in Messages View of the Network panel
|
|
67
|
-
*/
|
|
68
|
-
receive: 'Receive',
|
|
69
|
-
} as const;
|
|
70
|
-
const str_ = i18n.i18n.registerUIStrings('panels/network/OriginalResourceChunkView.ts', UIStrings);
|
|
71
|
-
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
72
|
-
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
73
|
-
|
|
74
|
-
export abstract class OriginalResourceChunkView<Chunk> extends UI.Widget.VBox {
|
|
75
|
-
private readonly splitWidget: UI.SplitWidget.SplitWidget;
|
|
76
|
-
private dataGrid: DataGrid.SortableDataGrid.SortableDataGrid<unknown>;
|
|
77
|
-
private readonly timeComparator: (arg0: DataGrid.SortableDataGrid.SortableDataGridNode<DataGridItem>,
|
|
78
|
-
arg1: DataGrid.SortableDataGrid.SortableDataGridNode<DataGridItem>) => number;
|
|
79
|
-
private readonly mainToolbar: UI.Toolbar.Toolbar;
|
|
80
|
-
private readonly clearAllButton: UI.Toolbar.ToolbarButton;
|
|
81
|
-
private readonly filterTypeCombobox: UI.Toolbar.ToolbarComboBox;
|
|
82
|
-
protected filterType: string|null = null;
|
|
83
|
-
private readonly filterTextInput: UI.Toolbar.ToolbarInput;
|
|
84
|
-
protected filterRegex: RegExp|null = null;
|
|
85
|
-
private readonly frameEmptyWidget: UI.EmptyWidget.EmptyWidget;
|
|
86
|
-
private currentSelectedNode?: DataGridItem|null;
|
|
87
|
-
readonly request: SDK.NetworkRequest.NetworkRequest;
|
|
88
|
-
private readonly messageFilterSetting: Common.Settings.Setting<string>;
|
|
89
|
-
private sidebarWidget: UI.Widget.Widget|null = null;
|
|
90
|
-
|
|
91
|
-
abstract getRequestChunks(): Chunk[];
|
|
92
|
-
abstract createGridItem(chunk: Chunk): DataGridItem;
|
|
93
|
-
abstract chunkFilter(chunk: Chunk): boolean;
|
|
94
|
-
|
|
95
|
-
constructor(request: SDK.NetworkRequest.NetworkRequest, messageFilterSettingKey: string,
|
|
96
|
-
splitWidgetSettingKey: string, dataGridDisplayName: Common.UIString.LocalizedString,
|
|
97
|
-
filterUsingRegexHint: Common.UIString.LocalizedString) {
|
|
98
|
-
super();
|
|
99
|
-
this.messageFilterSetting = Common.Settings.Settings.instance().createSetting(messageFilterSettingKey, '');
|
|
100
|
-
this.registerRequiredCSS(viewStyles);
|
|
101
|
-
this.request = request;
|
|
102
|
-
this.element.classList.add('resource-chunk-view');
|
|
103
|
-
|
|
104
|
-
this.splitWidget = new UI.SplitWidget.SplitWidget(false, true, splitWidgetSettingKey);
|
|
105
|
-
this.splitWidget.show(this.element);
|
|
106
|
-
|
|
107
|
-
const columns: DataGrid.DataGrid.ColumnDescriptor[] = this.getColumns();
|
|
108
|
-
|
|
109
|
-
this.dataGrid = new DataGrid.SortableDataGrid.SortableDataGrid({
|
|
110
|
-
displayName: dataGridDisplayName,
|
|
111
|
-
columns,
|
|
112
|
-
});
|
|
113
|
-
this.dataGrid.setRowContextMenuCallback((menu, node) => this.onRowContextMenu(menu, node));
|
|
114
|
-
this.dataGrid.setEnableAutoScrollToBottom(true);
|
|
115
|
-
this.dataGrid.setCellClass('resource-chunk-view-td');
|
|
116
|
-
this.timeComparator = (resourceChunkNodeTimeComparator as
|
|
117
|
-
(arg0: DataGrid.SortableDataGrid.SortableDataGridNode<DataGridItem>,
|
|
118
|
-
arg1: DataGrid.SortableDataGrid.SortableDataGridNode<DataGridItem>) => number);
|
|
119
|
-
this.dataGrid.sortNodes(this.timeComparator, false);
|
|
120
|
-
this.dataGrid.markColumnAsSortedBy('time', DataGrid.DataGrid.Order.Ascending);
|
|
121
|
-
this.dataGrid.addEventListener(DataGrid.DataGrid.Events.SORTING_CHANGED, this.sortItems, this);
|
|
122
|
-
|
|
123
|
-
this.dataGrid.setName(splitWidgetSettingKey + '_datagrid');
|
|
124
|
-
this.dataGrid.addEventListener(DataGrid.DataGrid.Events.SELECTED_NODE, event => {
|
|
125
|
-
void this.onChunkSelected(event);
|
|
126
|
-
}, this);
|
|
127
|
-
this.dataGrid.addEventListener(DataGrid.DataGrid.Events.DESELECTED_NODE, this.onChunkDeselected, this);
|
|
128
|
-
|
|
129
|
-
this.mainToolbar = document.createElement('devtools-toolbar');
|
|
130
|
-
|
|
131
|
-
this.clearAllButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.clearAll), 'clear');
|
|
132
|
-
this.clearAllButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, this.clearChunks, this);
|
|
133
|
-
this.mainToolbar.appendToolbarItem(this.clearAllButton);
|
|
134
|
-
|
|
135
|
-
this.filterTypeCombobox =
|
|
136
|
-
new UI.Toolbar.ToolbarComboBox(this.onFilterTypeChanged.bind(this), i18nString(UIStrings.filter));
|
|
137
|
-
for (const filterItem of FILTER_TYPES) {
|
|
138
|
-
const option = this.filterTypeCombobox.createOption(filterItem.label(), filterItem.name);
|
|
139
|
-
this.filterTypeCombobox.addOption(option);
|
|
140
|
-
}
|
|
141
|
-
this.mainToolbar.appendToolbarItem(this.filterTypeCombobox);
|
|
142
|
-
|
|
143
|
-
this.filterTextInput = new UI.Toolbar.ToolbarFilter(filterUsingRegexHint, 0.4);
|
|
144
|
-
this.filterTextInput.addEventListener(UI.Toolbar.ToolbarInput.Event.TEXT_CHANGED, this.onFilterTextChanged, this);
|
|
145
|
-
const filter = this.messageFilterSetting.get();
|
|
146
|
-
if (filter) {
|
|
147
|
-
this.filterTextInput.setValue(filter);
|
|
148
|
-
}
|
|
149
|
-
this.mainToolbar.appendToolbarItem(this.filterTextInput);
|
|
150
|
-
|
|
151
|
-
const mainContainer = new UI.Widget.VBox();
|
|
152
|
-
mainContainer.element.appendChild(this.mainToolbar);
|
|
153
|
-
this.dataGrid.asWidget().show(mainContainer.element);
|
|
154
|
-
mainContainer.setMinimumSize(0, 72);
|
|
155
|
-
this.splitWidget.setMainWidget(mainContainer);
|
|
156
|
-
|
|
157
|
-
this.frameEmptyWidget = new UI.EmptyWidget.EmptyWidget(i18nString(UIStrings.noMessageSelected),
|
|
158
|
-
i18nString(UIStrings.selectMessageToBrowseItsContent));
|
|
159
|
-
this.sidebarWidget = this.frameEmptyWidget;
|
|
160
|
-
this.splitWidget.setSidebarWidget(this.sidebarWidget);
|
|
161
|
-
|
|
162
|
-
if (filter) {
|
|
163
|
-
this.applyFilter(filter);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
private onRowContextMenu(contextMenu: UI.ContextMenu.ContextMenu,
|
|
168
|
-
node: DataGrid.DataGrid.DataGridNode<unknown>): void {
|
|
169
|
-
const item = node as DataGridItem;
|
|
170
|
-
const binaryView = item.binaryView();
|
|
171
|
-
if (binaryView) {
|
|
172
|
-
binaryView.addCopyToContextMenu(contextMenu, i18nString(UIStrings.copyMessageD));
|
|
173
|
-
} else {
|
|
174
|
-
const dataVal = item.data.data;
|
|
175
|
-
const textToCopy = typeof dataVal === 'string' ? dataVal : item.dataText();
|
|
176
|
-
contextMenu.clipboardSection().appendItem(
|
|
177
|
-
i18nString(UIStrings.copyMessage),
|
|
178
|
-
Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText.bind(
|
|
179
|
-
Host.InspectorFrontendHost.InspectorFrontendHostInstance, textToCopy),
|
|
180
|
-
{jslogContext: 'copy'});
|
|
181
|
-
}
|
|
182
|
-
contextMenu.footerSection().appendItem(i18nString(UIStrings.clearAll), this.clearChunks.bind(this),
|
|
183
|
-
{jslogContext: 'clear-all'});
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
getColumns(): DataGrid.DataGrid.ColumnDescriptor[] {
|
|
187
|
-
return [
|
|
188
|
-
{id: 'data', title: i18nString(UIStrings.data), sortable: false, weight: 88},
|
|
189
|
-
{
|
|
190
|
-
id: 'length',
|
|
191
|
-
title: i18nString(UIStrings.length),
|
|
192
|
-
sortable: false,
|
|
193
|
-
align: DataGrid.DataGrid.Align.RIGHT,
|
|
194
|
-
weight: 5,
|
|
195
|
-
},
|
|
196
|
-
{id: 'time', title: i18nString(UIStrings.time), sortable: true, weight: 7},
|
|
197
|
-
];
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
chunkAdded(chunk: Chunk): void {
|
|
201
|
-
if (!this.chunkFilter(chunk)) {
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
this.dataGrid.insertChild(this.createGridItem(chunk));
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
private clearChunks(): void {
|
|
208
|
-
// TODO(allada): actually remove frames from request.
|
|
209
|
-
clearChunkOffsets.set(this.request, this.getRequestChunks().length);
|
|
210
|
-
this.performUpdate();
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
private onFilterTypeChanged(): void {
|
|
214
|
-
const val = (this.filterTypeCombobox.selectedOption() as HTMLOptionElement).value;
|
|
215
|
-
this.filterType = val === 'all' ? null : val;
|
|
216
|
-
this.performUpdate();
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
private onFilterTextChanged(): void {
|
|
220
|
-
const text = this.filterTextInput.value();
|
|
221
|
-
this.messageFilterSetting.set(text);
|
|
222
|
-
this.applyFilter(text);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
private applyFilter(text: string): void {
|
|
226
|
-
if (text) {
|
|
227
|
-
try {
|
|
228
|
-
this.filterRegex = new RegExp(text, 'i');
|
|
229
|
-
} catch {
|
|
230
|
-
this.filterRegex = new RegExp(Platform.StringUtilities.escapeForRegExp(text), 'i');
|
|
231
|
-
}
|
|
232
|
-
} else {
|
|
233
|
-
this.filterRegex = null;
|
|
234
|
-
}
|
|
235
|
-
this.performUpdate();
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
private async onChunkSelected(event: Common.EventTarget.EventTargetEvent<DataGrid.DataGrid.DataGridNode<unknown>>):
|
|
239
|
-
Promise<void> {
|
|
240
|
-
this.currentSelectedNode = (event.data as DataGridItem);
|
|
241
|
-
await this.updateSidebar();
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
private onChunkDeselected(): void {
|
|
245
|
-
this.currentSelectedNode = null;
|
|
246
|
-
void this.updateSidebar();
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
async updateSidebar(): Promise<void> {
|
|
250
|
-
if (!this.currentSelectedNode) {
|
|
251
|
-
this.sidebarWidget = null;
|
|
252
|
-
this.updateSidebarWidget();
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
const content = this.currentSelectedNode.dataText();
|
|
257
|
-
|
|
258
|
-
const binaryView = this.currentSelectedNode.binaryView();
|
|
259
|
-
if (binaryView) {
|
|
260
|
-
this.sidebarWidget = binaryView;
|
|
261
|
-
this.updateSidebarWidget();
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
const jsonView = await SourceFrame.JSONView.JSONView.createView(content);
|
|
266
|
-
if (jsonView) {
|
|
267
|
-
this.sidebarWidget = jsonView;
|
|
268
|
-
this.updateSidebarWidget();
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
this.sidebarWidget = new SourceFrame.ResourceSourceFrame.ResourceSourceFrame(
|
|
273
|
-
TextUtils.StaticContentProvider.StaticContentProvider.fromString(this.request.url(),
|
|
274
|
-
this.request.resourceType(), content),
|
|
275
|
-
'');
|
|
276
|
-
this.updateSidebarWidget();
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
private updateSidebarWidget(): void {
|
|
280
|
-
const activeSidebar = this.sidebarWidget || this.frameEmptyWidget;
|
|
281
|
-
if (this.splitWidget.sidebarWidget() !== activeSidebar) {
|
|
282
|
-
this.splitWidget.setSidebarWidget(activeSidebar);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
override performUpdate(): void {
|
|
287
|
-
this.dataGrid.rootNode().removeChildren();
|
|
288
|
-
let chunks = this.getRequestChunks();
|
|
289
|
-
const offset = clearChunkOffsets.get(this.request) || 0;
|
|
290
|
-
chunks = chunks.slice(offset).filter(this.chunkFilter.bind(this));
|
|
291
|
-
chunks.forEach(chunk => this.dataGrid.insertChild(this.createGridItem(chunk)));
|
|
292
|
-
|
|
293
|
-
this.updateSidebarWidget();
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
refresh(): void {
|
|
297
|
-
this.performUpdate();
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
private sortItems(): void {
|
|
301
|
-
this.dataGrid.sortNodes(this.timeComparator, !this.dataGrid.isSortOrderAscending());
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
getDataGridForTest(): DataGrid.SortableDataGrid.SortableDataGrid<unknown> {
|
|
305
|
-
return this.dataGrid;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
getSplitWidgetForTest(): UI.SplitWidget.SplitWidget {
|
|
309
|
-
return this.splitWidget;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
getFilterInputForTest(): UI.Toolbar.ToolbarInput {
|
|
313
|
-
return this.filterTextInput;
|
|
314
|
-
}
|
|
315
|
-
getClearAllButtonForTest(): UI.Toolbar.ToolbarButton {
|
|
316
|
-
return this.clearAllButton;
|
|
317
|
-
}
|
|
318
|
-
getFilterTypeComboboxForTest(): UI.Toolbar.ToolbarComboBox {
|
|
319
|
-
return this.filterTypeCombobox;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
const FILTER_TYPES: UI.FilterBar.Item[] = [
|
|
324
|
-
{name: 'all', label: i18nLazyString(UIStrings.all), jslogContext: 'all'},
|
|
325
|
-
{name: 'send', label: i18nLazyString(UIStrings.send), jslogContext: 'send'},
|
|
326
|
-
{name: 'receive', label: i18nLazyString(UIStrings.receive), jslogContext: 'receive'},
|
|
327
|
-
];
|
|
328
|
-
|
|
329
|
-
export abstract class DataGridItem extends DataGrid.SortableDataGrid.SortableDataGridNode<unknown> {
|
|
330
|
-
abstract binaryView(): BinaryResourceView|null;
|
|
331
|
-
abstract getTime(): number;
|
|
332
|
-
abstract dataText(): string;
|
|
333
|
-
abstract isTextFrame?: boolean;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
function resourceChunkNodeTimeComparator(a: DataGridItem, b: DataGridItem): number {
|
|
337
|
-
return a.getTime() - b.getTime();
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
const clearChunkOffsets = new WeakMap<SDK.NetworkRequest.NetworkRequest, number>();
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2014 The Chromium Authors
|
|
3
|
-
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
.resource-chunk-view {
|
|
8
|
-
user-select: text;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.resource-chunk-view .data-grid {
|
|
12
|
-
flex: auto;
|
|
13
|
-
border: none;
|
|
14
|
-
|
|
15
|
-
.resource-chunk-view-td {
|
|
16
|
-
border-bottom: 1px solid var(--sys-color-divider);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
& tr {
|
|
20
|
-
&.resource-chunk-view-row-send td:first-child::before {
|
|
21
|
-
content: "\2B06";
|
|
22
|
-
color: var(--sys-color-tertiary);
|
|
23
|
-
padding-right: 4px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&.resource-chunk-view-row-receive td:first-child::before {
|
|
27
|
-
content: "\2B07";
|
|
28
|
-
color: var(--sys-color-error);
|
|
29
|
-
padding-right: 4px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&.resource-chunk-view-row-send {
|
|
33
|
-
background-color: color-mix(in srgb, var(--sys-color-tertiary-container), transparent 50%);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&.resource-chunk-view-row-error {
|
|
37
|
-
background-color: var(--sys-color-surface-error);
|
|
38
|
-
color: var(--sys-color-on-surface-error);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.resource-chunk-view .data-grid .data {
|
|
44
|
-
background-image: none;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.resource-chunk-view devtools-toolbar {
|
|
48
|
-
border-bottom: 1px solid var(--sys-color-divider);
|
|
49
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-lit-render-outside-of-view, @devtools/enforce-custom-element-definitions-location */
|
|
5
|
-
|
|
6
|
-
import '../../kit/kit.js';
|
|
7
|
-
|
|
8
|
-
import * as Common from '../../../core/common/common.js';
|
|
9
|
-
import * as Lit from '../../lit/lit.js';
|
|
10
|
-
|
|
11
|
-
import settingDeprecationWarningStyles from './settingDeprecationWarning.css.js';
|
|
12
|
-
|
|
13
|
-
const {html} = Lit;
|
|
14
|
-
|
|
15
|
-
export class SettingDeprecationWarning extends HTMLElement {
|
|
16
|
-
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
17
|
-
|
|
18
|
-
set data(data: Common.Settings.Deprecation) {
|
|
19
|
-
this.#render(data);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
#render({disabled, warning, experiment}: Common.Settings.Deprecation): void {
|
|
23
|
-
const classes = {clickable: false, medium: true};
|
|
24
|
-
let onclick: (() => void)|undefined;
|
|
25
|
-
if (disabled && experiment) {
|
|
26
|
-
classes.clickable = true;
|
|
27
|
-
onclick = () => {
|
|
28
|
-
void Common.Revealer.reveal(experiment);
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
Lit.render(
|
|
33
|
-
html`
|
|
34
|
-
<style>${settingDeprecationWarningStyles}</style>
|
|
35
|
-
<devtools-icon class=${Lit.Directives.classMap(classes)} name="info" title=${warning} @click=${
|
|
36
|
-
onclick}></devtools-icon>`,
|
|
37
|
-
this.#shadow, {host: this});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
customElements.define('devtools-setting-deprecation-warning', SettingDeprecationWarning);
|
|
42
|
-
|
|
43
|
-
declare global {
|
|
44
|
-
interface HTMLElementTagNameMap {
|
|
45
|
-
'devtools-setting-deprecation-warning': SettingDeprecationWarning;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2022 The Chromium Authors
|
|
3
|
-
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
.clickable {
|
|
8
|
-
cursor: pointer;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
devtools-icon {
|
|
12
|
-
vertical-align: text-bottom;
|
|
13
|
-
padding-left: 2px;
|
|
14
|
-
}
|