chrome-devtools-frontend 1.0.1669021 → 1.0.1672557
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 +5 -5
- 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.ts +949 -0
- package/front_end/core/root/Runtime.ts +21 -138
- 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/{SupportedCSSProperties.js → SupportedCSSProperties.ts} +16 -0
- 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.snapshot.txt +1 -1
- 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/PerformanceInsightFormatter.ts +4 -3
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +1 -1
- 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/Processor.ts +42 -10
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +12 -19
- package/front_end/models/trace/handlers/MetaHandler.ts +38 -5
- package/front_end/models/trace/insights/CLSCulprits.ts +1 -2
- package/front_end/models/trace/insights/CharacterSet.ts +1 -1
- package/front_end/models/trace/insights/Common.ts +21 -2
- package/front_end/models/trace/insights/DocumentLatency.ts +1 -1
- package/front_end/models/trace/insights/LCPBreakdown.ts +7 -6
- package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
- package/front_end/models/trace/insights/ModernHTTP.ts +7 -3
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
- package/front_end/models/trace/insights/ThirdParties.ts +5 -2
- package/front_end/models/trace/insights/types.ts +11 -6
- package/front_end/models/trace/types/Configuration.ts +5 -0
- 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/elements/ElementsTreeElement.ts +1 -2
- 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 +14 -12
- 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 +650 -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/TimelinePanel.ts +2 -0
- package/front_end/panels/timeline/TimelineUIUtils.ts +15 -0
- package/front_end/panels/timeline/components/CWVMetrics.ts +16 -3
- package/front_end/panels/timeline/components/cwvMetrics.css +4 -0
- package/front_end/panels/timeline/components/liveMetricsView.css +0 -17
- package/front_end/panels/timeline/components/metricValueStyles.css +17 -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/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +64 -15
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +65 -16
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +50 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js +8 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +16 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js +11 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.js +5 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js +10 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts +27 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js +12 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js +5 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +64 -15
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +50 -7
- package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +9 -7
- package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +9 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Dialog.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +24 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Connection.ts +11 -6
- package/front_end/third_party/puppeteer/package/src/cdp/Dialog.ts +7 -0
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +11 -0
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +7 -3
- package/front_end/third_party/puppeteer/package/src/common/Debug.ts +30 -5
- package/front_end/third_party/puppeteer/package/src/common/util.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +6 -4
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +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 +37 -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
- /package/front_end/generated/{ARIAProperties.js → ARIAProperties.ts} +0 -0
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import {CDPSessionEvent} from '../api/CDPSession.js';
|
|
27
27
|
import type {BoundingBox} from '../api/ElementHandle.js';
|
|
28
28
|
import type {Page, VideoFormat} from '../api/Page.js';
|
|
29
|
-
import {debug} from '../common/Debug.js';
|
|
29
|
+
import {debug, DEBUG_PREFIXES, type Logger} from '../common/Debug.js';
|
|
30
30
|
import {fromEmitterEvent, debugCatchError} from '../common/util.js';
|
|
31
31
|
import {guarded} from '../util/decorators.js';
|
|
32
32
|
import {asyncDisposeSymbol} from '../util/disposable.js';
|
|
@@ -34,8 +34,6 @@ import {asyncDisposeSymbol} from '../util/disposable.js';
|
|
|
34
34
|
const CRF_VALUE = 30;
|
|
35
35
|
const DEFAULT_FPS = 30;
|
|
36
36
|
|
|
37
|
-
const debugFfmpeg = debug('puppeteer:ffmpeg');
|
|
38
|
-
|
|
39
37
|
/**
|
|
40
38
|
* Computes how many encoder frames to emit for a captured frame that spans
|
|
41
39
|
* `[previousTimestamp, timestamp]`, so that the cumulative number of emitted
|
|
@@ -96,6 +94,7 @@ export class ScreenRecorder extends PassThrough {
|
|
|
96
94
|
#lastFrame: Promise<readonly [Buffer, number]>;
|
|
97
95
|
|
|
98
96
|
#fps: number;
|
|
97
|
+
#debugFfmpeg: ((...args: unknown[]) => void) | undefined;
|
|
99
98
|
|
|
100
99
|
/**
|
|
101
100
|
* @internal
|
|
@@ -118,9 +117,12 @@ export class ScreenRecorder extends PassThrough {
|
|
|
118
117
|
path,
|
|
119
118
|
overwrite,
|
|
120
119
|
}: ScreenRecorderOptions = {},
|
|
120
|
+
logger: Logger = debug,
|
|
121
121
|
) {
|
|
122
122
|
super({allowHalfOpen: false});
|
|
123
123
|
|
|
124
|
+
this.#debugFfmpeg = logger(DEBUG_PREFIXES.ffmpeg);
|
|
125
|
+
|
|
124
126
|
ffmpegPath ??= 'ffmpeg';
|
|
125
127
|
format ??= 'webm';
|
|
126
128
|
fps ??= DEFAULT_FPS;
|
|
@@ -216,7 +218,7 @@ export class ScreenRecorder extends PassThrough {
|
|
|
216
218
|
);
|
|
217
219
|
this.#process.stdout.pipe(this);
|
|
218
220
|
this.#process.stderr.on('data', (data: Buffer) => {
|
|
219
|
-
debugFfmpeg?.(data.toString('utf8'));
|
|
221
|
+
this.#debugFfmpeg?.(data.toString('utf8'));
|
|
220
222
|
});
|
|
221
223
|
|
|
222
224
|
this.#page = page;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
export const PUPPETEER_REVISIONS = Object.freeze({
|
|
11
|
-
chrome: '151.0.7922.
|
|
12
|
-
'chrome-headless-shell': '151.0.7922.
|
|
13
|
-
firefox: '
|
|
11
|
+
chrome: '151.0.7922.71',
|
|
12
|
+
'chrome-headless-shell': '151.0.7922.71',
|
|
13
|
+
firefox: 'stable_153.0.1',
|
|
14
14
|
});
|
package/front_end/tsconfig.json
CHANGED
|
@@ -29,7 +29,7 @@ export interface IconButtonData {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export class IconButton extends HTMLElement {
|
|
32
|
-
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
32
|
+
readonly #shadow = this.attachShadow({mode: 'open', delegatesFocus: true});
|
|
33
33
|
#clickHandler?: () => void;
|
|
34
34
|
#groups: IconWithTextData[] = [];
|
|
35
35
|
#compact = false;
|
|
@@ -96,7 +96,7 @@ export function getIssueCountsEnumeration(
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
export class IssueCounter extends HTMLElement {
|
|
99
|
-
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
99
|
+
readonly #shadow = this.attachShadow({mode: 'open', delegatesFocus: true});
|
|
100
100
|
#clickHandler?: () => void;
|
|
101
101
|
#tooltipCallback?: () => void;
|
|
102
102
|
#leadingText = '';
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
/* eslint-disable @devtools/no-lit-render-outside-of-view, @devtools/enforce-custom-element-definitions-location */
|
|
5
5
|
|
|
6
6
|
import '../tooltips/tooltips.js';
|
|
7
|
-
import './SettingDeprecationWarning.js';
|
|
8
7
|
import '../../kit/kit.js';
|
|
9
8
|
|
|
10
9
|
import type * as Common from '../../../core/common/common.js';
|
|
@@ -32,6 +31,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
32
31
|
export interface SettingCheckboxData {
|
|
33
32
|
setting: Common.Settings.Setting<boolean>;
|
|
34
33
|
textOverride?: string;
|
|
34
|
+
disabled?: boolean;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/**
|
|
@@ -43,6 +43,7 @@ export class SettingCheckbox extends HTMLElement {
|
|
|
43
43
|
#setting?: Common.Settings.Setting<boolean>;
|
|
44
44
|
#changeListenerDescriptor?: Common.EventTarget.EventDescriptor;
|
|
45
45
|
#textOverride?: string;
|
|
46
|
+
#disabled?: boolean;
|
|
46
47
|
|
|
47
48
|
set data(data: SettingCheckboxData) {
|
|
48
49
|
if (this.#changeListenerDescriptor && this.#setting) {
|
|
@@ -51,6 +52,7 @@ export class SettingCheckbox extends HTMLElement {
|
|
|
51
52
|
|
|
52
53
|
this.#setting = data.setting;
|
|
53
54
|
this.#textOverride = data.textOverride;
|
|
55
|
+
this.#disabled = data.disabled;
|
|
54
56
|
|
|
55
57
|
this.#changeListenerDescriptor = this.#setting.addChangeListener(() => {
|
|
56
58
|
this.#render();
|
|
@@ -63,11 +65,6 @@ export class SettingCheckbox extends HTMLElement {
|
|
|
63
65
|
return undefined;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
if (this.#setting.deprecation) {
|
|
67
|
-
return html`<devtools-setting-deprecation-warning .data=${
|
|
68
|
-
this.#setting.deprecation}></devtools-setting-deprecation-warning>`;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
68
|
const uiDescriptor = SettingUIRegistration.SettingUIRegistration.maybeResolve(this.#setting.descriptor());
|
|
72
69
|
const learnMore = uiDescriptor?.learnMore ?? this.#setting.learnMore();
|
|
73
70
|
if (learnMore) {
|
|
@@ -160,7 +157,7 @@ export class SettingCheckbox extends HTMLElement {
|
|
|
160
157
|
<input
|
|
161
158
|
type="checkbox"
|
|
162
159
|
.checked=${this.checked}
|
|
163
|
-
?disabled=${this.#setting.disabled()}
|
|
160
|
+
?disabled=${this.#disabled || this.#setting.disabled()}
|
|
164
161
|
@change=${this.#checkboxChanged}
|
|
165
162
|
jslog=${VisualLogging.toggle().track({change: true}).context(this.#setting.name)}
|
|
166
163
|
aria-label=${titleText}
|
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
import * as Common from '../../core/common/common.js';
|
|
38
|
+
import * as Host from '../../core/host/host.js';
|
|
39
|
+
import * as i18n from '../../core/i18n/i18n.js';
|
|
38
40
|
import * as Platform from '../../core/platform/platform.js';
|
|
39
41
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
40
42
|
import type * as TextUtils from '../../core/text_utils/text_utils.js';
|
|
@@ -60,6 +62,23 @@ import {
|
|
|
60
62
|
isEditing,
|
|
61
63
|
} from './UIUtils.js';
|
|
62
64
|
|
|
65
|
+
const UIStrings = {
|
|
66
|
+
/**
|
|
67
|
+
* @description Screen reader announcement made when the user expands a tree item, such as a DOM
|
|
68
|
+
* node in the Elements panel. Uses a polite live region so the tree item's name, role, and
|
|
69
|
+
* position are announced before this state update.
|
|
70
|
+
*/
|
|
71
|
+
expanded: 'expanded',
|
|
72
|
+
/**
|
|
73
|
+
* @description Screen reader announcement made when the user collapses a tree item, such as a DOM
|
|
74
|
+
* node in the Elements panel. Uses a polite live region so the tree item's name, role, and
|
|
75
|
+
* position are announced before this state update.
|
|
76
|
+
*/
|
|
77
|
+
collapsed: 'collapsed',
|
|
78
|
+
} as const;
|
|
79
|
+
const str_ = i18n.i18n.registerUIStrings('ui/legacy/Treeoutline.ts', UIStrings);
|
|
80
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
81
|
+
|
|
63
82
|
const nodeToParentTreeElementMap = new WeakMap<Node, TreeElement>();
|
|
64
83
|
const {render} = Lit;
|
|
65
84
|
|
|
@@ -953,17 +972,7 @@ export class TreeElement {
|
|
|
953
972
|
return;
|
|
954
973
|
}
|
|
955
974
|
|
|
956
|
-
|
|
957
|
-
if (event.altKey) {
|
|
958
|
-
this.collapseRecursively();
|
|
959
|
-
} else {
|
|
960
|
-
this.collapse();
|
|
961
|
-
}
|
|
962
|
-
} else if (event.altKey) {
|
|
963
|
-
void this.expandRecursively();
|
|
964
|
-
} else {
|
|
965
|
-
this.expand();
|
|
966
|
-
}
|
|
975
|
+
void this.#setExpandedFromUser(!this.expanded, event.altKey);
|
|
967
976
|
void VisualLogging.logClick(this.expandLoggable, event);
|
|
968
977
|
event.consume();
|
|
969
978
|
}
|
|
@@ -998,7 +1007,30 @@ export class TreeElement {
|
|
|
998
1007
|
return;
|
|
999
1008
|
}
|
|
1000
1009
|
if (this.expandable && !this.expanded) {
|
|
1001
|
-
this
|
|
1010
|
+
void this.#setExpandedFromUser(true, false);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
async #setExpandedFromUser(shouldExpand: boolean, recursively: boolean): Promise<void> {
|
|
1015
|
+
const wasExpanded = this.expanded;
|
|
1016
|
+
if (shouldExpand) {
|
|
1017
|
+
if (recursively) {
|
|
1018
|
+
await this.expandRecursively();
|
|
1019
|
+
} else {
|
|
1020
|
+
this.expand();
|
|
1021
|
+
}
|
|
1022
|
+
} else if (recursively) {
|
|
1023
|
+
this.collapseRecursively();
|
|
1024
|
+
} else {
|
|
1025
|
+
this.collapse();
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
// When a tree item stays focused, VoiceOver on macOS does not announce the updated
|
|
1029
|
+
// `aria-expanded` state, leaving the user without feedback. Other screen readers announce it
|
|
1030
|
+
// natively, so restrict this live-region announcement to macOS to avoid announcing the state
|
|
1031
|
+
// twice elsewhere.
|
|
1032
|
+
if (this.expanded !== wasExpanded && Host.Platform.isMac()) {
|
|
1033
|
+
ARIAUtils.LiveAnnouncer.status(this.expanded ? i18nString(UIStrings.expanded) : i18nString(UIStrings.collapsed));
|
|
1002
1034
|
}
|
|
1003
1035
|
}
|
|
1004
1036
|
|
|
@@ -1094,11 +1126,7 @@ export class TreeElement {
|
|
|
1094
1126
|
|
|
1095
1127
|
collapseOrAscend(altKey: boolean): boolean {
|
|
1096
1128
|
if (this.expanded && this.collapsible) {
|
|
1097
|
-
|
|
1098
|
-
this.collapseRecursively();
|
|
1099
|
-
} else {
|
|
1100
|
-
this.collapse();
|
|
1101
|
-
}
|
|
1129
|
+
void this.#setExpandedFromUser(false, altKey);
|
|
1102
1130
|
return true;
|
|
1103
1131
|
}
|
|
1104
1132
|
|
|
@@ -1129,11 +1157,7 @@ export class TreeElement {
|
|
|
1129
1157
|
}
|
|
1130
1158
|
|
|
1131
1159
|
if (!this.expanded) {
|
|
1132
|
-
|
|
1133
|
-
void this.expandRecursively();
|
|
1134
|
-
} else {
|
|
1135
|
-
this.expand();
|
|
1136
|
-
}
|
|
1160
|
+
void this.#setExpandedFromUser(true, altKey);
|
|
1137
1161
|
return true;
|
|
1138
1162
|
}
|
|
1139
1163
|
|
|
@@ -1291,15 +1315,13 @@ export class TreeElement {
|
|
|
1291
1315
|
}
|
|
1292
1316
|
|
|
1293
1317
|
onenter(): boolean {
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
if (this.collapsible && this.expanded) {
|
|
1299
|
-
this.collapse();
|
|
1300
|
-
return true;
|
|
1318
|
+
// Expanding requires an expandable node; collapsing requires a collapsible one.
|
|
1319
|
+
const canToggle = this.expanded ? this.collapsible : this.expandable;
|
|
1320
|
+
if (!canToggle) {
|
|
1321
|
+
return false;
|
|
1301
1322
|
}
|
|
1302
|
-
|
|
1323
|
+
void this.#setExpandedFromUser(!this.expanded, false);
|
|
1324
|
+
return true;
|
|
1303
1325
|
}
|
|
1304
1326
|
|
|
1305
1327
|
ondelete(): boolean {
|
|
@@ -0,0 +1,74 @@
|
|
|
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 * as Common from '../../../../core/common/common.js';
|
|
6
|
+
import type * as Platform from '../../../../core/platform/platform.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Builds a regex fragment that matches a CSS identifier even when written
|
|
10
|
+
* with hex escapes (e.g. `\75\72\6c` for `url`).
|
|
11
|
+
*/
|
|
12
|
+
export function cssEscapeRegex(cssString: string): string {
|
|
13
|
+
return [...cssString]
|
|
14
|
+
.map(char => {
|
|
15
|
+
const charCodes = new Set([char.toLowerCase(), char.toUpperCase()].map(c => c.charCodeAt(0).toString(16)));
|
|
16
|
+
const charCodeRegex =
|
|
17
|
+
[...charCodes].map(charCode => `\\\\0{0,${6 - charCode.length}}${charCode}[ \\n\\t]?`).join('|');
|
|
18
|
+
return `\\\\?(?:${charCodeRegex}|${char})`;
|
|
19
|
+
})
|
|
20
|
+
.join('');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const ALLOWED_PROPERTY_PREFIXES = ['background', 'border', 'color', 'font', 'line', 'margin', 'padding', 'text'];
|
|
24
|
+
|
|
25
|
+
// We only allow data URLs with the `url()` CSS function.
|
|
26
|
+
// The capture group is not intended to grab the whole URL exactly, just enough so we can check the scheme.
|
|
27
|
+
// The regex also covers CSS hex-escaped variations of `url()`.
|
|
28
|
+
const URL_REGEX = new RegExp(`(?=${cssEscapeRegex('url')}\\(['"]?([^\\)]*))`, 'gi');
|
|
29
|
+
|
|
30
|
+
// We greedily capture all `image-set()`s to make sure that all of
|
|
31
|
+
// them properly use `url()`s to enforce the data URL check later.
|
|
32
|
+
const IMAGESET_REGEX = new RegExp(`(?=(${cssEscapeRegex('image-set')}\\(.*))`, 'gi');
|
|
33
|
+
const GOOD_IMAGESET_REGEX = /^image-set\((?:(?:(?:url|type)\("[^\\"]*"\)|[\d.]+(?:x|dpi|dpcm|dppx)),?\s*)+\)/i;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Parses `styleToAdd` as a CSS style string and populates `currentStyle`
|
|
37
|
+
* with only the properties that pass safety checks:
|
|
38
|
+
* - Property name must start with one of the allowed prefixes.
|
|
39
|
+
* - `url()` values must use `data:` scheme only.
|
|
40
|
+
* - `image-set()` values must use properly formed `url()`s.
|
|
41
|
+
*
|
|
42
|
+
* The map is cleared before being populated.
|
|
43
|
+
*/
|
|
44
|
+
export function sanitizeStyle(currentStyle: Map<string, {value: string, priority: string}>, styleToAdd: string): void {
|
|
45
|
+
currentStyle.clear();
|
|
46
|
+
// eslint-disable-next-line @devtools/no-imperative-dom-api
|
|
47
|
+
const buffer = document.createElement('span');
|
|
48
|
+
buffer.setAttribute('style', styleToAdd);
|
|
49
|
+
for (const property of buffer.style) {
|
|
50
|
+
if (!ALLOWED_PROPERTY_PREFIXES.some(prefix =>
|
|
51
|
+
property.startsWith(prefix) || property.startsWith(`-webkit-${prefix}`))) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const value = buffer.style.getPropertyValue(property);
|
|
56
|
+
// We make sure every `image-set()` only uses `url()`s for its images.
|
|
57
|
+
// If any of them seem malformed, we skip the whole property.
|
|
58
|
+
const imageSets = [...value.matchAll(IMAGESET_REGEX)];
|
|
59
|
+
if (imageSets.some(match => !GOOD_IMAGESET_REGEX.test(match[1]))) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
// There could be multiple `url()` functions, so we check them all.
|
|
63
|
+
// If any of them is not a `data` URL, we skip the whole property.
|
|
64
|
+
const potentialUrls = [...value.matchAll(URL_REGEX)].map(match => match[1]);
|
|
65
|
+
if (potentialUrls.some(potentialUrl =>
|
|
66
|
+
!Common.ParsedURL.schemeIs(potentialUrl as Platform.DevToolsPath.UrlString, 'data:'))) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
currentStyle.set(property, {
|
|
70
|
+
value,
|
|
71
|
+
priority: buffer.style.getPropertyPriority(property),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -10,6 +10,7 @@ import type * as Protocol from '../../../../generated/protocol.js';
|
|
|
10
10
|
import {createIcon, type Icon} from '../../../kit/kit.js';
|
|
11
11
|
import * as UI from '../../legacy.js';
|
|
12
12
|
|
|
13
|
+
import {sanitizeStyle} from './CSSStyleSanitizer.js';
|
|
13
14
|
import customPreviewComponentStyles from './customPreviewComponent.css.js';
|
|
14
15
|
import {
|
|
15
16
|
ObjectPropertiesMode,
|
|
@@ -108,7 +109,11 @@ export class CustomPreviewSection {
|
|
|
108
109
|
continue;
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
|
|
112
|
+
const sanitizedStyle = new Map<string, {value: string, priority: string}>();
|
|
113
|
+
sanitizeStyle(sanitizedStyle, value);
|
|
114
|
+
for (const [property, {value: propertyValue, priority}] of sanitizedStyle) {
|
|
115
|
+
element.style.setProperty(property, propertyValue, priority);
|
|
116
|
+
}
|
|
112
117
|
}
|
|
113
118
|
}
|
|
114
119
|
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
type LitTemplate,
|
|
47
47
|
nothing,
|
|
48
48
|
render,
|
|
49
|
+
type TemplateResult,
|
|
49
50
|
} from '../../../lit/lit.js';
|
|
50
51
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
51
52
|
import * as UI from '../../legacy.js';
|
|
@@ -1051,31 +1052,9 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
1051
1052
|
return 0;
|
|
1052
1053
|
}
|
|
1053
1054
|
|
|
1054
|
-
static createNameElement(name: string|null, isPrivate?: boolean): Element {
|
|
1055
|
-
const element = document.createElement('span');
|
|
1056
|
-
element.classList.add('name');
|
|
1057
|
-
if (name === null) {
|
|
1058
|
-
return element;
|
|
1059
|
-
}
|
|
1060
|
-
const escapedName = Platform.StringUtilities.escapeUnicodeAsText(name);
|
|
1061
|
-
if (/^\s|\s$|^$|\n/.test(escapedName)) {
|
|
1062
|
-
element.textContent = `"${escapedName.replace(/\n/g, '\u21B5')}"`;
|
|
1063
|
-
return element;
|
|
1064
|
-
}
|
|
1065
|
-
if (isPrivate) {
|
|
1066
|
-
const privatePropertyHash = document.createElement('span');
|
|
1067
|
-
privatePropertyHash.classList.add('private-property-hash');
|
|
1068
|
-
privatePropertyHash.textContent = escapedName[0];
|
|
1069
|
-
element.appendChild(privatePropertyHash);
|
|
1070
|
-
element.appendChild(document.createTextNode(escapedName.substring(1)));
|
|
1071
|
-
return element;
|
|
1072
|
-
}
|
|
1073
|
-
element.textContent = escapedName;
|
|
1074
|
-
return element;
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
1055
|
static valueElementForFunctionDescription(description?: string, includePreview?: boolean, defaultName?: string,
|
|
1078
|
-
|
|
1056
|
+
details?: SDK.DebuggerModel.FunctionDetails|null,
|
|
1057
|
+
linkify?: boolean): LitTemplate {
|
|
1079
1058
|
const contents =
|
|
1080
1059
|
(description: string, defaultName: string): {prefix: string, abbreviation: string, body: string} => {
|
|
1081
1060
|
const text = description.replace(/^function [gs]et /, 'function ')
|
|
@@ -1132,10 +1111,23 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
1132
1111
|
|
|
1133
1112
|
const {prefix, body, abbreviation} = contents(description ?? '', defaultName ?? '');
|
|
1134
1113
|
const maxFunctionBodyLength = 200;
|
|
1114
|
+
|
|
1115
|
+
const location = details?.location;
|
|
1116
|
+
const clickHandler = linkify && location ? (event: Event) => {
|
|
1117
|
+
void Common.Revealer.reveal(location);
|
|
1118
|
+
event.consume(true);
|
|
1119
|
+
} : undefined;
|
|
1120
|
+
|
|
1121
|
+
const classes = classMap({
|
|
1122
|
+
'object-value-function': true,
|
|
1123
|
+
linkified: Boolean(linkify && location),
|
|
1124
|
+
});
|
|
1125
|
+
const title = description ? Platform.StringUtilities.trimEndWithMaxLength(description, 500) : undefined;
|
|
1126
|
+
|
|
1135
1127
|
return html`<span
|
|
1136
|
-
class
|
|
1137
|
-
|
|
1138
|
-
|
|
1128
|
+
class=${classes}
|
|
1129
|
+
@click=${clickHandler || nothing}
|
|
1130
|
+
title=${ifDefined(title)}>${prefix && html`<span class=object-value-function-prefix>${prefix} </span>`}${
|
|
1139
1131
|
includePreview ? Platform.StringUtilities.trimEndWithMaxLength(body.trim(), maxFunctionBodyLength) :
|
|
1140
1132
|
abbreviation.replace(/\n/g, ' ')}</span>`;
|
|
1141
1133
|
|
|
@@ -1221,7 +1213,8 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
1221
1213
|
tooLong ? widget(ExpandableTextPropertyValue, {text}) : renderTrustedType(description, className)}</span>`;
|
|
1222
1214
|
}
|
|
1223
1215
|
if (type === 'function') {
|
|
1224
|
-
return
|
|
1216
|
+
return html`<span class="value">${
|
|
1217
|
+
ObjectPropertiesSection.valueElementForFunctionDescription(description)}</span>`;
|
|
1225
1218
|
}
|
|
1226
1219
|
if (type === 'object' && subtype === 'node' && description) {
|
|
1227
1220
|
return html`<span class="value object-value-node"
|
|
@@ -1263,32 +1256,6 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
|
1263
1256
|
return child;
|
|
1264
1257
|
}
|
|
1265
1258
|
|
|
1266
|
-
static formatObjectAsFunction(func: SDK.RemoteObject.RemoteObject, element: Element, linkify: boolean,
|
|
1267
|
-
includePreview?: boolean): Promise<void> {
|
|
1268
|
-
return func.debuggerModel().functionDetailsPromise(func).then(didGetDetails);
|
|
1269
|
-
|
|
1270
|
-
function didGetDetails(response: SDK.DebuggerModel.FunctionDetails|null): void {
|
|
1271
|
-
if (linkify && response?.location) {
|
|
1272
|
-
element.classList.add('linkified');
|
|
1273
|
-
element.addEventListener('click', () => {
|
|
1274
|
-
void Common.Revealer.reveal(response.location);
|
|
1275
|
-
return false;
|
|
1276
|
-
});
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
// The includePreview flag is false for formats such as console.dir().
|
|
1280
|
-
let defaultName: string|('' | 'anonymous') = includePreview ? '' : 'anonymous';
|
|
1281
|
-
if (response?.functionName) {
|
|
1282
|
-
defaultName = response.functionName;
|
|
1283
|
-
}
|
|
1284
|
-
const valueElement = document.createDocumentFragment();
|
|
1285
|
-
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
1286
|
-
render(ObjectPropertiesSection.valueElementForFunctionDescription(func.description, includePreview, defaultName),
|
|
1287
|
-
valueElement);
|
|
1288
|
-
element.appendChild(valueElement);
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
1259
|
static isDisplayableProperty(property: SDK.RemoteObject.RemoteObjectProperty,
|
|
1293
1260
|
parentProperty?: SDK.RemoteObject.RemoteObjectProperty): boolean {
|
|
1294
1261
|
if (!parentProperty?.synthetic) {
|
|
@@ -1532,6 +1499,32 @@ class RootElement extends UI.TreeOutline.TreeElement {
|
|
|
1532
1499
|
}
|
|
1533
1500
|
}
|
|
1534
1501
|
|
|
1502
|
+
export function renderPropertyName(name: string|null, isPrivate?: boolean, title?: string): TemplateResult {
|
|
1503
|
+
if (name === null) {
|
|
1504
|
+
return html`<span class="name" title=${ifDefined(title)}></span>`;
|
|
1505
|
+
}
|
|
1506
|
+
const escapedName = Platform.StringUtilities.escapeUnicodeAsText(name);
|
|
1507
|
+
if (/^\s|\s$|^$|\n/.test(escapedName)) {
|
|
1508
|
+
return html`<span class="name" title=${ifDefined(title)}>"${escapedName.replace(/\n/g, '\u21B5')}"</span>`;
|
|
1509
|
+
}
|
|
1510
|
+
if (isPrivate) {
|
|
1511
|
+
return html`<span class="name" title=${ifDefined(title)}><span class="private-property-hash">${
|
|
1512
|
+
escapedName[0]}</span>${escapedName.substring(1)}</span>`;
|
|
1513
|
+
}
|
|
1514
|
+
return html`<span class="name" title=${ifDefined(title)}>${escapedName}</span>`;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
export async function formatObjectAsFunction(func: SDK.RemoteObject.RemoteObject, linkify: boolean,
|
|
1518
|
+
includePreview?: boolean): Promise<LitTemplate> {
|
|
1519
|
+
const details = await func.debuggerModel().functionDetailsPromise(func);
|
|
1520
|
+
|
|
1521
|
+
// The includePreview flag is false for formats such as console.dir().
|
|
1522
|
+
const defaultName = details?.functionName ?? (includePreview ? '' : 'anonymous');
|
|
1523
|
+
|
|
1524
|
+
return ObjectPropertiesSection.valueElementForFunctionDescription(func.description, includePreview, defaultName,
|
|
1525
|
+
details, linkify);
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1535
1528
|
/**
|
|
1536
1529
|
* Number of initially visible children in an ObjectPropertyTreeElement.
|
|
1537
1530
|
* Remaining children are shown as soon as requested via a show more properties button.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
import * as CSSStyleSanitizer from './CSSStyleSanitizer.js';
|
|
5
6
|
import * as CustomPreviewComponent from './CustomPreviewComponent.js';
|
|
6
7
|
import * as JavaScriptREPL from './JavaScriptREPL.js';
|
|
7
8
|
import * as ObjectPopoverHelper from './ObjectPopoverHelper.js';
|
|
@@ -9,6 +10,7 @@ import * as ObjectPropertiesSection from './ObjectPropertiesSection.js';
|
|
|
9
10
|
import * as RemoteObjectPreviewFormatter from './RemoteObjectPreviewFormatter.js';
|
|
10
11
|
|
|
11
12
|
export {
|
|
13
|
+
CSSStyleSanitizer,
|
|
12
14
|
CustomPreviewComponent,
|
|
13
15
|
JavaScriptREPL,
|
|
14
16
|
ObjectPopoverHelper,
|
|
@@ -38,10 +38,6 @@ const UIStrings = {
|
|
|
38
38
|
* @description Text for help title of run command menu
|
|
39
39
|
*/
|
|
40
40
|
runCommand: 'Run command',
|
|
41
|
-
/**
|
|
42
|
-
* @description Hint text to indicate that a selected command is deprecated
|
|
43
|
-
*/
|
|
44
|
-
deprecated: '— deprecated',
|
|
45
41
|
} as const;
|
|
46
42
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/quick_open/CommandMenu.ts', UIStrings);
|
|
47
43
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -75,7 +71,6 @@ export class CommandMenu {
|
|
|
75
71
|
executeHandler,
|
|
76
72
|
availableHandler,
|
|
77
73
|
userActionCode,
|
|
78
|
-
deprecationWarning,
|
|
79
74
|
isPanelOrDrawer,
|
|
80
75
|
featurePromotionId,
|
|
81
76
|
} = options;
|
|
@@ -89,9 +84,8 @@ export class CommandMenu {
|
|
|
89
84
|
// not here
|
|
90
85
|
};
|
|
91
86
|
}
|
|
92
|
-
return new Command(
|
|
93
|
-
|
|
94
|
-
featurePromotionId);
|
|
87
|
+
return new Command(category, title, keys, shortcut, jslogContext, handler, availableHandler, isPanelOrDrawer,
|
|
88
|
+
featurePromotionId);
|
|
95
89
|
}
|
|
96
90
|
|
|
97
91
|
static createSettingCommand<V>(setting: Common.Settings.Setting<V>, title: Common.UIString.LocalizedString, value: V,
|
|
@@ -111,11 +105,6 @@ export class CommandMenu {
|
|
|
111
105
|
shortcut: '',
|
|
112
106
|
jslogContext: Platform.StringUtilities.toKebabCase(`${setting.name}-${value}`),
|
|
113
107
|
executeHandler: () => {
|
|
114
|
-
if (setting.deprecation?.disabled &&
|
|
115
|
-
(!setting.deprecation?.experiment || setting.deprecation.experiment.isEnabled())) {
|
|
116
|
-
void Common.Revealer.reveal(setting);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
108
|
setting.set(value);
|
|
120
109
|
|
|
121
110
|
if (setting.name === 'emulate-page-focus') {
|
|
@@ -128,7 +117,6 @@ export class CommandMenu {
|
|
|
128
117
|
}
|
|
129
118
|
},
|
|
130
119
|
availableHandler,
|
|
131
|
-
deprecationWarning: setting.deprecation?.warning,
|
|
132
120
|
});
|
|
133
121
|
|
|
134
122
|
function availableHandler(): boolean {
|
|
@@ -273,7 +261,6 @@ export interface CreateCommandOptions {
|
|
|
273
261
|
executeHandler: () => void;
|
|
274
262
|
availableHandler?: () => boolean;
|
|
275
263
|
userActionCode?: number;
|
|
276
|
-
deprecationWarning?: Platform.UIString.LocalizedString;
|
|
277
264
|
isPanelOrDrawer?: PanelOrDrawer;
|
|
278
265
|
featurePromotionId?: string;
|
|
279
266
|
}
|
|
@@ -357,7 +344,6 @@ export class CommandMenuProvider extends Provider {
|
|
|
357
344
|
override renderItem(itemIndex: number, query: string): TemplateResult {
|
|
358
345
|
const command = this.commands[itemIndex];
|
|
359
346
|
const badge = command.featurePromotionId ? UI.UIUtils.maybeCreateNewBadge(command.featurePromotionId) : undefined;
|
|
360
|
-
const deprecationWarning = command.deprecationWarning;
|
|
361
347
|
// clang-format off
|
|
362
348
|
return html`
|
|
363
349
|
<devtools-icon name=${categoryIcons[command.category]}></devtools-icon>
|
|
@@ -367,10 +353,6 @@ export class CommandMenuProvider extends Provider {
|
|
|
367
353
|
</devtools-highlight>
|
|
368
354
|
${badge ?? nothing}
|
|
369
355
|
<div>${command.shortcut}</div>
|
|
370
|
-
${deprecationWarning ? html`
|
|
371
|
-
<span class="deprecated-tag" title=${deprecationWarning}>
|
|
372
|
-
${i18nString(UIStrings.deprecated)}
|
|
373
|
-
</span>` : nothing}
|
|
374
356
|
</div>
|
|
375
357
|
<span class="tag">${command.category}</span>`;
|
|
376
358
|
// clang-format on
|
|
@@ -422,18 +404,15 @@ export class Command {
|
|
|
422
404
|
readonly key: string;
|
|
423
405
|
readonly shortcut: string;
|
|
424
406
|
readonly jslogContext: string;
|
|
425
|
-
readonly deprecationWarning?: Platform.UIString.LocalizedString;
|
|
426
407
|
readonly isPanelOrDrawer?: PanelOrDrawer;
|
|
427
408
|
readonly featurePromotionId?: string;
|
|
428
409
|
|
|
429
410
|
readonly #executeHandler: () => unknown;
|
|
430
411
|
readonly #availableHandler?: () => boolean;
|
|
431
412
|
|
|
432
|
-
constructor(
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
deprecationWarning?: Platform.UIString.LocalizedString, isPanelOrDrawer?: PanelOrDrawer,
|
|
436
|
-
featurePromotionId?: string) {
|
|
413
|
+
constructor(category: Common.UIString.LocalizedString, title: Common.UIString.LocalizedString, key: string,
|
|
414
|
+
shortcut: string, jslogContext: string, executeHandler: () => unknown, availableHandler?: () => boolean,
|
|
415
|
+
isPanelOrDrawer?: PanelOrDrawer, featurePromotionId?: string) {
|
|
437
416
|
this.category = category;
|
|
438
417
|
this.title = title;
|
|
439
418
|
this.key = category + '\0' + title + '\0' + key;
|
|
@@ -441,7 +420,6 @@ export class Command {
|
|
|
441
420
|
this.jslogContext = jslogContext;
|
|
442
421
|
this.#executeHandler = executeHandler;
|
|
443
422
|
this.#availableHandler = availableHandler;
|
|
444
|
-
this.deprecationWarning = deprecationWarning;
|
|
445
423
|
this.isPanelOrDrawer = isPanelOrDrawer;
|
|
446
424
|
this.featurePromotionId = featurePromotionId;
|
|
447
425
|
}
|