chrome-devtools-frontend 1.0.1662289 → 1.0.1664496
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/{creating-a-model → devtools-model-management}/SKILL.md +0 -1
- package/.agents/skills/devtools-unicode-escaping/SKILL.md +64 -0
- package/.agents/skills/devtools-ux-writing-refactor/SKILL.md +2 -1
- package/.agents/skills/fixing-skipped-tests/SKILL.md +3 -3
- package/.agents/skills/merging-devtools-module/SKILL.md +1 -1
- package/.agents/skills/migrate-chromium-test/SKILL.md +32 -6
- package/.agents/skills/repro-flaky-tests/SKILL.md +71 -31
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +1 -0
- package/docs/ui_engineering.md +2 -0
- package/eslint.config.mjs +1 -0
- package/front_end/core/common/SettingRegistration.ts +0 -5
- package/front_end/core/common/Settings.ts +144 -3
- package/front_end/core/platform/StringUtilities.ts +38 -6
- package/front_end/core/protocol_client/PuppeteerDevToolsConnection.ts +112 -0
- package/front_end/core/sdk/CPUProfilerModel.ts +21 -13
- package/front_end/core/sdk/CSSContainerQuery.ts +1 -1
- package/front_end/core/sdk/CSSLayer.ts +1 -1
- package/front_end/core/sdk/CSSMedia.ts +1 -1
- package/front_end/core/sdk/CSSModel.ts +1 -1
- package/front_end/core/sdk/CSSNavigation.ts +1 -1
- package/front_end/core/sdk/CSSProperty.ts +1 -1
- package/front_end/core/sdk/CSSQuery.ts +1 -1
- package/front_end/core/sdk/CSSRule.ts +1 -1
- package/front_end/core/sdk/CSSScope.ts +1 -1
- package/front_end/core/sdk/CSSStartingStyle.ts +1 -1
- package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +1 -1
- package/front_end/core/sdk/CSSSupports.ts +1 -1
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +1 -1
- package/front_end/core/sdk/NetworkManager.ts +1 -1
- package/front_end/core/sdk/NetworkRequest.ts +7 -7
- package/front_end/core/sdk/Resource.ts +1 -1
- package/front_end/core/sdk/ScopeTreeCache.ts +1 -1
- package/front_end/core/sdk/Script.ts +1 -1
- package/front_end/core/sdk/ServerSentEvents.ts +1 -1
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -10
- package/front_end/core/sdk/SourceMap.ts +1 -1
- package/front_end/core/sdk/SourceMapScopesInfo.ts +1 -1
- package/front_end/core/sdk/StorageBucketsModel.ts +0 -10
- package/front_end/core/sdk/sdk-meta.ts +3 -4
- package/front_end/{models → core}/text_utils/ContentProvider.ts +4 -6
- package/front_end/{models → core}/text_utils/StaticContentProvider.ts +4 -6
- package/front_end/{models → core}/text_utils/StreamingContentData.ts +1 -2
- package/front_end/{models → core}/text_utils/TextRange.ts +6 -3
- package/front_end/{models → core}/text_utils/TextUtils.ts +7 -7
- package/front_end/{models → core}/text_utils/WasmDisassembly.ts +2 -2
- package/front_end/core/text_utils/text_utils.ts +27 -0
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +1 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +1 -1
- package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +0 -13
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +8 -3
- package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +3 -3
- package/front_end/entrypoints/main/MainImpl.ts +21 -3
- package/front_end/foundation/Universe.ts +16 -0
- package/front_end/generated/InspectorBackendCommands.ts +2 -14
- package/front_end/generated/protocol-mapping.d.ts +0 -53
- package/front_end/generated/protocol-proxy-api.d.ts +0 -46
- package/front_end/generated/protocol.ts +0 -148
- package/front_end/models/ai_assistance/AgentProject.ts +1 -1
- package/front_end/models/ai_assistance/AiAgent2.ts +3 -3
- package/front_end/models/ai_assistance/AiConversation.ts +21 -10
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +21 -10
- package/front_end/models/ai_assistance/ChangeManager.ts +2 -2
- package/front_end/models/ai_assistance/ExtensionScope.ts +6 -2
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +4 -7
- package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +19 -11
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +23 -10
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +19 -18
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +3 -4
- package/front_end/models/ai_assistance/contexts/FileContext.ts +7 -3
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +39 -11
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +6 -3
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +4 -4
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +8 -8
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +76 -3
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +11 -1
- package/front_end/models/badges/AiExplorerBadge.ts +8 -3
- package/front_end/models/badges/Badge.ts +1 -0
- package/front_end/models/badges/UserBadges.ts +43 -23
- package/front_end/models/bindings/CompilerScriptMapping.ts +1 -1
- package/front_end/models/bindings/ContentProviderBasedProject.ts +1 -1
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +2 -2
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -1
- package/front_end/models/bindings/DefaultScriptMapping.ts +1 -1
- package/front_end/models/bindings/FileUtils.ts +1 -1
- package/front_end/models/bindings/NetworkProject.ts +16 -4
- package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +7 -10
- package/front_end/models/bindings/ResourceMapping.ts +1 -1
- package/front_end/models/bindings/ResourceScriptMapping.ts +1 -1
- package/front_end/models/bindings/SASSSourceMapping.ts +1 -1
- package/front_end/models/bindings/StylesSourceMapping.ts +1 -1
- package/front_end/models/breakpoints/BreakpointManager.ts +1 -1
- package/front_end/models/crux-manager/CrUXManager.ts +1 -1
- package/front_end/models/emulation/DeviceModeModel.ts +67 -5
- package/front_end/models/emulation/EmulatedDevices.ts +3 -2
- package/front_end/models/extensions/RecorderPluginManager.ts +10 -6
- package/front_end/models/har/Importer.ts +1 -1
- package/front_end/models/har/Log.snapshot.txt +193 -0
- package/front_end/models/har/Log.ts +3 -2
- package/front_end/models/har/Writer.ts +1 -1
- package/front_end/models/issues_manager/IssueAggregator.ts +9 -0
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/LazyLoadImageIssue.ts +76 -0
- package/front_end/models/issues_manager/descriptions/lazyLoadImageZeroSize.md +7 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +9 -10
- package/front_end/models/live-metrics/LiveMetrics.ts +2 -3
- package/front_end/models/logs/NetworkLog.ts +4 -3
- package/front_end/models/logs/logs-meta.ts +3 -3
- package/front_end/models/network_time_calculator/NetworkTimeCalculator.ts +4 -4
- package/front_end/models/persistence/Automapping.ts +1 -1
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +2 -2
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +1 -1
- package/front_end/models/persistence/IsolatedFileSystem.ts +2 -2
- package/front_end/models/persistence/NetworkPersistenceManager.ts +1 -1
- package/front_end/models/persistence/PersistenceImpl.ts +1 -1
- package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
- package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +8 -6
- package/front_end/models/source_map_scopes/NamesResolver.ts +37 -31
- package/front_end/models/stack_trace/StackTrace.ts +17 -0
- package/front_end/models/text_utils/text_utils.ts +2 -24
- package/front_end/models/trace/insights/ImageDelivery.ts +2 -2
- package/front_end/models/trace/insights/LegacyJavaScript.ts +1 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
- package/front_end/models/trace/insights/ThirdParties.ts +1 -1
- package/front_end/models/workspace/FileManager.ts +1 -1
- package/front_end/models/workspace/UISourceCode.ts +1 -1
- package/front_end/models/workspace/WorkspaceImpl.ts +1 -1
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +1 -1
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -1
- package/front_end/panels/accessibility/AccessibilityStrings.ts +2 -2
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -1
- package/front_end/panels/ai_assistance/ExportConversation.ts +1 -1
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +1 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +1 -1
- package/front_end/panels/application/AppManifestView.ts +4 -4
- package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -2
- package/front_end/panels/application/CrashReportContextView.ts +1 -1
- package/front_end/panels/application/DOMStorageItemsView.ts +1 -1
- package/front_end/panels/application/DeviceBoundSessionsView.ts +4 -4
- package/front_end/panels/application/ExtensionStorageItemsView.ts +1 -1
- package/front_end/panels/application/FrameDetailsView.ts +1 -1
- package/front_end/panels/application/IndexedDBModel.ts +0 -10
- package/front_end/panels/application/IndexedDBViews.ts +240 -164
- package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +12 -2
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
- package/front_end/panels/application/SharedStorageModel.ts +0 -10
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/components/AdsView.ts +23 -0
- package/front_end/panels/application/components/BackForwardCacheView.ts +21 -5
- package/front_end/panels/application/components/CrashReportContextGrid.ts +1 -1
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +1 -1
- package/front_end/panels/application/components/TrustTokensView.ts +2 -2
- package/front_end/panels/application/components/adsView.css +21 -1
- package/front_end/panels/application/indexedDBViews.css +1 -1
- package/front_end/panels/application/preloading/PreloadingView.ts +1 -1
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +2 -2
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -4
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +1 -1
- package/front_end/panels/common/ExtensionServer.ts +1 -1
- package/front_end/panels/console/ConsoleFilter.ts +1 -1
- package/front_end/panels/console/ConsoleSidebar.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/console/PromptBuilder.ts +1 -1
- package/front_end/panels/coverage/CoverageDecorationManager.ts +9 -1
- package/front_end/panels/coverage/CoverageModel.ts +1 -1
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +1 -1
- package/front_end/panels/elements/AccessibilityTreeView.ts +38 -3
- package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +1 -1
- package/front_end/panels/elements/ElementIssueUtils.ts +2 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +10 -3
- package/front_end/panels/elements/StandaloneStylesContainer.ts +1 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +1 -1
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +1 -1
- package/front_end/panels/elements/StylesContainer.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/elements/components/CSSPropertyDocsView.ts +1 -1
- package/front_end/panels/explain/components/ConsoleInsight.ts +2 -2
- package/front_end/panels/issues/AffectedLazyLoadImagesView.ts +76 -0
- package/front_end/panels/issues/AffectedResourcesView.ts +1 -1
- package/front_end/panels/issues/CorsIssueDetailsView.ts +1 -1
- package/front_end/panels/issues/IssueView.ts +2 -0
- package/front_end/panels/issues/issues.ts +2 -0
- package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +5 -0
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +1 -1
- package/front_end/panels/network/BinaryResourceView.ts +1 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +72 -8
- package/front_end/panels/network/NetworkLogView.ts +1 -1
- package/front_end/panels/network/NetworkLogViewColumns.ts +6 -6
- package/front_end/panels/network/NetworkPanel.ts +4 -4
- package/front_end/panels/network/NetworkSearchScope.ts +1 -1
- package/front_end/panels/network/RequestConditionsDrawer.ts +1 -1
- package/front_end/panels/network/RequestHTMLView.ts +1 -1
- package/front_end/panels/network/RequestInitiatorView.ts +24 -2
- package/front_end/panels/network/RequestPayloadView.ts +1 -1
- package/front_end/panels/network/RequestPreviewView.ts +1 -1
- package/front_end/panels/network/RequestResponseView.ts +1 -1
- package/front_end/panels/network/ResourceChunkView.ts +1 -1
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +1 -1
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -1
- package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -1
- package/front_end/panels/network/forward/UIRequestLocation.ts +1 -1
- package/front_end/panels/network/network-meta.ts +3 -3
- package/front_end/panels/network/networkLogView.css +5 -0
- package/front_end/panels/network/requestInitiatorViewTree.css +5 -0
- package/front_end/panels/profiler/HeapProfileView.ts +200 -81
- package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
- package/front_end/panels/profiler/ProfileDataGrid.ts +12 -8
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -1
- package/front_end/panels/recorder/README.md +1 -2
- package/front_end/panels/recorder/RecorderPanel.ts +1861 -17
- package/front_end/panels/recorder/RecordingListView.ts +8 -37
- package/front_end/panels/recorder/RecordingView.ts +54 -27
- package/front_end/panels/recorder/SelectorPicker.ts +0 -13
- package/front_end/panels/recorder/StepEditor.ts +6 -14
- package/front_end/panels/recorder/StepView.ts +36 -105
- package/front_end/panels/recorder/recorder.ts +0 -2
- package/front_end/panels/search/SearchResultsPane.ts +1 -1
- package/front_end/panels/security/SecurityPanel.ts +3 -3
- package/front_end/panels/settings/AISettingsTab.ts +17 -4
- package/front_end/panels/settings/components/SyncSection.ts +4 -4
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +3 -3
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
- package/front_end/panels/sources/BreakpointsView.ts +1 -1
- package/front_end/panels/sources/CoveragePlugin.ts +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +4 -4
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +27 -3
- package/front_end/panels/sources/NavigatorView.ts +1 -1
- package/front_end/panels/sources/PersistenceActions.ts +1 -1
- package/front_end/panels/sources/SourcesNavigator.ts +1 -1
- package/front_end/panels/sources/SourcesSearchScope.ts +1 -1
- package/front_end/panels/sources/TabbedEditorContainer.ts +3 -3
- package/front_end/panels/sources/UISourceCodeFrame.ts +1 -1
- package/front_end/panels/sources/components/HeadersView.ts +1 -1
- package/front_end/panels/sources/filteredUISourceCodeListProvider.css +12 -1
- package/front_end/panels/sources/sources-meta.ts +1 -1
- package/front_end/panels/timeline/StatusDialog.ts +1 -1
- package/front_end/panels/timeline/TimelineController.ts +24 -3
- package/front_end/panels/timeline/TimelinePanel.ts +116 -25
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +2 -2
- package/front_end/panels/timeline/TimelineUIUtils.ts +1 -1
- package/front_end/panels/timeline/components/CWVMetrics.ts +1 -1
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -2
- package/front_end/panels/timeline/timeline-meta.ts +13 -0
- package/front_end/services/tracing/TracingManager.ts +27 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1418 -1413
- package/front_end/third_party/lighthouse/locales/en-US.json +12 -6
- package/front_end/third_party/lighthouse/locales/en-XL.json +12 -6
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
- package/front_end/third_party/puppeteer/puppeteer.ts +20 -1
- package/front_end/ui/components/highlighting/HighlightElement.ts +4 -1
- package/front_end/ui/components/highlighting/HighlightManager.ts +1 -1
- package/front_end/ui/components/highlighting/MarkupHighlight.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.ts +46 -2
- package/front_end/ui/components/markdown_view/markdownView.css +23 -0
- package/front_end/ui/components/spinners/Spinner.ts +29 -32
- package/front_end/ui/components/spinners/spinner.css +32 -84
- package/front_end/ui/components/text_editor/config.ts +1 -1
- package/front_end/ui/components/tree_outline/TreeOutline.ts +7 -1
- package/front_end/ui/legacy/Infobar.ts +1 -1
- package/front_end/ui/legacy/InspectorView.ts +12 -7
- package/front_end/ui/legacy/SuggestBox.ts +1 -1
- package/front_end/ui/legacy/TextPrompt.ts +1 -1
- package/front_end/ui/legacy/Toolbar.ts +5 -2
- package/front_end/ui/legacy/Treeoutline.ts +40 -13
- package/front_end/ui/legacy/UIUtils.ts +25 -10
- package/front_end/ui/legacy/Widget.ts +17 -10
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +37 -8
- package/front_end/ui/legacy/components/data_grid/ViewportDataGrid.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingUI.ts +27 -13
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +5 -2
- package/front_end/ui/legacy/components/inline_editor/CSSLinearEasingModel.ts +23 -0
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +223 -121
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/objectValue.css +2 -1
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +105 -115
- package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -3
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +5 -1
- package/front_end/ui/legacy/components/source_frame/jsonView.css +4 -0
- package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +10 -6
- package/front_end/ui/lit/lit.ts +1 -0
- package/front_end/ui/lit/render.ts +44 -10
- package/front_end/ui/lit/strip-whitespace.ts +23 -2
- package/front_end/ui/settings/SettingUIRegistration.ts +105 -0
- package/front_end/ui/settings/settings.ts +9 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +13 -0
- package/mcp/mcp.ts +1 -0
- package/package.json +1 -1
- package/front_end/panels/recorder/RecorderController.ts +0 -1759
- /package/.agents/skills/{verification → devtools-verification}/SKILL.md +0 -0
- /package/front_end/{models → core}/text_utils/CodeMirrorUtils.ts +0 -0
- /package/front_end/{models → core}/text_utils/ContentData.ts +0 -0
- /package/front_end/{models → core}/text_utils/Text.ts +0 -0
- /package/front_end/{models → core}/text_utils/TextCursor.ts +0 -0
- /package/front_end/{models → core}/text_utils/TextUtils.snapshot.txt +0 -0
- /package/front_end/panels/recorder/{recorderController.css → recorderPanel.css} +0 -0
|
@@ -34,12 +34,19 @@ import * as Host from '../../../../core/host/host.js';
|
|
|
34
34
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
35
35
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
36
36
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
37
|
+
import * as TextUtils from '../../../../core/text_utils/text_utils.js';
|
|
37
38
|
import type * as Protocol from '../../../../generated/protocol.js';
|
|
38
|
-
import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
39
39
|
import * as uiI18n from '../../../../ui/i18n/i18n.js';
|
|
40
40
|
import * as Highlighting from '../../../components/highlighting/highlighting.js';
|
|
41
41
|
import * as TextEditor from '../../../components/text_editor/text_editor.js';
|
|
42
|
-
import {
|
|
42
|
+
import {
|
|
43
|
+
type DirectiveResult,
|
|
44
|
+
Directives,
|
|
45
|
+
html,
|
|
46
|
+
type LitTemplate,
|
|
47
|
+
nothing,
|
|
48
|
+
render,
|
|
49
|
+
} from '../../../lit/lit.js';
|
|
43
50
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
44
51
|
import * as UI from '../../legacy.js';
|
|
45
52
|
import type * as Components from '../utils/utils.js';
|
|
@@ -48,9 +55,14 @@ import {CustomPreviewComponent} from './CustomPreviewComponent.js';
|
|
|
48
55
|
import {JavaScriptREPL} from './JavaScriptREPL.js';
|
|
49
56
|
import objectPropertiesSectionStyles from './objectPropertiesSection.css.js';
|
|
50
57
|
import objectValueStyles from './objectValue.css.js';
|
|
51
|
-
import {RemoteObjectPreviewFormatter, renderNodeTitle} from './RemoteObjectPreviewFormatter.js';
|
|
58
|
+
import {RemoteObjectPreviewFormatter, renderNodeTitle, renderTrustedType} from './RemoteObjectPreviewFormatter.js';
|
|
52
59
|
|
|
53
60
|
export {objectPropertiesSectionStyles, objectValueStyles};
|
|
61
|
+
|
|
62
|
+
export interface ObjectPropertySearchResult extends UI.TreeOutline.TreeSearchResult<ObjectTreeNodeBase> {
|
|
63
|
+
matchType: 'name'|'value';
|
|
64
|
+
range: TextUtils.TextRange.SourceRange;
|
|
65
|
+
}
|
|
54
66
|
const {widget} = UI.Widget;
|
|
55
67
|
const {ref, repeat, ifDefined, classMap, until} = Directives;
|
|
56
68
|
const UIStrings = {
|
|
@@ -168,15 +180,7 @@ export interface ObjectTreeOptions {
|
|
|
168
180
|
readonly propertiesMode: ObjectPropertiesMode;
|
|
169
181
|
readonly readOnly: boolean;
|
|
170
182
|
readonly expansionTracker?: ObjectTreeExpansionTracker;
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
let cachedSortAlphabeticallySetting: Common.Settings.Setting<boolean>|undefined;
|
|
174
|
-
export function sortPropertiesAlphabeticallySetting(): Common.Settings.Setting<boolean> {
|
|
175
|
-
if (!cachedSortAlphabeticallySetting) {
|
|
176
|
-
cachedSortAlphabeticallySetting =
|
|
177
|
-
Common.Settings.Settings.instance().createSetting('object-properties-sort-alphabetically', true);
|
|
178
|
-
}
|
|
179
|
-
return cachedSortAlphabeticallySetting;
|
|
183
|
+
readonly search?: UI.TreeOutline.TreeSearch<ObjectTreeNodeBase>;
|
|
180
184
|
}
|
|
181
185
|
|
|
182
186
|
// WASM properties are index-based (e.g. locals[0], globals[1]); alphabetical
|
|
@@ -259,8 +263,8 @@ export class ObjectTreeExpansionTracker {
|
|
|
259
263
|
if (!(node instanceof ObjectTreeNode)) {
|
|
260
264
|
return undefined;
|
|
261
265
|
}
|
|
262
|
-
return node.parent?.children?.internalProperties?.find(
|
|
263
|
-
|
|
266
|
+
return node.parent?.children?.internalProperties?.find(p => p.name === '[[Prototype]]' &&
|
|
267
|
+
p.children?.properties?.includes(node));
|
|
264
268
|
}
|
|
265
269
|
|
|
266
270
|
static #keyType(node: ObjectTreeNodeBase): keyof NodeChildren|null {
|
|
@@ -397,11 +401,15 @@ export abstract class ObjectTreeNodeBase extends Common.ObjectWrapper.ObjectWrap
|
|
|
397
401
|
protected filter: {includeNullOrUndefinedValues: boolean, regex: RegExp|null}|null = null;
|
|
398
402
|
protected extraProperties: ObjectTreeNode[] = [];
|
|
399
403
|
#expanded = false;
|
|
404
|
+
#sortPropertiesAlphabeticallySetting: Common.Settings.Setting<boolean>;
|
|
400
405
|
|
|
401
406
|
constructor(readonly parent: ObjectTreeNodeBase|undefined, options: ObjectTreeOptions) {
|
|
402
407
|
super();
|
|
403
408
|
this.filter = parent?.filter ?? null;
|
|
404
409
|
this.options = {...options};
|
|
410
|
+
this.#sortPropertiesAlphabeticallySetting = parent ?
|
|
411
|
+
parent.#sortPropertiesAlphabeticallySetting :
|
|
412
|
+
Common.Settings.Settings.instance().createSetting('object-properties-sort-alphabetically', true);
|
|
405
413
|
}
|
|
406
414
|
|
|
407
415
|
get isWasm(): boolean {
|
|
@@ -431,6 +439,9 @@ export abstract class ObjectTreeNodeBase extends Common.ObjectWrapper.ObjectWrap
|
|
|
431
439
|
return this.options.propertiesMode;
|
|
432
440
|
}
|
|
433
441
|
|
|
442
|
+
get search(): UI.TreeOutline.TreeSearch<ObjectTreeNodeBase>|undefined {
|
|
443
|
+
return this.options.search;
|
|
444
|
+
}
|
|
434
445
|
get includeNullOrUndefinedValues(): boolean {
|
|
435
446
|
return this.filter?.includeNullOrUndefinedValues ?? true;
|
|
436
447
|
}
|
|
@@ -447,37 +458,36 @@ export abstract class ObjectTreeNodeBase extends Common.ObjectWrapper.ObjectWrap
|
|
|
447
458
|
if (this.isWasm) {
|
|
448
459
|
return false;
|
|
449
460
|
}
|
|
450
|
-
return sortPropertiesAlphabeticallySetting
|
|
461
|
+
return this.#sortPropertiesAlphabeticallySetting.get();
|
|
451
462
|
}
|
|
452
463
|
|
|
453
464
|
set sortPropertiesAlphabetically(value: boolean) {
|
|
454
|
-
|
|
455
|
-
if (this.isWasm || setting.get() === value) {
|
|
465
|
+
if (this.isWasm || this.#sortPropertiesAlphabeticallySetting.get() === value) {
|
|
456
466
|
return;
|
|
457
467
|
}
|
|
458
|
-
|
|
468
|
+
this.#sortPropertiesAlphabeticallySetting.set(value);
|
|
459
469
|
this.removeChildren();
|
|
460
470
|
}
|
|
471
|
+
* treeNodeChildren(): Generator<ObjectTreeNodeBase> {
|
|
472
|
+
if (this.#children) {
|
|
473
|
+
yield* this.#children.properties ?? [];
|
|
474
|
+
yield* this.#children.arrayRanges ?? [];
|
|
475
|
+
yield* this.#children.internalProperties ?? [];
|
|
476
|
+
}
|
|
477
|
+
}
|
|
461
478
|
// Performs a pre-order tree traversal over the populated children. If any children need to be populated, callers must
|
|
462
479
|
// do that while walking (pre-order visitation enables that).
|
|
463
480
|
* #walk(maxDepth = -1, filter?: (node: ObjectTreeNodeBase) => boolean): Generator<ObjectTreeNodeBase> {
|
|
464
481
|
if (filter && !filter(this)) {
|
|
465
482
|
return;
|
|
466
483
|
}
|
|
467
|
-
function* walkChildren(children: ObjectTreeNodeBase[]|undefined): Generator<ObjectTreeNodeBase> {
|
|
468
|
-
if (children) {
|
|
469
|
-
for (const child of children) {
|
|
470
|
-
yield* child.#walk(Math.max(-1, maxDepth - 1), filter);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
484
|
yield this;
|
|
475
485
|
if (maxDepth !== 0) {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
486
|
+
for (const child of this.treeNodeChildren()) {
|
|
487
|
+
yield* child.#walk(Math.max(-1, maxDepth - 1), filter);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
479
490
|
}
|
|
480
|
-
}
|
|
481
491
|
|
|
482
492
|
async expandRecursively(maxDepth: number): Promise<void> {
|
|
483
493
|
for (const node of this.#walk(maxDepth, n => n.canExpandRecursively)) {
|
|
@@ -508,6 +518,9 @@ export abstract class ObjectTreeNodeBase extends Common.ObjectWrapper.ObjectWrap
|
|
|
508
518
|
this.dispatchEventToListeners(ObjectTreeNodeBase.Events.CHILDREN_CHANGED);
|
|
509
519
|
}
|
|
510
520
|
|
|
521
|
+
match(_regex: RegExp): ObjectPropertySearchResult[] {
|
|
522
|
+
return [];
|
|
523
|
+
}
|
|
511
524
|
removeChild(child: ObjectTreeNodeBase): void {
|
|
512
525
|
remove(this.#children?.arrayRanges, child);
|
|
513
526
|
remove(this.#children?.internalProperties, child);
|
|
@@ -563,29 +576,25 @@ export abstract class ObjectTreeNodeBase extends Common.ObjectWrapper.ObjectWrap
|
|
|
563
576
|
const ranges = await arrayRangeGroups(object, 0, this.arrayLength - 1);
|
|
564
577
|
const arrayRanges = ranges?.ranges.map(([fromIndex, toIndex, count]) => new ArrayGroupTreeNode(
|
|
565
578
|
object, {fromIndex, toIndex, count}, effectiveParent, {
|
|
566
|
-
|
|
567
|
-
propertiesMode: this.propertiesMode,
|
|
568
|
-
expansionTracker: this.options.expansionTracker,
|
|
579
|
+
...this.options,
|
|
569
580
|
}));
|
|
570
581
|
if (!arrayRanges) {
|
|
571
582
|
return {};
|
|
572
583
|
}
|
|
573
584
|
|
|
574
585
|
const {properties: objectProperties, internalProperties: objectInternalProperties} =
|
|
575
|
-
await SDK.RemoteObject.RemoteObject.loadFromObjectPerProto(
|
|
576
|
-
|
|
586
|
+
await SDK.RemoteObject.RemoteObject.loadFromObjectPerProto(this.object, true /* generatePreview */,
|
|
587
|
+
true /* nonIndexedPropertiesOnly */);
|
|
577
588
|
|
|
578
589
|
const properties = objectProperties?.map(p => new ObjectTreeNode(p, effectiveParent, {
|
|
579
|
-
|
|
590
|
+
...this.options,
|
|
580
591
|
propertiesMode: ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
|
|
581
|
-
expansionTracker: this.options.expansionTracker,
|
|
582
592
|
}));
|
|
583
593
|
|
|
584
594
|
const internalProperties =
|
|
585
595
|
objectInternalProperties?.map(p => new ObjectTreeNode(p, effectiveParent, {
|
|
586
|
-
|
|
596
|
+
...this.options,
|
|
587
597
|
propertiesMode: ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
|
|
588
|
-
expansionTracker: this.options.expansionTracker,
|
|
589
598
|
}));
|
|
590
599
|
return {arrayRanges, properties, internalProperties};
|
|
591
600
|
}
|
|
@@ -604,9 +613,8 @@ export abstract class ObjectTreeNodeBase extends Common.ObjectWrapper.ObjectWrap
|
|
|
604
613
|
}
|
|
605
614
|
|
|
606
615
|
const properties = objectProperties?.map(p => new ObjectTreeNode(p, effectiveParent, {
|
|
607
|
-
|
|
616
|
+
...this.options,
|
|
608
617
|
propertiesMode: ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
|
|
609
|
-
expansionTracker: this.options.expansionTracker,
|
|
610
618
|
}));
|
|
611
619
|
properties?.push(...this.extraProperties);
|
|
612
620
|
properties?.sort((a, b) => ObjectPropertiesSection.compareProperties(a, b, this.sortPropertiesAlphabetically));
|
|
@@ -614,9 +622,8 @@ export abstract class ObjectTreeNodeBase extends Common.ObjectWrapper.ObjectWrap
|
|
|
614
622
|
|
|
615
623
|
const internalProperties =
|
|
616
624
|
objectInternalProperties?.map(p => new ObjectTreeNode(p, effectiveParent, {
|
|
617
|
-
|
|
625
|
+
...this.options,
|
|
618
626
|
propertiesMode: ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
|
|
619
|
-
expansionTracker: this.options.expansionTracker,
|
|
620
627
|
}));
|
|
621
628
|
return {properties, internalProperties, accessors};
|
|
622
629
|
}
|
|
@@ -636,9 +643,8 @@ export abstract class ObjectTreeNodeBase extends Common.ObjectWrapper.ObjectWrap
|
|
|
636
643
|
|
|
637
644
|
addExtraProperties(...properties: SDK.RemoteObject.RemoteObjectProperty[]): void {
|
|
638
645
|
this.extraProperties.push(...properties.map(p => new ObjectTreeNode(p, this, {
|
|
639
|
-
|
|
646
|
+
...this.options,
|
|
640
647
|
propertiesMode: ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
|
|
641
|
-
expansionTracker: this.options.expansionTracker,
|
|
642
648
|
})));
|
|
643
649
|
}
|
|
644
650
|
|
|
@@ -647,21 +653,21 @@ export abstract class ObjectTreeNodeBase extends Common.ObjectWrapper.ObjectWrap
|
|
|
647
653
|
for (const property of properties) {
|
|
648
654
|
if (property.property.isOwn) {
|
|
649
655
|
if (property.property.getter) {
|
|
650
|
-
const getterProperty = new SDK.RemoteObject.RemoteObjectProperty(
|
|
651
|
-
|
|
656
|
+
const getterProperty = new SDK.RemoteObject.RemoteObjectProperty('get ' + property.property.name,
|
|
657
|
+
property.property.getter, false);
|
|
652
658
|
gettersAndSetters.push(new ObjectTreeNode(getterProperty, property.parent, {
|
|
659
|
+
...options,
|
|
653
660
|
propertiesMode: property.propertiesMode,
|
|
654
661
|
readOnly: property.readOnly,
|
|
655
|
-
expansionTracker: options.expansionTracker,
|
|
656
662
|
}));
|
|
657
663
|
}
|
|
658
664
|
if (property.property.setter) {
|
|
659
|
-
const setterProperty = new SDK.RemoteObject.RemoteObjectProperty(
|
|
660
|
-
|
|
665
|
+
const setterProperty = new SDK.RemoteObject.RemoteObjectProperty('set ' + property.property.name,
|
|
666
|
+
property.property.setter, false);
|
|
661
667
|
gettersAndSetters.push(new ObjectTreeNode(setterProperty, property.parent, {
|
|
668
|
+
...options,
|
|
662
669
|
propertiesMode: property.propertiesMode,
|
|
663
670
|
readOnly: property.readOnly,
|
|
664
|
-
expansionTracker: options.expansionTracker,
|
|
665
671
|
}));
|
|
666
672
|
}
|
|
667
673
|
}
|
|
@@ -706,9 +712,8 @@ interface ArrayGroupRange {
|
|
|
706
712
|
export class ArrayGroupTreeNode extends ObjectTreeNodeBase {
|
|
707
713
|
readonly #object: SDK.RemoteObject.RemoteObject;
|
|
708
714
|
readonly #range: ArrayGroupRange;
|
|
709
|
-
constructor(
|
|
710
|
-
|
|
711
|
-
options: ObjectTreeOptions) {
|
|
715
|
+
constructor(object: SDK.RemoteObject.RemoteObject, range: ArrayGroupRange, parent: ObjectTreeNodeBase,
|
|
716
|
+
options: ObjectTreeOptions) {
|
|
712
717
|
super(parent, options);
|
|
713
718
|
this.#object = object;
|
|
714
719
|
this.#range = range;
|
|
@@ -739,9 +744,7 @@ export class ArrayGroupTreeNode extends ObjectTreeNodeBase {
|
|
|
739
744
|
await arrayFragment.getAllProperties(false /* accessorPropertiesOnly */, true /* generatePreview */);
|
|
740
745
|
arrayFragment.release();
|
|
741
746
|
const properties = allProperties.properties?.map(p => new ObjectTreeNode(p, this, {
|
|
742
|
-
|
|
743
|
-
readOnly: this.readOnly,
|
|
744
|
-
expansionTracker: this.options.expansionTracker,
|
|
747
|
+
...this.options,
|
|
745
748
|
}));
|
|
746
749
|
properties?.push(...this.extraProperties);
|
|
747
750
|
properties?.sort((a, b) => ObjectPropertiesSection.compareProperties(a, b, this.sortPropertiesAlphabetically));
|
|
@@ -867,6 +870,59 @@ export class ObjectTreeNode extends ObjectTreeNodeBase {
|
|
|
867
870
|
this.property.wasThrown = result.wasThrown || false;
|
|
868
871
|
this.dispatchEventToListeners(ObjectTreeNodeBase.Events.VALUE_CHANGED);
|
|
869
872
|
}
|
|
873
|
+
#getSearchableNameText(): string {
|
|
874
|
+
return /^\s|\s$|^$|\n/.test(this.property.name) ? `"${this.property.name.replace(/\n/g, '\u21B5')}"` :
|
|
875
|
+
this.property.name;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
#getSearchableValueText(): string {
|
|
879
|
+
const value = this.property.value;
|
|
880
|
+
if (!value || (value.type !== 'string' && value.type !== 'number') || value.description === undefined) {
|
|
881
|
+
return '';
|
|
882
|
+
}
|
|
883
|
+
if (value.type === 'string' && typeof value.description === 'string') {
|
|
884
|
+
const text = Platform.StringUtilities.safeEscapeUnicode(JSON.stringify(value.description));
|
|
885
|
+
if (value.description.length > maxRenderableStringLength) {
|
|
886
|
+
return text.slice(0, ExpandableTextPropertyValue.EXPANDABLE_MAX_LENGTH);
|
|
887
|
+
}
|
|
888
|
+
return text;
|
|
889
|
+
}
|
|
890
|
+
return value.description;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
override match(regex: RegExp): ObjectPropertySearchResult[] {
|
|
894
|
+
const results: ObjectPropertySearchResult[] = [];
|
|
895
|
+
|
|
896
|
+
// 1. Match name against search text model
|
|
897
|
+
const nameText = this.#getSearchableNameText();
|
|
898
|
+
const nameGlobalRegex = regex.global ? regex : new RegExp(regex.source, regex.flags + 'g');
|
|
899
|
+
for (const m of nameText.matchAll(nameGlobalRegex)) {
|
|
900
|
+
results.push({
|
|
901
|
+
node: this,
|
|
902
|
+
isPostOrderMatch: false,
|
|
903
|
+
matchIndexInNode: results.length,
|
|
904
|
+
matchType: 'name',
|
|
905
|
+
range: new TextUtils.TextRange.SourceRange(m.index ?? 0, m[0].length),
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
// 2. Match value against search text model
|
|
910
|
+
const valueText = this.#getSearchableValueText();
|
|
911
|
+
if (valueText) {
|
|
912
|
+
const valueGlobalRegex = regex.global ? regex : new RegExp(regex.source, regex.flags + 'g');
|
|
913
|
+
for (const m of valueText.matchAll(valueGlobalRegex)) {
|
|
914
|
+
results.push({
|
|
915
|
+
node: this,
|
|
916
|
+
isPostOrderMatch: false,
|
|
917
|
+
matchIndexInNode: results.length,
|
|
918
|
+
matchType: 'value',
|
|
919
|
+
range: new TextUtils.TextRange.SourceRange(m.index ?? 0, m[0].length),
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
return results;
|
|
925
|
+
}
|
|
870
926
|
}
|
|
871
927
|
|
|
872
928
|
export const getObjectPropertiesSectionFrom = (element: Element): ObjectPropertiesSection|undefined => {
|
|
@@ -879,13 +935,14 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
879
935
|
titleElement: Element;
|
|
880
936
|
skipProtoInternal?: boolean;
|
|
881
937
|
|
|
882
|
-
constructor(
|
|
883
|
-
|
|
884
|
-
|
|
938
|
+
constructor(object: SDK.RemoteObject.RemoteObject, title?: string|Element|null,
|
|
939
|
+
linkifier?: Components.Linkifier.Linkifier, showOverflow?: boolean, editable = true,
|
|
940
|
+
search?: UI.TreeOutline.TreeSearch<ObjectTreeNodeBase>) {
|
|
885
941
|
super();
|
|
886
942
|
this.root = new ObjectTree(object, {
|
|
887
943
|
readOnly: !editable,
|
|
888
944
|
propertiesMode: ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
|
|
945
|
+
search,
|
|
889
946
|
});
|
|
890
947
|
if (!showOverflow) {
|
|
891
948
|
this.setHideOverflow(true);
|
|
@@ -896,7 +953,7 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
896
953
|
this.appendChild(this.#objectTreeElement);
|
|
897
954
|
if (typeof title === 'string' || !title) {
|
|
898
955
|
this.titleElement = this.element.createChild('span');
|
|
899
|
-
this.titleElement.textContent = title
|
|
956
|
+
this.titleElement.textContent = title ? Platform.StringUtilities.escapeUnicodeAsText(title) : '';
|
|
900
957
|
} else {
|
|
901
958
|
this.titleElement = title;
|
|
902
959
|
this.element.appendChild(title);
|
|
@@ -910,9 +967,8 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
910
967
|
this.rootElement().childrenListElement.classList.add('source-code', 'object-properties-section');
|
|
911
968
|
}
|
|
912
969
|
|
|
913
|
-
static defaultObjectPresentation(
|
|
914
|
-
|
|
915
|
-
readOnly?: boolean): Element {
|
|
970
|
+
static defaultObjectPresentation(object: SDK.RemoteObject.RemoteObject, linkifier?: Components.Linkifier.Linkifier,
|
|
971
|
+
skipProto?: boolean, readOnly?: boolean): Element {
|
|
916
972
|
const objectPropertiesSection =
|
|
917
973
|
ObjectPropertiesSection.defaultObjectPropertiesSection(object, linkifier, skipProto, readOnly);
|
|
918
974
|
if (!object.hasChildren) {
|
|
@@ -921,9 +977,9 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
921
977
|
return objectPropertiesSection.element;
|
|
922
978
|
}
|
|
923
979
|
|
|
924
|
-
static defaultObjectPropertiesSection(
|
|
925
|
-
|
|
926
|
-
|
|
980
|
+
static defaultObjectPropertiesSection(object: SDK.RemoteObject.RemoteObject,
|
|
981
|
+
linkifier?: Components.Linkifier.Linkifier, skipProto?: boolean,
|
|
982
|
+
readOnly?: boolean): ObjectPropertiesSection {
|
|
927
983
|
const titleElement = document.createElement('span');
|
|
928
984
|
titleElement.classList.add('source-code');
|
|
929
985
|
const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(titleElement, {cssFile: objectValueStyles});
|
|
@@ -1001,24 +1057,25 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
1001
1057
|
if (name === null) {
|
|
1002
1058
|
return element;
|
|
1003
1059
|
}
|
|
1004
|
-
|
|
1005
|
-
|
|
1060
|
+
const escapedName = Platform.StringUtilities.escapeUnicodeAsText(name);
|
|
1061
|
+
if (/^\s|\s$|^$|\n/.test(escapedName)) {
|
|
1062
|
+
element.textContent = `"${escapedName.replace(/\n/g, '\u21B5')}"`;
|
|
1006
1063
|
return element;
|
|
1007
1064
|
}
|
|
1008
1065
|
if (isPrivate) {
|
|
1009
1066
|
const privatePropertyHash = document.createElement('span');
|
|
1010
1067
|
privatePropertyHash.classList.add('private-property-hash');
|
|
1011
|
-
privatePropertyHash.textContent =
|
|
1068
|
+
privatePropertyHash.textContent = escapedName[0];
|
|
1012
1069
|
element.appendChild(privatePropertyHash);
|
|
1013
|
-
element.appendChild(document.createTextNode(
|
|
1070
|
+
element.appendChild(document.createTextNode(escapedName.substring(1)));
|
|
1014
1071
|
return element;
|
|
1015
1072
|
}
|
|
1016
|
-
element.textContent =
|
|
1073
|
+
element.textContent = escapedName;
|
|
1017
1074
|
return element;
|
|
1018
1075
|
}
|
|
1019
1076
|
|
|
1020
|
-
static valueElementForFunctionDescription(
|
|
1021
|
-
|
|
1077
|
+
static valueElementForFunctionDescription(description?: string, includePreview?: boolean, defaultName?: string,
|
|
1078
|
+
className?: string): LitTemplate {
|
|
1022
1079
|
const contents =
|
|
1023
1080
|
(description: string, defaultName: string): {prefix: string, abbreviation: string, body: string} => {
|
|
1024
1081
|
const text = description.replace(/^function [gs]et /, 'function ')
|
|
@@ -1095,17 +1152,17 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
1095
1152
|
}
|
|
1096
1153
|
}
|
|
1097
1154
|
|
|
1098
|
-
static createPropertyValueWithCustomSupport(
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1155
|
+
static createPropertyValueWithCustomSupport(value: SDK.RemoteObject.RemoteObject, wasThrown: boolean,
|
|
1156
|
+
showPreview: boolean, linkifier?: Components.Linkifier.Linkifier,
|
|
1157
|
+
isSyntheticProperty?: boolean, variableName?: string,
|
|
1158
|
+
includeNullOrUndefined?: boolean): HTMLElement {
|
|
1102
1159
|
if (value.customPreview()) {
|
|
1103
1160
|
const result = (new CustomPreviewComponent(value)).element;
|
|
1104
1161
|
result.classList.add('object-properties-section-custom-section');
|
|
1105
1162
|
return result;
|
|
1106
1163
|
}
|
|
1107
|
-
return ObjectPropertiesSection.createPropertyValue(
|
|
1108
|
-
|
|
1164
|
+
return ObjectPropertiesSection.createPropertyValue(value, wasThrown, showPreview, linkifier, isSyntheticProperty,
|
|
1165
|
+
variableName, includeNullOrUndefined);
|
|
1109
1166
|
}
|
|
1110
1167
|
|
|
1111
1168
|
static getMemoryIcon(object: SDK.RemoteObject.RemoteObject, expression?: string): LitTemplate {
|
|
@@ -1132,10 +1189,9 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
1132
1189
|
element.appendChild(fragment);
|
|
1133
1190
|
}
|
|
1134
1191
|
|
|
1135
|
-
static createPropertyValue(
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
includeNullOrUndefined?: boolean): HTMLElement {
|
|
1192
|
+
static createPropertyValue(value: SDK.RemoteObject.RemoteObject, wasThrown: boolean, showPreview: boolean,
|
|
1193
|
+
linkifier?: Components.Linkifier.Linkifier, isSyntheticProperty = false,
|
|
1194
|
+
variableName?: string, includeNullOrUndefined?: boolean): HTMLElement {
|
|
1139
1195
|
const propertyValue = document.createDocumentFragment();
|
|
1140
1196
|
const type = value.type;
|
|
1141
1197
|
const subtype = value.subtype;
|
|
@@ -1149,21 +1205,20 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
1149
1205
|
if (rawLocation && linkifier) {
|
|
1150
1206
|
return html`${linkifier.linkifyRawLocation(rawLocation, Platform.DevToolsPath.EmptyUrlString, 'value')}`;
|
|
1151
1207
|
}
|
|
1152
|
-
|
|
1208
|
+
const title = description || undefined;
|
|
1209
|
+
return html`<span class=value title=${ifDefined(title)}>${'<' + i18nString(UIStrings.unknown) + '>'}</span>`;
|
|
1153
1210
|
}
|
|
1154
1211
|
if (type === 'string' && typeof description === 'string') {
|
|
1155
|
-
const text = Platform.StringUtilities.
|
|
1212
|
+
const text = Platform.StringUtilities.escapeUnicodeAsText(JSON.stringify(description));
|
|
1156
1213
|
const tooLong = description.length > maxRenderableStringLength;
|
|
1157
1214
|
return html`<span class="value object-value-string" title=${ifDefined(tooLong ? undefined : description)}>${
|
|
1158
1215
|
tooLong ? widget(ExpandableTextPropertyValue, {text}) : text}</span>`;
|
|
1159
1216
|
}
|
|
1160
1217
|
if (type === 'object' && subtype === 'trustedtype') {
|
|
1161
|
-
const text = `${className}
|
|
1218
|
+
const text = `${className} "${description}"`;
|
|
1162
1219
|
const tooLong = text.length > maxRenderableStringLength;
|
|
1163
1220
|
return html`<span class="value object-value-trustedtype" title=${ifDefined(tooLong ? undefined : text)}>${
|
|
1164
|
-
tooLong ? widget(ExpandableTextPropertyValue, {text}) :
|
|
1165
|
-
html`${className} <span class=object-value-string title=${description}>${
|
|
1166
|
-
Platform.StringUtilities.escapeUnicode(JSON.stringify(description))}</span>`}</span>`;
|
|
1221
|
+
tooLong ? widget(ExpandableTextPropertyValue, {text}) : renderTrustedType(description, className)}</span>`;
|
|
1167
1222
|
}
|
|
1168
1223
|
if (type === 'function') {
|
|
1169
1224
|
return ObjectPropertiesSection.valueElementForFunctionDescription(description, undefined, undefined, 'value');
|
|
@@ -1194,10 +1249,9 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
1194
1249
|
|
|
1195
1250
|
if (wasThrown) {
|
|
1196
1251
|
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
1197
|
-
render(
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
propertyValue);
|
|
1252
|
+
render(html`<span class="error value">${
|
|
1253
|
+
uiI18n.getFormatLocalizedStringTemplate(str_, UIStrings.exceptionS, {PH1: contents()})}</span>`,
|
|
1254
|
+
propertyValue);
|
|
1201
1255
|
} else {
|
|
1202
1256
|
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
1203
1257
|
render(contents(), propertyValue);
|
|
@@ -1209,9 +1263,8 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
1209
1263
|
return child;
|
|
1210
1264
|
}
|
|
1211
1265
|
|
|
1212
|
-
static formatObjectAsFunction(
|
|
1213
|
-
|
|
1214
|
-
includePreview?: boolean): Promise<void> {
|
|
1266
|
+
static formatObjectAsFunction(func: SDK.RemoteObject.RemoteObject, element: Element, linkify: boolean,
|
|
1267
|
+
includePreview?: boolean): Promise<void> {
|
|
1215
1268
|
return func.debuggerModel().functionDetailsPromise(func).then(didGetDetails);
|
|
1216
1269
|
|
|
1217
1270
|
function didGetDetails(response: SDK.DebuggerModel.FunctionDetails|null): void {
|
|
@@ -1230,16 +1283,14 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
1230
1283
|
}
|
|
1231
1284
|
const valueElement = document.createDocumentFragment();
|
|
1232
1285
|
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
1233
|
-
render(
|
|
1234
|
-
|
|
1235
|
-
valueElement);
|
|
1286
|
+
render(ObjectPropertiesSection.valueElementForFunctionDescription(func.description, includePreview, defaultName),
|
|
1287
|
+
valueElement);
|
|
1236
1288
|
element.appendChild(valueElement);
|
|
1237
1289
|
}
|
|
1238
1290
|
}
|
|
1239
1291
|
|
|
1240
|
-
static isDisplayableProperty(
|
|
1241
|
-
|
|
1242
|
-
parentProperty?: SDK.RemoteObject.RemoteObjectProperty): boolean {
|
|
1292
|
+
static isDisplayableProperty(property: SDK.RemoteObject.RemoteObjectProperty,
|
|
1293
|
+
parentProperty?: SDK.RemoteObject.RemoteObjectProperty): boolean {
|
|
1243
1294
|
if (!parentProperty?.synthetic) {
|
|
1244
1295
|
return true;
|
|
1245
1296
|
}
|
|
@@ -1272,9 +1323,9 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
1272
1323
|
i18nString(UIStrings.expandRecursively),
|
|
1273
1324
|
this.#objectTreeElement.expandRecursively.bind(this.#objectTreeElement, EXPANDABLE_MAX_DEPTH),
|
|
1274
1325
|
{jslogContext: 'expand-recursively'});
|
|
1275
|
-
contextMenu.viewSection().appendItem(
|
|
1276
|
-
|
|
1277
|
-
|
|
1326
|
+
contextMenu.viewSection().appendItem(i18nString(UIStrings.collapseChildren),
|
|
1327
|
+
this.#objectTreeElement.collapseChildren.bind(this.#objectTreeElement),
|
|
1328
|
+
{jslogContext: 'collapse-children'});
|
|
1278
1329
|
}
|
|
1279
1330
|
void contextMenu.show();
|
|
1280
1331
|
}
|
|
@@ -1321,8 +1372,9 @@ export function populateObjectTreeContextMenu(
|
|
|
1321
1372
|
|
|
1322
1373
|
if (object.object instanceof SDK.RemoteObject.LocalJSONObject) {
|
|
1323
1374
|
const {value} = object.object;
|
|
1324
|
-
const propertyValue =
|
|
1325
|
-
|
|
1375
|
+
const propertyValue = typeof value === 'object' ?
|
|
1376
|
+
Platform.StringUtilities.escapeUnicodeAsText(JSON.stringify(value, null, 2)) :
|
|
1377
|
+
value;
|
|
1326
1378
|
const copyValueHandler = (): void => {
|
|
1327
1379
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.NetworkPanelCopyValue);
|
|
1328
1380
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText((propertyValue as string | undefined));
|
|
@@ -1347,15 +1399,16 @@ export function populateObjectTreeContextMenu(
|
|
|
1347
1399
|
{checked: object.includeNullOrUndefinedValues, jslogContext: 'show-all'});
|
|
1348
1400
|
}
|
|
1349
1401
|
|
|
1350
|
-
|
|
1402
|
+
function renderObjectTreeInternal(
|
|
1351
1403
|
objectTree: ObjectTree,
|
|
1352
1404
|
linkifier?: Components.Linkifier.Linkifier,
|
|
1353
1405
|
emptyPlaceholder?: string|null,
|
|
1354
|
-
|
|
1406
|
+
classes: Record<string, boolean> = {},
|
|
1407
|
+
): LitTemplate|DirectiveResult {
|
|
1355
1408
|
const entry = topLevelNodesCache.get(objectTree);
|
|
1356
1409
|
if (entry && entry.linkifier === linkifier) {
|
|
1357
1410
|
return html`
|
|
1358
|
-
<ul class
|
|
1411
|
+
<ul class=${classMap(classes)} role="group">
|
|
1359
1412
|
${entry.nodes.map(node => html`<devtools-tree-wrapper .treeElement=${node}></devtools-tree-wrapper>`)}
|
|
1360
1413
|
</ul>
|
|
1361
1414
|
`;
|
|
@@ -1373,13 +1426,43 @@ export function renderObjectTree(
|
|
|
1373
1426
|
objectTree.addEventListener(ObjectTreeNodeBase.Events.CHILDREN_CHANGED, listener);
|
|
1374
1427
|
|
|
1375
1428
|
return html`
|
|
1376
|
-
<ul class
|
|
1429
|
+
<ul class=${classMap(classes)} role="group">
|
|
1377
1430
|
${nodes.map(node => html`<devtools-tree-wrapper .treeElement=${node}></devtools-tree-wrapper>`)}
|
|
1378
1431
|
</ul>
|
|
1379
1432
|
`;
|
|
1380
1433
|
})();
|
|
1381
1434
|
|
|
1382
|
-
return until(promise, html`<ul class
|
|
1435
|
+
return until(promise, html`<ul class=${classMap(classes)} role="group"></ul>`);
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
export function renderObjectTree(
|
|
1439
|
+
objectTree: ObjectTree,
|
|
1440
|
+
linkifier?: Components.Linkifier.Linkifier,
|
|
1441
|
+
emptyPlaceholder?: string|null,
|
|
1442
|
+
): LitTemplate|DirectiveResult {
|
|
1443
|
+
return renderObjectTreeInternal(objectTree, linkifier, emptyPlaceholder, {
|
|
1444
|
+
'source-code': true,
|
|
1445
|
+
'object-properties-section': true,
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
export function renderObjectPropertiesSection(
|
|
1450
|
+
objectTree: ObjectTree,
|
|
1451
|
+
title: LitTemplate,
|
|
1452
|
+
linkifier?: Components.Linkifier.Linkifier,
|
|
1453
|
+
): LitTemplate {
|
|
1454
|
+
const treeContent = renderObjectTreeInternal(objectTree, linkifier, undefined, {});
|
|
1455
|
+
|
|
1456
|
+
return html`<devtools-tree class="object-properties-section" show-selection-on-keyboard-focus .template=${html`
|
|
1457
|
+
<ul role="tree" class="source-code object-properties-section">
|
|
1458
|
+
<style>${objectValueStyles}</style>
|
|
1459
|
+
<style>${objectPropertiesSectionStyles}</style>
|
|
1460
|
+
<li role="treeitem" class="object-properties-section-root-element" ?open=${objectTree.expanded}>
|
|
1461
|
+
${title}
|
|
1462
|
+
${treeContent}
|
|
1463
|
+
</li>
|
|
1464
|
+
</ul>
|
|
1465
|
+
`}></devtools-tree>`;
|
|
1383
1466
|
}
|
|
1384
1467
|
class RootElement extends UI.TreeOutline.TreeElement {
|
|
1385
1468
|
private readonly object: ObjectTree;
|
|
@@ -1444,8 +1527,8 @@ class RootElement extends UI.TreeOutline.TreeElement {
|
|
|
1444
1527
|
this.removeChildren();
|
|
1445
1528
|
const treeOutline = (this.treeOutline as ObjectPropertiesSection | null);
|
|
1446
1529
|
const skipProto = treeOutline ? Boolean(treeOutline.skipProtoInternal) : false;
|
|
1447
|
-
return await ObjectPropertyTreeElement.populate(
|
|
1448
|
-
|
|
1530
|
+
return await ObjectPropertyTreeElement.populate(this, this.object, skipProto, false, this.linkifier,
|
|
1531
|
+
this.emptyPlaceholder);
|
|
1449
1532
|
}
|
|
1450
1533
|
}
|
|
1451
1534
|
|
|
@@ -1467,6 +1550,7 @@ export interface ObjectPropertyViewInput {
|
|
|
1467
1550
|
editingEnded(): unknown;
|
|
1468
1551
|
editingCommitted(detail: string): unknown;
|
|
1469
1552
|
node: ObjectTreeNode;
|
|
1553
|
+
search?: UI.TreeOutline.TreeSearch<ObjectTreeNodeBase>;
|
|
1470
1554
|
}
|
|
1471
1555
|
interface ObjectPropertyViewOutput {
|
|
1472
1556
|
valueElement: Element|undefined;
|
|
@@ -1496,6 +1580,17 @@ export const OBJECT_PROPERTY_DEFAULT_VIEW: ObjectPropertyView = (input, output,
|
|
|
1496
1580
|
!property.value.customPreview() && property.value.subtype !== 'node' && property.value.type !== 'function' &&
|
|
1497
1581
|
(property.value.type !== 'object' || property.value.preview);
|
|
1498
1582
|
|
|
1583
|
+
const search = input.search;
|
|
1584
|
+
const entries = search?.getResults(input.node) as ObjectPropertySearchResult[] | undefined;
|
|
1585
|
+
const currentMatch = search?.currentMatch() as ObjectPropertySearchResult | undefined;
|
|
1586
|
+
const isCurrentNode = currentMatch?.node === input.node;
|
|
1587
|
+
const nameCurrent = (isCurrentNode && currentMatch?.matchType === 'name') ? currentMatch.range.cssValue() : '';
|
|
1588
|
+
const valueCurrent = (isCurrentNode && currentMatch?.matchType === 'value') ? currentMatch.range.cssValue() : '';
|
|
1589
|
+
|
|
1590
|
+
const nameRanges =
|
|
1591
|
+
(entries ?? []).filter(e => e !== currentMatch && e.matchType === 'name').map(e => e.range.cssValue()).join(' ');
|
|
1592
|
+
const valueRanges =
|
|
1593
|
+
(entries ?? []).filter(e => e !== currentMatch && e.matchType === 'value').map(e => e.range.cssValue()).join(' ');
|
|
1499
1594
|
const value = (): LitTemplate|HTMLElement => {
|
|
1500
1595
|
const valueRef = ref(e => {
|
|
1501
1596
|
output.valueElement = e;
|
|
@@ -1544,9 +1639,9 @@ export const OBJECT_PROPERTY_DEFAULT_VIEW: ObjectPropertyView = (input, output,
|
|
|
1544
1639
|
html`<span class=name-and-value><span
|
|
1545
1640
|
${ref(e => { output.nameElement = e; })}
|
|
1546
1641
|
class=${nameClasses}
|
|
1547
|
-
title=${input.node.path}>${property.private ?
|
|
1642
|
+
title=${input.node.path}><devtools-highlight ranges=${nameRanges} current-range=${nameCurrent}>${property.private ?
|
|
1548
1643
|
html`<span class="private-property-hash">${property.name[0]}</span>${
|
|
1549
|
-
property.name.substring(1)}
|
|
1644
|
+
property.name.substring(1)}` : quotedName}</devtools-highlight></span>${
|
|
1550
1645
|
isInternalEntries ? nothing :
|
|
1551
1646
|
html`<span class='separator'>: </span><devtools-prompt
|
|
1552
1647
|
@commit=${(e: UI.TextPrompt.TextPromptElement.CommitEvent) => input.editingCommitted(e.detail)}
|
|
@@ -1557,7 +1652,8 @@ export const OBJECT_PROPERTY_DEFAULT_VIEW: ObjectPropertyView = (input, output,
|
|
|
1557
1652
|
completions=${completionsId}
|
|
1558
1653
|
placeholder=${i18nString(UIStrings.stringIsTooLargeToEdit)}
|
|
1559
1654
|
?editing=${input.editing}>
|
|
1560
|
-
|
|
1655
|
+
<devtools-highlight ranges=${valueRanges} current-range=${valueCurrent}>${
|
|
1656
|
+
input.expanded && isExpandable && property.value ?
|
|
1561
1657
|
html`<span
|
|
1562
1658
|
class="value object-value-${property.value.subtype || property.value.type}"
|
|
1563
1659
|
title=${ifDefined(property.value.description)}>${
|
|
@@ -1567,7 +1663,7 @@ export const OBJECT_PROPERTY_DEFAULT_VIEW: ObjectPropertyView = (input, output,
|
|
|
1567
1663
|
property.synthetic ? nothing :
|
|
1568
1664
|
ObjectPropertiesSection.getMemoryIcon(property.value)}</span>` :
|
|
1569
1665
|
value()
|
|
1570
|
-
}
|
|
1666
|
+
}</devtools-highlight>
|
|
1571
1667
|
<datalist id=${completionsId}>${repeat(input.completions, c => html`<option>${c}</option>`)}</datalist>
|
|
1572
1668
|
</devtools-prompt></span>`}</span>`,
|
|
1573
1669
|
target);
|
|
@@ -1585,6 +1681,7 @@ export class ObjectPropertyWidget extends UI.Widget.Widget {
|
|
|
1585
1681
|
#expanded = false;
|
|
1586
1682
|
#linkifier: Components.Linkifier.Linkifier|undefined;
|
|
1587
1683
|
#editable = false;
|
|
1684
|
+
#search?: UI.TreeOutline.TreeSearch<ObjectTreeNodeBase>;
|
|
1588
1685
|
|
|
1589
1686
|
constructor(target?: HTMLElement, view = OBJECT_PROPERTY_DEFAULT_VIEW) {
|
|
1590
1687
|
super(target);
|
|
@@ -1600,10 +1697,13 @@ export class ObjectPropertyWidget extends UI.Widget.Widget {
|
|
|
1600
1697
|
this.#property.removeEventListener(ObjectTreeNodeBase.Events.CHILDREN_CHANGED, this.requestUpdate, this);
|
|
1601
1698
|
this.#property.removeEventListener(ObjectTreeNodeBase.Events.FILTER_CHANGED, this.requestUpdate, this);
|
|
1602
1699
|
}
|
|
1700
|
+
this.#search?.removeEventListener(UI.TreeOutline.TreeSearch.Events.SEARCH_CHANGED, this.requestUpdate, this);
|
|
1603
1701
|
this.#property = property;
|
|
1604
1702
|
this.#property.addEventListener(ObjectTreeNodeBase.Events.VALUE_CHANGED, this.requestUpdate, this);
|
|
1605
1703
|
this.#property.addEventListener(ObjectTreeNodeBase.Events.CHILDREN_CHANGED, this.requestUpdate, this);
|
|
1606
1704
|
this.#property.addEventListener(ObjectTreeNodeBase.Events.FILTER_CHANGED, this.requestUpdate, this);
|
|
1705
|
+
this.#search = property.search;
|
|
1706
|
+
this.#search?.addEventListener(UI.TreeOutline.TreeSearch.Events.SEARCH_CHANGED, this.requestUpdate, this);
|
|
1607
1707
|
this.requestUpdate();
|
|
1608
1708
|
}
|
|
1609
1709
|
|
|
@@ -1647,6 +1747,7 @@ export class ObjectPropertyWidget extends UI.Widget.Widget {
|
|
|
1647
1747
|
onAutoComplete: this.#updateCompletions.bind(this),
|
|
1648
1748
|
invokeGetter: this.#invokeGetter.bind(this),
|
|
1649
1749
|
startEditing: this.startEditing.bind(this),
|
|
1750
|
+
search: this.#search,
|
|
1650
1751
|
};
|
|
1651
1752
|
const that = this;
|
|
1652
1753
|
const output: ObjectPropertyViewOutput = {
|
|
@@ -2010,8 +2111,9 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2010
2111
|
contextMenu.appendApplicableItems(this.property.object);
|
|
2011
2112
|
if (this.property.parent?.object instanceof SDK.RemoteObject.LocalJSONObject) {
|
|
2012
2113
|
const {object: {value}} = this.property;
|
|
2013
|
-
const propertyValue =
|
|
2014
|
-
|
|
2114
|
+
const propertyValue = typeof value === 'object' ?
|
|
2115
|
+
Platform.StringUtilities.escapeUnicodeAsText(JSON.stringify(value, null, 2)) :
|
|
2116
|
+
value;
|
|
2015
2117
|
const copyValueHandler = (): void => {
|
|
2016
2118
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.NetworkPanelCopyValue);
|
|
2017
2119
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText((propertyValue as string | undefined));
|
|
@@ -2381,7 +2483,7 @@ export const EXPANDABLE_TEXT_DEFAULT_VIEW: ExpandableTextView = (input, output,
|
|
|
2381
2483
|
data-text=${i18nString(UIStrings.copy)}
|
|
2382
2484
|
jslog=${VisualLogging.action('copy').track({click: true})}
|
|
2383
2485
|
></button>
|
|
2384
|
-
|
|
2486
|
+
</span>`,
|
|
2385
2487
|
// clang-format on
|
|
2386
2488
|
target);
|
|
2387
2489
|
};
|