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
|
@@ -42,7 +42,8 @@ export function createSettingCheckbox(
|
|
|
42
42
|
return label;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export function renderSettingSelect(setting: Common.Settings.Setting<unknown>, subtitle?: string
|
|
45
|
+
export function renderSettingSelect(setting: Common.Settings.Setting<unknown>, subtitle?: string,
|
|
46
|
+
disabled?: boolean): TemplateResult {
|
|
46
47
|
const uiDescriptor = SettingUIRegistration.SettingUIRegistration.maybeResolve(setting.descriptor());
|
|
47
48
|
const name = uiDescriptor?.title?.() ?? setting.title();
|
|
48
49
|
const options = uiDescriptor?.options?.map(opt => ({
|
|
@@ -53,7 +54,6 @@ export function renderSettingSelect(setting: Common.Settings.Setting<unknown>, s
|
|
|
53
54
|
})) ??
|
|
54
55
|
setting.options();
|
|
55
56
|
const requiresReload = Boolean(uiDescriptor?.reloadRequired ?? setting.reloadRequired());
|
|
56
|
-
const {deprecation} = setting;
|
|
57
57
|
const controlId = UI.ARIAUtils.nextId('labelledControl');
|
|
58
58
|
const reloadWarningRef = createRef<HTMLParagraphElement>();
|
|
59
59
|
|
|
@@ -76,14 +76,11 @@ export function renderSettingSelect(setting: Common.Settings.Setting<unknown>, s
|
|
|
76
76
|
<label for=${controlId}>
|
|
77
77
|
${name}
|
|
78
78
|
${subtitle ? html`<p>${subtitle}</p>` : nothing}
|
|
79
|
-
${deprecation ? html`<devtools-setting-deprecation-warning .data=${
|
|
80
|
-
deprecation as Common.Settings.Deprecation}></devtools-setting-deprecation-warning>` :
|
|
81
|
-
nothing}
|
|
82
79
|
</label>
|
|
83
80
|
<select
|
|
84
81
|
id=${controlId}
|
|
85
82
|
aria-label=${name}
|
|
86
|
-
.disabled=${setting.disabled()}
|
|
83
|
+
.disabled=${disabled ?? setting.disabled()}
|
|
87
84
|
@change=${onSelectChange}
|
|
88
85
|
jslog=${VisualLogging.dropDown().track({change: true}).context(setting.name)}
|
|
89
86
|
>
|
|
@@ -112,8 +109,8 @@ export function renderSettingSelect(setting: Common.Settings.Setting<unknown>, s
|
|
|
112
109
|
// clang-format on
|
|
113
110
|
}
|
|
114
111
|
|
|
115
|
-
export const renderControlForSetting = function(
|
|
116
|
-
|
|
112
|
+
export const renderControlForSetting = function(setting: Common.Settings.Setting<unknown>, subtitle?: string,
|
|
113
|
+
disabled?: boolean): TemplateResult|typeof nothing {
|
|
117
114
|
switch (setting.type()) {
|
|
118
115
|
case Common.Settings.SettingType.BOOLEAN: {
|
|
119
116
|
const onchange = (): void => {
|
|
@@ -126,10 +123,11 @@ export const renderControlForSetting = function(
|
|
|
126
123
|
};
|
|
127
124
|
return html`<setting-checkbox .data=${{
|
|
128
125
|
setting: setting as Common.Settings.Setting<boolean>,
|
|
126
|
+
disabled,
|
|
129
127
|
} as Settings.SettingCheckbox.SettingCheckboxData} @change=${onchange}></setting-checkbox>`;
|
|
130
128
|
}
|
|
131
129
|
case Common.Settings.SettingType.ENUM: {
|
|
132
|
-
return renderSettingSelect(setting, subtitle);
|
|
130
|
+
return renderSettingSelect(setting, subtitle, disabled);
|
|
133
131
|
}
|
|
134
132
|
default:
|
|
135
133
|
console.error('Invalid setting type: ' + setting.type());
|
|
@@ -137,9 +135,9 @@ export const renderControlForSetting = function(
|
|
|
137
135
|
}
|
|
138
136
|
};
|
|
139
137
|
|
|
140
|
-
export const createControlForSetting = function(
|
|
141
|
-
|
|
142
|
-
const template = renderControlForSetting(setting, subtitle);
|
|
138
|
+
export const createControlForSetting = function(setting: Common.Settings.Setting<unknown>, subtitle?: string,
|
|
139
|
+
disabled?: boolean): HTMLElement|null {
|
|
140
|
+
const template = renderControlForSetting(setting, subtitle, disabled);
|
|
143
141
|
if (template === nothing) {
|
|
144
142
|
return null;
|
|
145
143
|
}
|
|
@@ -30,13 +30,6 @@ export interface SettingUIDescriptor {
|
|
|
30
30
|
* Whether DevTools must be reloaded for a change in the setting to take effect.
|
|
31
31
|
*/
|
|
32
32
|
reloadRequired?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* If a setting is deprecated, define this notice to show an appropriate warning according to the `warning` property.
|
|
35
|
-
* If `disabled` is set, the setting will be disabled in the settings UI. In that case, `experiment` optionally can be
|
|
36
|
-
* set to link to an experiment (by experiment name). The information icon in the settings UI can then be clicked to
|
|
37
|
-
* jump to the experiment. If a setting is not disabled, the experiment entry will be ignored.
|
|
38
|
-
*/
|
|
39
|
-
deprecationNotice?: {disabled: boolean, warning: () => Platform.UIString.LocalizedString, experiment?: string};
|
|
40
33
|
/**
|
|
41
34
|
* See {@link LearnMore} for more info.
|
|
42
35
|
*/
|
|
@@ -78,7 +71,6 @@ export function getRegisteredSettings(): readonly RegisteredSettingUI[] {
|
|
|
78
71
|
tags: legacy.tags,
|
|
79
72
|
options: legacy.options,
|
|
80
73
|
reloadRequired: legacy.reloadRequired,
|
|
81
|
-
deprecationNotice: legacy.deprecationNotice,
|
|
82
74
|
learnMore: legacy.learnMore,
|
|
83
75
|
},
|
|
84
76
|
});
|
|
@@ -1847,7 +1847,9 @@ export const knownContextValues = new Set([
|
|
|
1847
1847
|
'full-accessibility-tree-feedback',
|
|
1848
1848
|
'full-version',
|
|
1849
1849
|
'function',
|
|
1850
|
+
'galaxy-z-flip-6',
|
|
1850
1851
|
'galaxy-z-fold-5',
|
|
1852
|
+
'galaxy-z-fold-6',
|
|
1851
1853
|
'gamma',
|
|
1852
1854
|
'gap',
|
|
1853
1855
|
'gap-rule-overlap',
|
|
@@ -2007,11 +2009,14 @@ export const knownContextValues = new Set([
|
|
|
2007
2009
|
'hyphenate-limit-chars',
|
|
2008
2010
|
'hyphens',
|
|
2009
2011
|
'i-pad-air',
|
|
2012
|
+
'i-pad-air-11',
|
|
2010
2013
|
'i-pad-mini',
|
|
2011
2014
|
'i-pad-pro',
|
|
2015
|
+
'i-pad-pro-13',
|
|
2012
2016
|
'i-phone-12-pro',
|
|
2013
2017
|
'i-phone-14-pro-max',
|
|
2014
2018
|
'i-phone-15-pro-max',
|
|
2019
|
+
'i-phone-16',
|
|
2015
2020
|
'i-phone-16-pro-max',
|
|
2016
2021
|
'i-phone-se',
|
|
2017
2022
|
'i-phone-xr',
|
|
@@ -2209,6 +2214,10 @@ export const knownContextValues = new Set([
|
|
|
2209
2214
|
'ky',
|
|
2210
2215
|
'landscape-left',
|
|
2211
2216
|
'landscape-right',
|
|
2217
|
+
'landscape-safe-area-bottom',
|
|
2218
|
+
'landscape-safe-area-left',
|
|
2219
|
+
'landscape-safe-area-right',
|
|
2220
|
+
'landscape-safe-area-top',
|
|
2212
2221
|
'language',
|
|
2213
2222
|
'language-af',
|
|
2214
2223
|
'language-am',
|
|
@@ -2772,6 +2781,7 @@ export const knownContextValues = new Set([
|
|
|
2772
2781
|
'more-options',
|
|
2773
2782
|
'more-tabs',
|
|
2774
2783
|
'more-tools',
|
|
2784
|
+
'moto-g4',
|
|
2775
2785
|
'mouse',
|
|
2776
2786
|
'mousedown',
|
|
2777
2787
|
'mouseenter',
|
|
@@ -3095,7 +3105,11 @@ export const knownContextValues = new Set([
|
|
|
3095
3105
|
'pixel-7',
|
|
3096
3106
|
'pixel-8',
|
|
3097
3107
|
'pixel-9',
|
|
3108
|
+
'pixel-9-pro',
|
|
3109
|
+
'pixel-9-pro-fold',
|
|
3098
3110
|
'pixel-9-pro-xl',
|
|
3111
|
+
'pixel-fold',
|
|
3112
|
+
'pixel-tablet',
|
|
3099
3113
|
'pl',
|
|
3100
3114
|
'place-content',
|
|
3101
3115
|
'place-items',
|
|
@@ -3469,9 +3483,15 @@ export const knownContextValues = new Set([
|
|
|
3469
3483
|
'safari-i-pad-i-os-13.2',
|
|
3470
3484
|
'safari-i-phone-i-os-13.2',
|
|
3471
3485
|
'safari-mac',
|
|
3486
|
+
'safe-area-bottom',
|
|
3487
|
+
'safe-area-left',
|
|
3488
|
+
'safe-area-right',
|
|
3489
|
+
'safe-area-top',
|
|
3472
3490
|
'same-site',
|
|
3473
3491
|
'sampling-heap-profiler-timeline',
|
|
3492
|
+
'samsung-galaxy-a24-4g',
|
|
3474
3493
|
'samsung-galaxy-a51-71',
|
|
3494
|
+
'samsung-galaxy-a55',
|
|
3475
3495
|
'samsung-galaxy-s20-ultra',
|
|
3476
3496
|
'samsung-galaxy-s8',
|
|
3477
3497
|
'sans-serif',
|
|
@@ -3958,6 +3978,7 @@ export const knownContextValues = new Set([
|
|
|
3958
3978
|
'suggestion',
|
|
3959
3979
|
'supports',
|
|
3960
3980
|
'surface-duo',
|
|
3981
|
+
'surface-pro-10',
|
|
3961
3982
|
'surface-pro-7',
|
|
3962
3983
|
'suspend',
|
|
3963
3984
|
'sv',
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../config/typescript/tsconfig.base.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"lib": [
|
|
5
|
-
|
|
4
|
+
"lib": [
|
|
5
|
+
"esnext",
|
|
6
|
+
"dom",
|
|
7
|
+
"dom.iterable",
|
|
8
|
+
"webworker",
|
|
9
|
+
"webworker.iterable"
|
|
10
|
+
],
|
|
11
|
+
"noEmit": true
|
|
6
12
|
}
|
|
7
13
|
}
|
package/package.json
CHANGED
|
@@ -85,11 +85,12 @@
|
|
|
85
85
|
"svgo": "4.0.2",
|
|
86
86
|
"terser": "5.48.0",
|
|
87
87
|
"ts-lit-plugin": "2.0.2",
|
|
88
|
-
"typescript": "6.0.2",
|
|
88
|
+
"@typescript/tsc": "npm:typescript@6.0.2",
|
|
89
|
+
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
89
90
|
"typescript-eslint": "8.64.0",
|
|
90
91
|
"uuid": "14.0.0",
|
|
91
92
|
"webidl2": "24.5.0",
|
|
92
93
|
"yargs": "17.7.2"
|
|
93
94
|
},
|
|
94
|
-
"version": "1.0.
|
|
95
|
+
"version": "1.0.1672388"
|
|
95
96
|
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# Copyright 2026 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
|
-
"""Helper wrapper script to run gerrit_client.py from PATH."""
|
|
6
|
-
|
|
7
|
-
import shutil
|
|
8
|
-
import subprocess
|
|
9
|
-
import sys
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def main():
|
|
13
|
-
client = shutil.which('gerrit_client.py')
|
|
14
|
-
if not client:
|
|
15
|
-
print('gerrit_client.py not found. '
|
|
16
|
-
'Is depot_tools available and added to PATH?')
|
|
17
|
-
sys.exit(1)
|
|
18
|
-
|
|
19
|
-
# DevTools specific defaults
|
|
20
|
-
default_args = [
|
|
21
|
-
'--host',
|
|
22
|
-
'https://chromium-review.googlesource.com',
|
|
23
|
-
'--project',
|
|
24
|
-
'devtools/devtools-frontend',
|
|
25
|
-
]
|
|
26
|
-
|
|
27
|
-
# gerrit_client.py expects: <command> [options] [args]
|
|
28
|
-
# We need to extract the command from sys.argv and put it first.
|
|
29
|
-
user_args = sys.argv[1:]
|
|
30
|
-
command = []
|
|
31
|
-
other_args = []
|
|
32
|
-
for i, arg in enumerate(user_args):
|
|
33
|
-
if not arg.startswith('-'):
|
|
34
|
-
command = [arg]
|
|
35
|
-
other_args = user_args[:i] + user_args[i + 1:]
|
|
36
|
-
break
|
|
37
|
-
else:
|
|
38
|
-
other_args = user_args
|
|
39
|
-
|
|
40
|
-
full_args = command + default_args + other_args
|
|
41
|
-
|
|
42
|
-
rc = subprocess.call(['vpython3', client] + full_args)
|
|
43
|
-
sys.exit(rc)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if __name__ == '__main__':
|
|
47
|
-
main()
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 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
|
-
|
|
5
|
-
import {assert} from 'chai';
|
|
6
|
-
import sinon from 'sinon';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @devtools/es-modules-import
|
|
9
|
-
import * as SDK from './sdk.js';
|
|
10
|
-
|
|
11
|
-
interface GlobalWithCSS {
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13
|
-
CSS?: unknown;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
describe('CSSModel API Test', () => {
|
|
17
|
-
it('adds a semicolon when enabling a property that lacked one, inserts properties, and enables them correctly',
|
|
18
|
-
async ({inspectedPage, universe}) => {
|
|
19
|
-
// Mock CSS.supports in Node environment for API tests.
|
|
20
|
-
let cssMocked = false;
|
|
21
|
-
if (typeof globalThis.CSS === 'undefined') {
|
|
22
|
-
(globalThis as unknown as GlobalWithCSS).CSS = undefined;
|
|
23
|
-
cssMocked = true;
|
|
24
|
-
}
|
|
25
|
-
const stub = sinon.stub(globalThis, 'CSS').value({
|
|
26
|
-
supports: () => true,
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
const primaryTarget = universe.targetManager.primaryPageTarget();
|
|
31
|
-
assert.isNotNull(primaryTarget);
|
|
32
|
-
|
|
33
|
-
const domModel = primaryTarget.model(SDK.DOMModel.DOMModel);
|
|
34
|
-
assert.isNotNull(domModel);
|
|
35
|
-
|
|
36
|
-
const cssModel = primaryTarget.model(SDK.CSSModel.CSSModel);
|
|
37
|
-
assert.isNotNull(cssModel);
|
|
38
|
-
|
|
39
|
-
await inspectedPage.goToHtml(`
|
|
40
|
-
<style>
|
|
41
|
-
#formatted {
|
|
42
|
-
color: red;
|
|
43
|
-
margin: 0
|
|
44
|
-
}
|
|
45
|
-
</style>
|
|
46
|
-
<div id="formatted">Formatted</div>
|
|
47
|
-
`);
|
|
48
|
-
|
|
49
|
-
const documentNode = await domModel.requestDocument();
|
|
50
|
-
assert.isNotNull(documentNode);
|
|
51
|
-
|
|
52
|
-
// Retrieve the subtree to populate the DOMModel cache.
|
|
53
|
-
await documentNode.getSubtree(5, true);
|
|
54
|
-
|
|
55
|
-
const nodeId = await domModel.querySelector(documentNode.id, '#formatted');
|
|
56
|
-
assert.isNotNull(nodeId);
|
|
57
|
-
|
|
58
|
-
const matchedResult = await cssModel.getMatchedStyles(nodeId);
|
|
59
|
-
assert.isNotNull(matchedResult);
|
|
60
|
-
|
|
61
|
-
const style = matchedResult.nodeStyles()[1];
|
|
62
|
-
assert.isNotNull(style);
|
|
63
|
-
|
|
64
|
-
cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetChanged, event => {
|
|
65
|
-
const {edit} = event.data;
|
|
66
|
-
if (edit) {
|
|
67
|
-
style.rebase(edit);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const marginProperty = style.allProperties()[1];
|
|
72
|
-
assert.strictEqual(marginProperty.name, 'margin');
|
|
73
|
-
assert.strictEqual(marginProperty.value, '0');
|
|
74
|
-
|
|
75
|
-
let success = await marginProperty.setDisabled(true);
|
|
76
|
-
assert.isTrue(success);
|
|
77
|
-
assert.include(style.cssText, '/* margin: 0; */');
|
|
78
|
-
|
|
79
|
-
const insertPromise = new Promise<void>(resolve => {
|
|
80
|
-
style.insertPropertyAt(2, 'endProperty', 'endValue', success => {
|
|
81
|
-
assert.isTrue(success);
|
|
82
|
-
resolve();
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
await insertPromise;
|
|
86
|
-
assert.include(style.cssText, '/* margin: 0; */');
|
|
87
|
-
assert.include(style.cssText, 'endProperty: endValue;');
|
|
88
|
-
|
|
89
|
-
const updatedMarginProperty = style.allProperties()[1];
|
|
90
|
-
success = await updatedMarginProperty.setDisabled(false);
|
|
91
|
-
assert.isTrue(success);
|
|
92
|
-
assert.include(style.cssText, 'margin: 0;');
|
|
93
|
-
assert.include(style.cssText, 'endProperty: endValue;');
|
|
94
|
-
} finally {
|
|
95
|
-
// Clean up the mock to avoid polluting the global scope.
|
|
96
|
-
stub.restore();
|
|
97
|
-
if (cssMocked) {
|
|
98
|
-
delete (globalThis as unknown as GlobalWithCSS).CSS;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
});
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 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
|
-
|
|
5
|
-
import {assert} from 'chai';
|
|
6
|
-
|
|
7
|
-
import type * as Common from '../common/common.js';
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line @devtools/es-modules-import
|
|
10
|
-
import * as SDK from './sdk.js';
|
|
11
|
-
|
|
12
|
-
function findNode(node: SDK.DOMModel.DOMNode, predicate: (node: SDK.DOMModel.DOMNode) => boolean): SDK.DOMModel.DOMNode|
|
|
13
|
-
null {
|
|
14
|
-
if (predicate(node)) {
|
|
15
|
-
return node;
|
|
16
|
-
}
|
|
17
|
-
const children = node.children();
|
|
18
|
-
if (children) {
|
|
19
|
-
for (const child of children) {
|
|
20
|
-
const result = findNode(child, predicate);
|
|
21
|
-
if (result) {
|
|
22
|
-
return result;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
describe('DOMModel API Test', () => {
|
|
30
|
-
it('generates attribute updated event only when attribute is actually changed', async ({inspectedPage, universe}) => {
|
|
31
|
-
const primaryTarget = universe.targetManager.primaryPageTarget();
|
|
32
|
-
assert.isNotNull(primaryTarget);
|
|
33
|
-
|
|
34
|
-
const domModel = primaryTarget.model(SDK.DOMModel.DOMModel);
|
|
35
|
-
assert.isNotNull(domModel);
|
|
36
|
-
|
|
37
|
-
await inspectedPage.goToHtml(`
|
|
38
|
-
<div id="container">
|
|
39
|
-
<div id="node-set-new-value" style="color:red"></div>
|
|
40
|
-
<div id="node-set-same-value" style="color:red"></div>
|
|
41
|
-
</div>
|
|
42
|
-
`);
|
|
43
|
-
|
|
44
|
-
const documentNode = await domModel.requestDocument();
|
|
45
|
-
assert.isNotNull(documentNode);
|
|
46
|
-
|
|
47
|
-
// Retrieve the subtree to populate the DOMModel cache.
|
|
48
|
-
await documentNode.getSubtree(5, true);
|
|
49
|
-
|
|
50
|
-
const container = findNode(documentNode, n => n.getAttribute('id') === 'container');
|
|
51
|
-
assert.isNotNull(container);
|
|
52
|
-
|
|
53
|
-
const nodeSetNewValue = findNode(documentNode, n => n.getAttribute('id') === 'node-set-new-value');
|
|
54
|
-
assert.isNotNull(nodeSetNewValue);
|
|
55
|
-
|
|
56
|
-
const nodeSetSameValue = findNode(documentNode, n => n.getAttribute('id') === 'node-set-same-value');
|
|
57
|
-
assert.isNotNull(nodeSetSameValue);
|
|
58
|
-
|
|
59
|
-
if (!nodeSetNewValue || !nodeSetSameValue) {
|
|
60
|
-
assert.fail('Could not find test nodes');
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Verifies that setting a new style attribute value triggers the AttrModified event.
|
|
64
|
-
let attrModifiedPromise = domModel.once(SDK.DOMModel.Events.AttrModified);
|
|
65
|
-
|
|
66
|
-
await inspectedPage.evaluate(() => {
|
|
67
|
-
(document.getElementById('node-set-new-value') as HTMLElement).style.setProperty('color', 'blue');
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
let eventData = await attrModifiedPromise;
|
|
71
|
-
assert.strictEqual(eventData.node, nodeSetNewValue);
|
|
72
|
-
assert.strictEqual(eventData.name, 'style');
|
|
73
|
-
assert.strictEqual(nodeSetNewValue.getAttribute('style'), 'color: blue;');
|
|
74
|
-
|
|
75
|
-
// Verifies that setting the style attribute to the same value does not trigger the AttrModified event.
|
|
76
|
-
let attrModifiedFired = false;
|
|
77
|
-
const listener =
|
|
78
|
-
(event: Common.EventTarget
|
|
79
|
-
.EventTargetEvent<SDK.DOMModel.EventTypes[SDK.DOMModel.Events.AttrModified], SDK.DOMModel.EventTypes>):
|
|
80
|
-
void => {
|
|
81
|
-
if (event.data.node === nodeSetSameValue) {
|
|
82
|
-
attrModifiedFired = true;
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
domModel.addEventListener(SDK.DOMModel.Events.AttrModified, listener);
|
|
86
|
-
|
|
87
|
-
await inspectedPage.evaluate(() => {
|
|
88
|
-
(document.getElementById('node-set-same-value') as HTMLElement).style.setProperty('color', 'red');
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
// Flushes pending events by triggering a style change on the new value node.
|
|
92
|
-
attrModifiedPromise = domModel.once(SDK.DOMModel.Events.AttrModified);
|
|
93
|
-
|
|
94
|
-
await inspectedPage.evaluate(() => {
|
|
95
|
-
(document.getElementById('node-set-new-value') as HTMLElement).style.setProperty('color', 'green');
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
eventData = await attrModifiedPromise;
|
|
99
|
-
assert.strictEqual(eventData.node, nodeSetNewValue);
|
|
100
|
-
assert.isFalse(attrModifiedFired, 'AttrModified should not have fired for same value');
|
|
101
|
-
|
|
102
|
-
domModel.removeEventListener(SDK.DOMModel.Events.AttrModified, listener);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 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
|
-
|
|
5
|
-
import {assert} from 'chai';
|
|
6
|
-
|
|
7
|
-
import * as Root from '../core/root/root.js';
|
|
8
|
-
import * as SDK from '../core/sdk/sdk.js';
|
|
9
|
-
|
|
10
|
-
describe('Universe API Test', () => {
|
|
11
|
-
describe('ConsoleModel', () => {
|
|
12
|
-
it('receives console messages emitted from inspected page in universe ConsoleModel',
|
|
13
|
-
async ({inspectedPage, universe}) => {
|
|
14
|
-
assert.isNotNull(universe);
|
|
15
|
-
|
|
16
|
-
const primaryTarget = universe.targetManager.primaryPageTarget();
|
|
17
|
-
assert.isNotNull(primaryTarget, 'Primary page target should exist in target manager');
|
|
18
|
-
|
|
19
|
-
await inspectedPage.goToHtml('<h1>DevTools API Test Page</h1>');
|
|
20
|
-
|
|
21
|
-
const consoleModel = primaryTarget?.model(SDK.ConsoleModel.ConsoleModel);
|
|
22
|
-
const messagePromise = consoleModel?.once(SDK.ConsoleModel.Events.MessageAdded);
|
|
23
|
-
|
|
24
|
-
// eslint-disable-next-line no-console
|
|
25
|
-
await inspectedPage.evaluate(() => console.log('Hello from Universe API Test!'));
|
|
26
|
-
|
|
27
|
-
const consoleMessage = await messagePromise;
|
|
28
|
-
assert.isDefined(consoleMessage);
|
|
29
|
-
assert.strictEqual(
|
|
30
|
-
consoleMessage?.messageText,
|
|
31
|
-
'Hello from Universe API Test!',
|
|
32
|
-
'Console message should be received by universe ConsoleModel',
|
|
33
|
-
);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
describe('Suite with setup configuration', () => {
|
|
38
|
-
setup({
|
|
39
|
-
creationOptions: {
|
|
40
|
-
hostConfig: {
|
|
41
|
-
devToolsConsoleInsights: {
|
|
42
|
-
enabled: true,
|
|
43
|
-
modelId: 'test-model',
|
|
44
|
-
temperature: 0.7,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('applies hostConfig from setup creationOptions globally and to Universe', async ({universe}) => {
|
|
51
|
-
assert.isNotNull(universe);
|
|
52
|
-
assert.isTrue(Root.Runtime.hostConfig.devToolsConsoleInsights?.enabled);
|
|
53
|
-
assert.strictEqual(Root.Runtime.hostConfig.devToolsConsoleInsights?.modelId, 'test-model');
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
describe('Suite with targetUrl configuration', () => {
|
|
58
|
-
setup({
|
|
59
|
-
targetUrl: 'data:text/html,<!DOCTYPE%20html><h1>Target%20URL%20Test</h1>',
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('navigates to targetUrl before attaching universe', async ({inspectedPage}) => {
|
|
63
|
-
const heading = await inspectedPage.evaluate(() => document.querySelector('h1')?.textContent);
|
|
64
|
-
assert.strictEqual(heading, 'Target URL Test');
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
describe('Suite without custom setup', () => {
|
|
69
|
-
it('restores default hostConfig after previous test suite cleaned up', async () => {
|
|
70
|
-
assert.isUndefined(Root.Runtime.hostConfig.devToolsConsoleInsights?.modelId);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
});
|
|
@@ -1,128 +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-imperative-dom-api */
|
|
5
|
-
|
|
6
|
-
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
|
-
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
-
import type * as Protocol from '../../generated/protocol.js';
|
|
9
|
-
import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
10
|
-
import * as UI from '../../ui/legacy/legacy.js';
|
|
11
|
-
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
12
|
-
|
|
13
|
-
import * as ApplicationComponents from './components/components.js';
|
|
14
|
-
import sharedStorageEventsViewStyles from './sharedStorageEventsView.css.js';
|
|
15
|
-
|
|
16
|
-
const UIStrings = {
|
|
17
|
-
/**
|
|
18
|
-
* @description Placeholder text if no shared storage event has been selected.
|
|
19
|
-
* Shared storage allows to store and access data that can be shared across different sites.
|
|
20
|
-
* A shared storage event is for example an access from a site to that storage.
|
|
21
|
-
*/
|
|
22
|
-
noEventSelected: 'No shared storage event selected',
|
|
23
|
-
/**
|
|
24
|
-
* @description Placeholder text instructing the user how to display shared
|
|
25
|
-
* storage event details.
|
|
26
|
-
* Shared storage allows to store and access data that can be shared across different sites.
|
|
27
|
-
* A shared storage event is for example an access from a site to that storage.
|
|
28
|
-
*/
|
|
29
|
-
clickToDisplayBody: 'Click on any shared storage event to display the event parameters',
|
|
30
|
-
} as const;
|
|
31
|
-
const str_ = i18n.i18n.registerUIStrings('panels/application/SharedStorageEventsView.ts', UIStrings);
|
|
32
|
-
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
33
|
-
|
|
34
|
-
function eventEquals(
|
|
35
|
-
a: Protocol.Storage.SharedStorageAccessedEvent, b: Protocol.Storage.SharedStorageAccessedEvent): boolean {
|
|
36
|
-
return JSON.stringify(a) === JSON.stringify(b);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export class SharedStorageEventsView extends UI.SplitWidget.SplitWidget {
|
|
40
|
-
readonly #sharedStorageEventGrid = new ApplicationComponents.SharedStorageAccessGrid.SharedStorageAccessGrid();
|
|
41
|
-
#events: Protocol.Storage.SharedStorageAccessedEvent[] = [];
|
|
42
|
-
#noDisplayView: UI.Widget.VBox;
|
|
43
|
-
#defaultId: Protocol.Page.FrameId = '' as Protocol.Page.FrameId;
|
|
44
|
-
|
|
45
|
-
constructor() {
|
|
46
|
-
super(/* isVertical */ false, /* secondIsSidebar: */ true);
|
|
47
|
-
|
|
48
|
-
this.element.setAttribute('jslog', `${VisualLogging.pane('shared-storage-events')}`);
|
|
49
|
-
|
|
50
|
-
this.#noDisplayView =
|
|
51
|
-
new UI.EmptyWidget.EmptyWidget(i18nString(UIStrings.noEventSelected), i18nString(UIStrings.clickToDisplayBody));
|
|
52
|
-
this.#noDisplayView.setMinimumSize(0, 40);
|
|
53
|
-
this.#sharedStorageEventGrid.setMinimumSize(0, 80);
|
|
54
|
-
this.#sharedStorageEventGrid.onSelect = this.#onFocus.bind(this);
|
|
55
|
-
|
|
56
|
-
this.setMainWidget(this.#sharedStorageEventGrid);
|
|
57
|
-
this.setSidebarWidget(this.#noDisplayView);
|
|
58
|
-
this.hideSidebar();
|
|
59
|
-
|
|
60
|
-
this.#getMainFrameResourceTreeModel()?.addEventListener(
|
|
61
|
-
SDK.ResourceTreeModel.Events.PrimaryPageChanged, this.clearEvents, this);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
#getMainFrameResourceTreeModel(): SDK.ResourceTreeModel.ResourceTreeModel|null {
|
|
65
|
-
const primaryPageTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
66
|
-
return primaryPageTarget?.model(SDK.ResourceTreeModel.ResourceTreeModel) || null;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
#getMainFrame(): SDK.ResourceTreeModel.ResourceTreeFrame|null {
|
|
70
|
-
return this.#getMainFrameResourceTreeModel()?.mainFrame || null;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
get id(): Protocol.Page.FrameId {
|
|
74
|
-
return this.#getMainFrame()?.id || this.#defaultId;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
override wasShown(): void {
|
|
78
|
-
super.wasShown();
|
|
79
|
-
const sidebar = this.sidebarWidget();
|
|
80
|
-
if (sidebar) {
|
|
81
|
-
sidebar.registerRequiredCSS(sharedStorageEventsViewStyles);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
addEvent(event: Protocol.Storage.SharedStorageAccessedEvent): void {
|
|
86
|
-
// Only add event if main frame id matches.
|
|
87
|
-
if (event.mainFrameId !== this.id) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// Only add if not already present.
|
|
92
|
-
if (this.#events.some(t => eventEquals(t, event))) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (this.showMode() !== UI.SplitWidget.ShowMode.BOTH) {
|
|
97
|
-
this.showBoth();
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
this.#events.push(event);
|
|
101
|
-
this.#sharedStorageEventGrid.events = this.#events;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
clearEvents(): void {
|
|
105
|
-
this.#events = [];
|
|
106
|
-
this.#sharedStorageEventGrid.events = this.#events;
|
|
107
|
-
this.setSidebarWidget(this.#noDisplayView);
|
|
108
|
-
this.hideSidebar();
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
#onFocus(event: Protocol.Storage.SharedStorageAccessedEvent): void {
|
|
112
|
-
const jsonView = SourceFrame.JSONView.JSONView.createViewSync(event);
|
|
113
|
-
jsonView.setMinimumSize(0, 40);
|
|
114
|
-
this.setSidebarWidget(jsonView);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
setDefaultIdForTesting(id: Protocol.Page.FrameId): void {
|
|
118
|
-
this.#defaultId = id;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
getEventsForTesting(): Protocol.Storage.SharedStorageAccessedEvent[] {
|
|
122
|
-
return this.#events;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
getSharedStorageAccessGridForTesting(): ApplicationComponents.SharedStorageAccessGrid.SharedStorageAccessGrid {
|
|
126
|
-
return this.#sharedStorageEventGrid;
|
|
127
|
-
}
|
|
128
|
-
}
|