chrome-devtools-frontend 1.0.1545096 → 1.0.1547571
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/.stylelintrc.json +5 -1
- package/docs/contributing/infrastructure.md +2 -2
- package/docs/styleguide/ux/styles.md +1 -1
- package/eslint.config.mjs +2 -1
- package/front_end/Images/generate-css-vars.js +1 -1
- package/front_end/Images/src/arrow-down.svg +8 -1
- package/front_end/Images/src/arrow-up.svg +8 -1
- package/front_end/core/common/common.ts +0 -2
- package/front_end/core/host/AidaClient.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
- package/front_end/core/host/UserMetrics.ts +0 -5
- package/front_end/core/i18n/collect-ui-strings.js +1 -1
- package/front_end/core/i18n/generate-locales-js.js +1 -1
- package/front_end/core/platform/HostRuntime.ts +25 -0
- package/front_end/core/platform/KeyboardUtilities.ts +2 -2
- package/front_end/core/platform/StringUtilities.ts +1 -1
- package/front_end/core/platform/api/HostRuntime.ts +45 -0
- package/front_end/core/platform/api/api.ts +7 -0
- package/front_end/core/{common/Worker.ts → platform/browser/HostRuntime.ts} +27 -12
- package/front_end/core/platform/browser/browser.ts +7 -0
- package/front_end/core/platform/node/HostRuntime.ts +85 -0
- package/front_end/core/platform/node/node.ts +7 -0
- package/front_end/core/platform/platform.ts +2 -2
- package/front_end/core/sdk/AnimationModel.ts +1 -1
- package/front_end/core/sdk/CSSModel.ts +1 -1
- package/front_end/core/sdk/CSSProperty.ts +1 -1
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +1 -1
- package/front_end/core/sdk/ConsoleModel.ts +1 -1
- package/front_end/core/sdk/Cookie.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +2 -2
- package/front_end/core/sdk/DebuggerModel.ts +1 -1
- package/front_end/core/sdk/NetworkManager.ts +6 -0
- package/front_end/core/sdk/PreloadingModel.ts +1 -1
- package/front_end/core/sdk/RemoteObject.ts +1 -1
- package/front_end/core/sdk/ResourceTreeModel.ts +1 -1
- package/front_end/core/sdk/Script.ts +4 -4
- package/front_end/core/sdk/SourceMapScopesInfo.ts +141 -23
- package/front_end/core/sdk/Target.ts +5 -14
- package/front_end/core/sdk/TargetManager.ts +26 -4
- package/front_end/core/sdk/sdk-meta.ts +62 -0
- package/front_end/devtools_compatibility.js +0 -1
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +2 -2
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +15 -18
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +8 -5
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +4 -4
- package/front_end/foundation/Universe.ts +2 -2
- package/front_end/generated/Deprecation.ts +26 -0
- package/front_end/generated/InspectorBackendCommands.ts +5 -4
- package/front_end/generated/SupportedCSSProperties.js +17 -15
- package/front_end/generated/protocol-mapping.d.ts +2 -0
- package/front_end/generated/protocol-proxy-api.d.ts +4 -0
- package/front_end/generated/protocol.ts +19 -29
- package/front_end/models/ai_assistance/AiConversation.ts +268 -0
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -172
- package/front_end/models/ai_assistance/BuiltInAi.ts +131 -134
- package/front_end/models/ai_assistance/ChangeManager.ts +9 -0
- package/front_end/models/ai_assistance/ConversationHandler.ts +27 -52
- package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -8
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +6 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +3 -19
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +313 -313
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +8 -6
- package/front_end/models/ai_assistance/performance/AICallTree.snapshot.txt +33 -33
- package/front_end/models/ai_assistance/performance/AICallTree.ts +9 -3
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +5 -3
- package/front_end/models/bindings/SASSSourceMapping.ts +6 -4
- package/front_end/models/cpu_profile/CPUProfileDataModel.ts +10 -7
- package/front_end/models/crux-manager/CrUXManager.ts +7 -4
- package/front_end/models/formatter/FormatterWorkerPool.ts +9 -7
- package/front_end/models/har/Importer.ts +1 -1
- package/front_end/models/issues_manager/ContrastCheckTrigger.ts +1 -1
- package/front_end/models/issues_manager/GenericIssue.ts +12 -9
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
- package/front_end/models/persistence/AutomaticFileSystemManager.ts +1 -1
- package/front_end/models/trace/handlers/SamplesHandler.ts +3 -0
- package/front_end/models/trace/helpers/Trace.ts +13 -0
- package/front_end/models/trace/types/TraceEvents.ts +2 -1
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +29 -0
- package/front_end/models/workspace/IgnoreListManager.ts +1 -2
- package/front_end/models/workspace/UISourceCode.ts +50 -0
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +86 -159
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +8 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +56 -33
- package/front_end/panels/animation/AnimationTimeline.ts +0 -8
- package/front_end/panels/application/ExtensionStorageModel.ts +1 -1
- package/front_end/panels/application/FrameDetailsView.ts +64 -36
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
- package/front_end/panels/application/components/components.ts +0 -2
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +80 -0
- package/front_end/panels/common/common.ts +2 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +166 -100
- package/front_end/panels/console/ConsolePrompt.ts +4 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +77 -29
- package/front_end/panels/console/ConsoleViewport.ts +2 -3
- package/front_end/panels/console/consoleInsightTeaser.css +1 -0
- package/front_end/panels/coverage/CoverageModel.ts +2 -2
- package/front_end/panels/elements/ElementIssueUtils.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +1 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +17 -7
- package/front_end/panels/elements/NodeStackTraceWidget.ts +6 -5
- package/front_end/panels/elements/StylePropertyTreeElement.ts +24 -21
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/elements/cssValueTraceView.css +1 -1
- package/front_end/panels/elements/elements-meta.ts +1 -0
- package/front_end/panels/explain/components/ConsoleInsight.ts +44 -57
- package/front_end/panels/explain/components/consoleInsight.css +46 -1
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +1 -2
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +19 -0
- package/front_end/panels/network/RequestConditionsDrawer.ts +116 -42
- package/front_end/panels/network/networkLogView.css +11 -0
- package/front_end/panels/network/networkTimingTable.css +8 -6
- package/front_end/panels/network/requestConditionsDrawer.css +10 -1
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotProxy.ts +15 -14
- package/front_end/panels/profiler/ProfilesPanel.ts +1 -2
- package/front_end/panels/recorder/components/StepEditor.ts +1 -1
- package/front_end/panels/security/SecurityPanelSidebar.ts +1 -3
- package/front_end/panels/settings/KeybindsSettingsTab.ts +21 -22
- package/front_end/panels/sources/CSSPlugin.ts +1 -1
- package/front_end/panels/sources/CoveragePlugin.ts +5 -5
- package/front_end/panels/sources/DebuggerPlugin.ts +2 -2
- package/front_end/panels/sources/NavigatorView.ts +1 -1
- package/front_end/panels/sources/Plugin.ts +1 -1
- package/front_end/panels/sources/ProfilePlugin.ts +22 -14
- package/front_end/panels/sources/SourcesSearchScope.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +2 -1
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +10 -2
- package/front_end/panels/sources/sources-meta.ts +0 -62
- package/front_end/panels/timeline/README.md +1 -9
- package/front_end/panels/timeline/ThreadAppender.ts +0 -7
- package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
- package/front_end/panels/timeline/TimelinePanel.ts +8 -8
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -1
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +15 -1
- package/front_end/panels/timeline/components/LiveMetricsView.ts +37 -1
- package/front_end/panels/timeline/components/exportTraceOptions.css +11 -2
- package/front_end/panels/timeline/enable-easter-egg.js +1 -1
- package/front_end/panels/timeline/utils/Treemap.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts +66 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js +57 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +1 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +0 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +18 -23
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +16 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts +4 -62
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js +9 -73
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +8 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +11 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +9 -10
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +80 -81
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts +66 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js +52 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +1 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +0 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +18 -23
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +16 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts +4 -62
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js +6 -69
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +8 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +11 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +9 -10
- package/front_end/third_party/puppeteer/package/package.json +3 -3
- package/front_end/third_party/puppeteer/package/src/api/DeviceRequestPrompt.ts +79 -0
- package/front_end/third_party/puppeteer/package/src/api/Frame.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/api/api.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +1 -9
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +21 -31
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +18 -0
- package/front_end/third_party/puppeteer/package/src/cdp/DeviceRequestPrompt.ts +6 -72
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +7 -2
- package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +14 -0
- 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/third_party/puppeteer/puppeteer-tsconfig.json +1 -0
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -0
- package/front_end/ui/components/text_editor/javascript.ts +1 -1
- package/front_end/ui/legacy/ARIAUtils.ts +2 -2
- package/front_end/ui/legacy/ActionRegistration.ts +11 -0
- package/front_end/ui/legacy/ListWidget.ts +51 -18
- package/front_end/ui/legacy/ReportView.ts +1 -1
- package/front_end/ui/legacy/SoftDropDown.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +3 -3
- package/front_end/ui/legacy/TextPrompt.ts +3 -2
- package/front_end/ui/legacy/Treeoutline.ts +3 -2
- package/front_end/ui/legacy/UIUtils.ts +11 -10
- package/front_end/ui/legacy/Widget.ts +3 -2
- package/front_end/ui/legacy/components/color_picker/ContrastInfo.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +5 -4
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +87 -111
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +62 -39
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -9
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +41 -13
- package/front_end/ui/legacy/components/utils/jsUtils.css +28 -0
- package/front_end/ui/legacy/inspectorCommon.css +2 -2
- package/front_end/ui/legacy/legacy.ts +2 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
- package/front_end/ui/visual_logging/LoggingConfig.ts +2 -1
- package/inspector_overlay/tool_window_controls.ts +4 -1
- package/mcp/mcp.ts +1 -1
- package/package.json +2 -3
- package/front_end/panels/application/components/StackTrace.ts +0 -239
- package/front_end/panels/application/components/stackTraceLinkButton.css +0 -16
- package/front_end/panels/application/components/stackTraceRow.css +0 -50
- package/front_end/panels/explain/components/consoleInsightSourcesList.css +0 -51
- package/front_end/ui/components/docs/README.md +0 -6
- package/front_end/ui/components/docs/building-ui-documentation/ComponentEvents.md +0 -54
- package/front_end/ui/components/docs/building-ui-documentation/ComponentPerformance.md +0 -136
- package/front_end/ui/components/docs/building-ui-documentation/CreatingComponents.md +0 -242
- package/front_end/ui/components/docs/building-ui-documentation/README.md +0 -23
- package/front_end/ui/components/docs/building-ui-documentation/StylingComponents.md +0 -66
- package/front_end/ui/components/docs/building-ui-documentation/TestingComponents.md +0 -111
- package/front_end/ui/components/docs/component_docs.ts +0 -24
- package/front_end/ui/components/docs/component_docs_styles.css +0 -53
- package/front_end/ui/components/docs/create_breadcrumbs.ts +0 -44
- package/front_end/ui/components/docs/slider/basic.html +0 -20
- package/front_end/ui/components/docs/switch/basic.html +0 -20
- /package/front_end/models/issues_manager/descriptions/{genericFormAriaLabelledByToNonExistingId.md → genericFormAriaLabelledByToNonExistingIdError.md} +0 -0
- /package/front_end/models/issues_manager/descriptions/{genericFormLabelHasNeitherForNorNestedInput.md → genericFormLabelHasNeitherForNorNestedInputError.md} +0 -0
- /package/front_end/{core/platform → ui/legacy}/DOMUtilities.ts +0 -0
|
@@ -26,35 +26,114 @@ export class SourceMapScopesInfo {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* If the source map does not contain any scopes information, this factory function attempts to create
|
|
29
|
+
* If the source map does not contain any scopes information, this factory function attempts to create scope information
|
|
30
30
|
* via the script's AST combined with the mappings.
|
|
31
31
|
*
|
|
32
32
|
* We create the generated ranges from the scope tree and for each range we create an original scope that matches the bounds 1:1.
|
|
33
|
-
* We don't map the bounds via mappings as mappings are often iffy and it's not strictly required to translate stack traces where we
|
|
34
|
-
* map call-sites separately.
|
|
35
33
|
*/
|
|
36
34
|
static createFromAst(
|
|
37
35
|
sourceMap: SourceMap, scopeTree: Formatter.FormatterWorkerPool.ScopeTreeNode,
|
|
38
36
|
text: TextUtils.Text.Text): SourceMapScopesInfo {
|
|
39
|
-
const
|
|
40
|
-
|
|
37
|
+
const numSourceUrls = sourceMap.sourceURLs().length;
|
|
38
|
+
const scopeBySourceUrl: ScopesCodec.OriginalScope[] = [];
|
|
39
|
+
for (let i = 0; i < numSourceUrls; i++) {
|
|
40
|
+
const scope: ScopesCodec.OriginalScope = {
|
|
41
|
+
start: {line: 0, column: 0},
|
|
42
|
+
end: {line: Number.POSITIVE_INFINITY, column: Number.POSITIVE_INFINITY},
|
|
43
|
+
isStackFrame: false,
|
|
44
|
+
variables: [],
|
|
45
|
+
children: [],
|
|
46
|
+
};
|
|
47
|
+
scopeBySourceUrl.push(scope);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Convert the entire scopeTree. Returns a root range that encompasses everything,
|
|
51
|
+
// and inserts scopes by sourceIndex into the above scopeBySourceUrl.
|
|
52
|
+
const {range} = convertScope(scopeTree, undefined);
|
|
53
|
+
return new SourceMapScopesInfo(sourceMap, {scopes: scopeBySourceUrl, ranges: [range]});
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Recursively finds the correct place in the tree to insert the new scope.
|
|
57
|
+
* Maintains the invariant that children are sorted and contained by their parent.
|
|
58
|
+
*/
|
|
59
|
+
function insertInScope(parent: ScopesCodec.OriginalScope, newScope: ScopesCodec.OriginalScope): void {
|
|
60
|
+
// Check if the newScope fits strictly inside any of the existing children.
|
|
61
|
+
for (const child of parent.children) {
|
|
62
|
+
if (contains(child, newScope)) {
|
|
63
|
+
insertInScope(child, newScope);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// When here, newScope belongs directly in parent.
|
|
69
|
+
// However, newScope might encompass some of parent's existing children (due
|
|
70
|
+
// to compiler transform quirks or arbitrary insertion order). We must move
|
|
71
|
+
// those children inside newScope.
|
|
72
|
+
const childrenToKeep: ScopesCodec.OriginalScope[] = [];
|
|
73
|
+
for (const child of parent.children) {
|
|
74
|
+
if (contains(newScope, child)) {
|
|
75
|
+
// child is actually inside newScope, so re-parent it.
|
|
76
|
+
newScope.children.push(child);
|
|
77
|
+
child.parent = newScope;
|
|
78
|
+
} else {
|
|
79
|
+
childrenToKeep.push(child);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Find the correct index in the remaining children to insert newScope.
|
|
84
|
+
// We look for the first child that starts after the new scope.
|
|
85
|
+
const insertIndex = childrenToKeep.findIndex(child => compareScopes(newScope, child) < 0);
|
|
86
|
+
if (insertIndex === -1) {
|
|
87
|
+
// If no child starts after, it goes at the end.
|
|
88
|
+
childrenToKeep.push(newScope);
|
|
89
|
+
} else {
|
|
90
|
+
childrenToKeep.splice(insertIndex, 0, newScope);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Update parent's children to only be the ones that don't belong to newScope.
|
|
94
|
+
parent.children = childrenToKeep;
|
|
95
|
+
newScope.parent = parent;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function contains(outer: ScopesCodec.OriginalScope, inner: ScopesCodec.OriginalScope): boolean {
|
|
99
|
+
return comparePositions(outer.start, inner.start) <= 0 && comparePositions(outer.end, inner.end) >= 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function compareScopes(a: ScopesCodec.OriginalScope, b: ScopesCodec.OriginalScope): number {
|
|
103
|
+
return comparePositions(a.start, b.start);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function comparePositions(a: ScopesCodec.Position, b: ScopesCodec.Position): number {
|
|
107
|
+
if (a.line !== b.line) {
|
|
108
|
+
return a.line - b.line;
|
|
109
|
+
}
|
|
110
|
+
return a.column - b.column;
|
|
111
|
+
}
|
|
41
112
|
|
|
42
113
|
function convertScope(
|
|
43
|
-
node: Formatter.FormatterWorkerPool.ScopeTreeNode,
|
|
44
|
-
parentRange: ScopesCodec.GeneratedRange|
|
|
45
|
-
undefined): {scope: ScopesCodec.OriginalScope, range: ScopesCodec.GeneratedRange} {
|
|
114
|
+
node: Formatter.FormatterWorkerPool.ScopeTreeNode,
|
|
115
|
+
parentRange: ScopesCodec.GeneratedRange|undefined): {range: ScopesCodec.GeneratedRange} {
|
|
46
116
|
const start = positionFromOffset(node.start);
|
|
47
117
|
const end = positionFromOffset(node.end);
|
|
118
|
+
const startEntry = sourceMap.findEntry(start.line, start.column);
|
|
119
|
+
const endEntry = sourceMap.findEntry(end.line, end.column);
|
|
120
|
+
const sourceIndex = startEntry?.sourceIndex;
|
|
121
|
+
const canMapOriginalPosition = startEntry && endEntry && sourceIndex !== undefined &&
|
|
122
|
+
startEntry.sourceIndex === endEntry.sourceIndex && startEntry.sourceIndex !== undefined && sourceIndex >= 0 &&
|
|
123
|
+
sourceIndex < numSourceUrls;
|
|
48
124
|
const isStackFrame = node.kind === Formatter.FormatterWorkerPool.ScopeKind.FUNCTION;
|
|
49
125
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
126
|
+
let scope: ScopesCodec.OriginalScope|undefined;
|
|
127
|
+
if (canMapOriginalPosition) {
|
|
128
|
+
scope = {
|
|
129
|
+
start: {line: startEntry.sourceLineNumber, column: startEntry.sourceColumnNumber},
|
|
130
|
+
end: {line: endEntry.sourceLineNumber, column: endEntry.sourceColumnNumber},
|
|
131
|
+
name: startEntry.name,
|
|
132
|
+
isStackFrame,
|
|
133
|
+
variables: [],
|
|
134
|
+
children: [],
|
|
135
|
+
};
|
|
136
|
+
}
|
|
58
137
|
|
|
59
138
|
const range: ScopesCodec.GeneratedRange = {
|
|
60
139
|
start,
|
|
@@ -67,11 +146,14 @@ export class SourceMapScopesInfo {
|
|
|
67
146
|
};
|
|
68
147
|
|
|
69
148
|
parentRange?.children.push(range);
|
|
70
|
-
|
|
149
|
+
if (canMapOriginalPosition && scope) {
|
|
150
|
+
const rootScope = scopeBySourceUrl[sourceIndex];
|
|
151
|
+
insertInScope(rootScope, scope);
|
|
152
|
+
}
|
|
71
153
|
|
|
72
|
-
node.children.forEach(child => convertScope(child,
|
|
154
|
+
node.children.forEach(child => convertScope(child, range));
|
|
73
155
|
|
|
74
|
-
return {
|
|
156
|
+
return {range};
|
|
75
157
|
}
|
|
76
158
|
|
|
77
159
|
function positionFromOffset(offset: number): ScopesCodec.Position {
|
|
@@ -347,7 +429,16 @@ export class SourceMapScopesInfo {
|
|
|
347
429
|
/**
|
|
348
430
|
* Returns the authored function name of the function containing the provided generated position.
|
|
349
431
|
*/
|
|
350
|
-
findOriginalFunctionName(
|
|
432
|
+
findOriginalFunctionName(position: ScopesCodec.Position): string|null {
|
|
433
|
+
const originalInnerMostScope = this.findOriginalFunctionScope(position)?.scope ?? undefined;
|
|
434
|
+
return this.#findFunctionNameInOriginalScopeChain(originalInnerMostScope);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Returns the authored function scope of the function containing the provided generated position.
|
|
439
|
+
*/
|
|
440
|
+
findOriginalFunctionScope({line, column}: ScopesCodec.Position):
|
|
441
|
+
{scope: ScopesCodec.OriginalScope, url?: Platform.DevToolsPath.UrlString}|null {
|
|
351
442
|
// There are 2 approaches:
|
|
352
443
|
// 1) Find the inner-most generated range containing the provided generated position
|
|
353
444
|
// and use it's OriginalScope (then walk it outwards until we hit a function).
|
|
@@ -376,7 +467,24 @@ export class SourceMapScopesInfo {
|
|
|
376
467
|
.at(-1);
|
|
377
468
|
}
|
|
378
469
|
|
|
379
|
-
|
|
470
|
+
if (!originalInnerMostScope) {
|
|
471
|
+
return null;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
const functionScope = this.#findFunctionScopeInOriginalScopeChain(originalInnerMostScope);
|
|
475
|
+
if (!functionScope) {
|
|
476
|
+
return null;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// Find the root scope for some given original source, to get the source url.
|
|
480
|
+
let rootScope: ScopesCodec.OriginalScope = functionScope;
|
|
481
|
+
while (rootScope.parent) {
|
|
482
|
+
rootScope = rootScope.parent;
|
|
483
|
+
}
|
|
484
|
+
const sourceIndex = this.#originalScopes.indexOf(rootScope);
|
|
485
|
+
const url = sourceIndex !== -1 ? this.#sourceMap.sourceURLForSourceIndex(sourceIndex) : undefined;
|
|
486
|
+
|
|
487
|
+
return functionScope ? {scope: functionScope, url} : null;
|
|
380
488
|
}
|
|
381
489
|
|
|
382
490
|
/**
|
|
@@ -403,15 +511,25 @@ export class SourceMapScopesInfo {
|
|
|
403
511
|
return result;
|
|
404
512
|
}
|
|
405
513
|
|
|
406
|
-
#
|
|
514
|
+
#findFunctionScopeInOriginalScopeChain(innerOriginalScope: ScopesCodec.OriginalScope|undefined):
|
|
515
|
+
ScopesCodec.OriginalScope|null {
|
|
407
516
|
for (let originalScope = innerOriginalScope; originalScope; originalScope = originalScope.parent) {
|
|
408
517
|
if (originalScope.isStackFrame) {
|
|
409
|
-
return originalScope
|
|
518
|
+
return originalScope;
|
|
410
519
|
}
|
|
411
520
|
}
|
|
412
521
|
return null;
|
|
413
522
|
}
|
|
414
523
|
|
|
524
|
+
#findFunctionNameInOriginalScopeChain(innerOriginalScope: ScopesCodec.OriginalScope|undefined): string|null {
|
|
525
|
+
const functionScope = this.#findFunctionScopeInOriginalScopeChain(innerOriginalScope);
|
|
526
|
+
if (!functionScope) {
|
|
527
|
+
return null;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
return functionScope.name ?? '';
|
|
531
|
+
}
|
|
532
|
+
|
|
415
533
|
/**
|
|
416
534
|
* Returns one or more original stack frames for this single "raw frame" or call-site.
|
|
417
535
|
*
|
|
@@ -7,7 +7,7 @@ import * as Common from '../common/common.js';
|
|
|
7
7
|
import * as Platform from '../platform/platform.js';
|
|
8
8
|
import * as ProtocolClient from '../protocol_client/protocol_client.js';
|
|
9
9
|
|
|
10
|
-
import {SDKModel} from './SDKModel.js';
|
|
10
|
+
import {SDKModel, type SDKModelConstructor} from './SDKModel.js';
|
|
11
11
|
import type {TargetManager} from './TargetManager.js';
|
|
12
12
|
|
|
13
13
|
export class Target extends ProtocolClient.InspectorBackend.TargetBase {
|
|
@@ -111,20 +111,11 @@ export class Target extends ProtocolClient.InspectorBackend.TargetBase {
|
|
|
111
111
|
this.#targetInfo = targetInfo;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
/** Creates the models in the order in which they are provided */
|
|
115
|
+
createModels(models: SDKModelConstructor[]): void {
|
|
115
116
|
this.#creatingModels = true;
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
for (const [modelClass, info] of registeredModels) {
|
|
119
|
-
if (info.early) {
|
|
120
|
-
this.model(modelClass);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
// Create autostart and required models.
|
|
124
|
-
for (const [modelClass, info] of registeredModels) {
|
|
125
|
-
if (info.autostart || required.has(modelClass)) {
|
|
126
|
-
this.model(modelClass);
|
|
127
|
-
}
|
|
117
|
+
for (const model of models) {
|
|
118
|
+
this.model(model);
|
|
128
119
|
}
|
|
129
120
|
this.#creatingModels = false;
|
|
130
121
|
}
|
|
@@ -10,7 +10,7 @@ import {assertNotNullOrUndefined} from '../platform/platform.js';
|
|
|
10
10
|
import type * as ProtocolClient from '../protocol_client/protocol_client.js';
|
|
11
11
|
import * as Root from '../root/root.js';
|
|
12
12
|
|
|
13
|
-
import {SDKModel, type SDKModelConstructor} from './SDKModel.js';
|
|
13
|
+
import {type RegistrationInfo, SDKModel, type SDKModelConstructor} from './SDKModel.js';
|
|
14
14
|
import {Target, Type as TargetType} from './Target.js';
|
|
15
15
|
|
|
16
16
|
export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
@@ -31,8 +31,12 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
31
31
|
#scopeTarget: Target|null;
|
|
32
32
|
#defaultScopeSet: boolean;
|
|
33
33
|
readonly #scopeChangeListeners: Set<() => void>;
|
|
34
|
+
readonly #overrideAutoStartModels?: Set<SDKModelConstructor>;
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
/**
|
|
37
|
+
* @param overrideAutoStartModels If provided, then the `autostart` flag on {@link RegistrationInfo} will be ignored.
|
|
38
|
+
*/
|
|
39
|
+
constructor(overrideAutoStartModels?: Set<SDKModelConstructor>) {
|
|
36
40
|
super();
|
|
37
41
|
this.#targets = new Set();
|
|
38
42
|
this.#observers = new Set();
|
|
@@ -44,6 +48,7 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
44
48
|
this.#scopedObservers = new WeakSet();
|
|
45
49
|
this.#defaultScopeSet = false;
|
|
46
50
|
this.#scopeChangeListeners = new Set();
|
|
51
|
+
this.#overrideAutoStartModels = overrideAutoStartModels;
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
static instance({forceNew}: {
|
|
@@ -205,6 +210,23 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
205
210
|
this.#scopedObservers.delete(targetObserver);
|
|
206
211
|
}
|
|
207
212
|
|
|
213
|
+
/** @returns The set of models we create unconditionally for new targets in the order in which they should be created */
|
|
214
|
+
#autoStartModels(): SDKModelConstructor[] {
|
|
215
|
+
const earlyModels = new Set<SDKModelConstructor>();
|
|
216
|
+
const models = new Set<SDKModelConstructor>();
|
|
217
|
+
const shouldAutostart = (model: SDKModelConstructor, info: RegistrationInfo): boolean =>
|
|
218
|
+
this.#overrideAutoStartModels ? this.#overrideAutoStartModels.has(model) : info.autostart;
|
|
219
|
+
|
|
220
|
+
for (const [model, info] of SDKModel.registeredModels) {
|
|
221
|
+
if (info.early) {
|
|
222
|
+
earlyModels.add(model);
|
|
223
|
+
} else if (shouldAutostart(model, info) || this.#modelObservers.has(model)) {
|
|
224
|
+
models.add(model);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return [...earlyModels, ...models];
|
|
228
|
+
}
|
|
229
|
+
|
|
208
230
|
createTarget(
|
|
209
231
|
id: Protocol.Target.TargetID|'main', name: string, type: TargetType, parentTarget: Target|null,
|
|
210
232
|
sessionId?: string, waitForDebuggerInPage?: boolean, connection?: ProtocolClient.CDPConnection.CDPConnection,
|
|
@@ -214,7 +236,7 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
214
236
|
if (waitForDebuggerInPage) {
|
|
215
237
|
void target.pageAgent().invoke_waitForDebugger();
|
|
216
238
|
}
|
|
217
|
-
target.createModels(
|
|
239
|
+
target.createModels(this.#autoStartModels());
|
|
218
240
|
this.#targets.add(target);
|
|
219
241
|
|
|
220
242
|
const inScope = this.isInScope(target);
|
|
@@ -316,7 +338,7 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
316
338
|
this.#browserTarget = new Target(
|
|
317
339
|
this, /* #id*/ 'main', /* #name*/ 'browser', TargetType.BROWSER, /* #parentTarget*/ null,
|
|
318
340
|
/* #sessionId */ '', /* suspended*/ false, /* #connection*/ null, /* targetInfo*/ undefined);
|
|
319
|
-
this.#browserTarget.createModels(
|
|
341
|
+
this.#browserTarget.createModels(this.#autoStartModels());
|
|
320
342
|
}
|
|
321
343
|
const targetId =
|
|
322
344
|
await Host.InspectorFrontendHost.InspectorFrontendHostInstance.initialTargetId() as Protocol.Target.TargetID;
|
|
@@ -363,6 +363,30 @@ const UIStrings = {
|
|
|
363
363
|
*/
|
|
364
364
|
networkCacheExplanation:
|
|
365
365
|
'Disabling the network cache will simulate a network experience similar to a first time visitor.',
|
|
366
|
+
/**
|
|
367
|
+
* @description Setting under the Sources category to toggle usage of JavaScript source maps.
|
|
368
|
+
*/
|
|
369
|
+
javaScriptSourceMaps: 'JavaScript source maps',
|
|
370
|
+
/**
|
|
371
|
+
* @description Title of a setting under the Sources category that can be invoked through the Command Menu
|
|
372
|
+
*/
|
|
373
|
+
enableJavaScriptSourceMaps: 'Enable JavaScript source maps',
|
|
374
|
+
/**
|
|
375
|
+
* @description Title of a setting under the Sources category that can be invoked through the Command Menu
|
|
376
|
+
*/
|
|
377
|
+
disableJavaScriptSourceMaps: 'Disable JavaScript source maps',
|
|
378
|
+
/**
|
|
379
|
+
* @description Title of a setting under the Sources category
|
|
380
|
+
*/
|
|
381
|
+
cssSourceMaps: 'CSS source maps',
|
|
382
|
+
/**
|
|
383
|
+
* @description Title of a setting under the Sources category that can be invoked through the Command Menu
|
|
384
|
+
*/
|
|
385
|
+
enableCssSourceMaps: 'Enable CSS source maps',
|
|
386
|
+
/**
|
|
387
|
+
* @description Title of a setting under the Sources category that can be invoked through the Command Menu
|
|
388
|
+
*/
|
|
389
|
+
disableCssSourceMaps: 'Disable CSS source maps',
|
|
366
390
|
} as const;
|
|
367
391
|
const str_ = i18n.i18n.registerUIStrings('core/sdk/sdk-meta.ts', UIStrings);
|
|
368
392
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
@@ -1132,3 +1156,41 @@ Common.Settings.registerSettingExtension({
|
|
|
1132
1156
|
tooltip: i18nLazyString(UIStrings.remoteFileLoadingInfo),
|
|
1133
1157
|
}
|
|
1134
1158
|
});
|
|
1159
|
+
|
|
1160
|
+
Common.Settings.registerSettingExtension({
|
|
1161
|
+
category: Common.Settings.SettingCategory.SOURCES,
|
|
1162
|
+
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
1163
|
+
title: i18nLazyString(UIStrings.javaScriptSourceMaps),
|
|
1164
|
+
settingName: 'js-source-maps-enabled',
|
|
1165
|
+
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
1166
|
+
defaultValue: true,
|
|
1167
|
+
options: [
|
|
1168
|
+
{
|
|
1169
|
+
value: true,
|
|
1170
|
+
title: i18nLazyString(UIStrings.enableJavaScriptSourceMaps),
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
value: false,
|
|
1174
|
+
title: i18nLazyString(UIStrings.disableJavaScriptSourceMaps),
|
|
1175
|
+
},
|
|
1176
|
+
],
|
|
1177
|
+
});
|
|
1178
|
+
|
|
1179
|
+
Common.Settings.registerSettingExtension({
|
|
1180
|
+
category: Common.Settings.SettingCategory.SOURCES,
|
|
1181
|
+
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
1182
|
+
title: i18nLazyString(UIStrings.cssSourceMaps),
|
|
1183
|
+
settingName: 'css-source-maps-enabled',
|
|
1184
|
+
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
1185
|
+
defaultValue: true,
|
|
1186
|
+
options: [
|
|
1187
|
+
{
|
|
1188
|
+
value: true,
|
|
1189
|
+
title: i18nLazyString(UIStrings.enableCssSourceMaps),
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
value: false,
|
|
1193
|
+
title: i18nLazyString(UIStrings.disableCssSourceMaps),
|
|
1194
|
+
},
|
|
1195
|
+
],
|
|
1196
|
+
});
|
|
@@ -450,7 +450,6 @@
|
|
|
450
450
|
TimelineNavigationSettingState: 'DevTools.TimelineNavigationSettingState',
|
|
451
451
|
SyncSetting: 'DevTools.SyncSetting',
|
|
452
452
|
SwatchActivated: 'DevTools.SwatchActivated',
|
|
453
|
-
AnimationPlaybackRateChanged: 'DevTools.AnimationPlaybackRateChanged',
|
|
454
453
|
BuiltInAiAvailability: 'DevTools.BuiltInAiAvailability'
|
|
455
454
|
// LINT.ThenChange(/front_end/core/host/InspectorFrontendHostAPI.ts:EnumeratedHistogram)
|
|
456
455
|
};
|
|
@@ -260,8 +260,8 @@ export class HTMLModel {
|
|
|
260
260
|
this.#updateDOM(token);
|
|
261
261
|
|
|
262
262
|
const element = this.#stack[this.#stack.length - 1];
|
|
263
|
-
if (element && (element.name === 'script' || element.name === 'style') &&
|
|
264
|
-
element.openTag
|
|
263
|
+
if (element && (element.name === 'script' || element.name === 'style') &&
|
|
264
|
+
element.openTag?.endOffset === lastOffset) {
|
|
265
265
|
return AbortTokenization;
|
|
266
266
|
}
|
|
267
267
|
|
|
@@ -174,7 +174,7 @@ export class JavaScriptFormatter {
|
|
|
174
174
|
return 'sts';
|
|
175
175
|
}
|
|
176
176
|
} else if (nodeType === 'ObjectPattern') {
|
|
177
|
-
if (node.parent
|
|
177
|
+
if (node.parent?.type === 'VariableDeclarator' && AT.punctuator(token, '{')) {
|
|
178
178
|
return 'st';
|
|
179
179
|
}
|
|
180
180
|
if (AT.punctuator(token, ',')) {
|
|
@@ -203,7 +203,7 @@ export class JavaScriptFormatter {
|
|
|
203
203
|
}
|
|
204
204
|
} else if (nodeType === 'WithStatement') {
|
|
205
205
|
if (AT.punctuator(token, ')')) {
|
|
206
|
-
return node.body
|
|
206
|
+
return node.body?.type === 'BlockStatement' ? 'ts' : 'tn>';
|
|
207
207
|
}
|
|
208
208
|
} else if (nodeType === 'SwitchStatement') {
|
|
209
209
|
if (AT.punctuator(token, '{')) {
|
|
@@ -269,11 +269,11 @@ export class JavaScriptFormatter {
|
|
|
269
269
|
}
|
|
270
270
|
} else if (nodeType === 'IfStatement') {
|
|
271
271
|
if (AT.punctuator(token, ')')) {
|
|
272
|
-
return node.consequent
|
|
272
|
+
return node.consequent?.type === 'BlockStatement' ? 'ts' : 'tn>';
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
if (AT.keyword(token, 'else')) {
|
|
276
|
-
const preFormat = node.consequent
|
|
276
|
+
const preFormat = node.consequent?.type === 'BlockStatement' ? 'st' : 'n<t';
|
|
277
277
|
let postFormat = 'n>';
|
|
278
278
|
if (node.alternate && (node.alternate.type === 'BlockStatement' || node.alternate.type === 'IfStatement')) {
|
|
279
279
|
postFormat = 's';
|
|
@@ -285,7 +285,7 @@ export class JavaScriptFormatter {
|
|
|
285
285
|
return 'ts';
|
|
286
286
|
}
|
|
287
287
|
} else if (nodeType === 'SequenceExpression' && AT.punctuator(token, ',')) {
|
|
288
|
-
return node.parent
|
|
288
|
+
return node.parent?.type === 'SwitchCase' ? 'ts' : 'tn';
|
|
289
289
|
} else if (nodeType === 'ForStatement' || nodeType === 'ForOfStatement' || nodeType === 'ForInStatement') {
|
|
290
290
|
if (AT.punctuator(token, ';')) {
|
|
291
291
|
return 'ts';
|
|
@@ -295,14 +295,14 @@ export class JavaScriptFormatter {
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
if (AT.punctuator(token, ')')) {
|
|
298
|
-
return node.body
|
|
298
|
+
return node.body?.type === 'BlockStatement' ? 'ts' : 'tn>';
|
|
299
299
|
}
|
|
300
300
|
} else if (nodeType === 'WhileStatement') {
|
|
301
301
|
if (AT.punctuator(token, ')')) {
|
|
302
|
-
return node.body
|
|
302
|
+
return node.body?.type === 'BlockStatement' ? 'ts' : 'tn>';
|
|
303
303
|
}
|
|
304
304
|
} else if (nodeType === 'DoWhileStatement') {
|
|
305
|
-
const blockBody = node.body
|
|
305
|
+
const blockBody = node.body?.type === 'BlockStatement';
|
|
306
306
|
if (AT.keyword(token, 'do')) {
|
|
307
307
|
return blockBody ? 'ts' : 'tn>';
|
|
308
308
|
}
|
|
@@ -369,34 +369,31 @@ export class JavaScriptFormatter {
|
|
|
369
369
|
return 'n<';
|
|
370
370
|
}
|
|
371
371
|
} else if (nodeType === 'BlockStatement') {
|
|
372
|
-
if (node.parent
|
|
372
|
+
if (node.parent?.type === 'IfStatement') {
|
|
373
373
|
const parentNode = (node.parent as Acorn.ESTree.IfStatement);
|
|
374
374
|
if (parentNode.alternate && parentNode.consequent === node) {
|
|
375
375
|
return '';
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
if (node.parent
|
|
379
|
-
node.parent.parent.type === 'Property') {
|
|
378
|
+
if (node.parent?.type === 'FunctionExpression' && node.parent.parent?.type === 'Property') {
|
|
380
379
|
return '';
|
|
381
380
|
}
|
|
382
|
-
if (node.parent
|
|
383
|
-
node.parent.parent.type === 'VariableDeclarator') {
|
|
381
|
+
if (node.parent?.type === 'FunctionExpression' && node.parent.parent?.type === 'VariableDeclarator') {
|
|
384
382
|
return '';
|
|
385
383
|
}
|
|
386
|
-
if (node.parent
|
|
387
|
-
node.parent.parent.type === 'CallExpression') {
|
|
384
|
+
if (node.parent?.type === 'FunctionExpression' && node.parent.parent?.type === 'CallExpression') {
|
|
388
385
|
return '';
|
|
389
386
|
}
|
|
390
|
-
if (node.parent
|
|
387
|
+
if (node.parent?.type === 'DoWhileStatement') {
|
|
391
388
|
return '';
|
|
392
389
|
}
|
|
393
|
-
if (node.parent
|
|
390
|
+
if (node.parent?.type === 'TryStatement') {
|
|
394
391
|
const parentNode = (node.parent as Acorn.ESTree.TryStatement);
|
|
395
392
|
if (parentNode.block === node) {
|
|
396
393
|
return 's';
|
|
397
394
|
}
|
|
398
395
|
}
|
|
399
|
-
if (node.parent
|
|
396
|
+
if (node.parent?.type === 'CatchClause') {
|
|
400
397
|
const parentNode = (node.parent as Acorn.ESTree.CatchClause);
|
|
401
398
|
// @ts-expect-error We are doing a subtype check, without properly checking whether
|
|
402
399
|
// it exists. We can't fix that, unless we use proper typechecking
|
|
@@ -7,7 +7,7 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
7
7
|
import * as FormatterWorker from './formatter_worker.js';
|
|
8
8
|
import {FormatterActions} from './FormatterActions.js';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Platform.HostRuntime.HOST_RUNTIME.workerScope.onmessage = function(event): void {
|
|
11
11
|
const method: FormatterActions = event.data.method;
|
|
12
12
|
const params: {
|
|
13
13
|
indentString: string,
|
|
@@ -22,17 +22,20 @@ self.onmessage = function(event: MessageEvent): void {
|
|
|
22
22
|
|
|
23
23
|
switch (method) {
|
|
24
24
|
case FormatterActions.FORMAT:
|
|
25
|
-
|
|
25
|
+
Platform.HostRuntime.HOST_RUNTIME.workerScope.postMessage(
|
|
26
|
+
FormatterWorker.FormatterWorker.format(params.mimeType, params.content, params.indentString));
|
|
26
27
|
break;
|
|
27
28
|
case FormatterActions.PARSE_CSS:
|
|
28
29
|
FormatterWorker.CSSRuleParser.parseCSS(params.content, self.postMessage);
|
|
29
30
|
break;
|
|
30
31
|
case FormatterActions.JAVASCRIPT_SUBSTITUTE: {
|
|
31
|
-
|
|
32
|
+
Platform.HostRuntime.HOST_RUNTIME.workerScope.postMessage(
|
|
33
|
+
FormatterWorker.Substitute.substituteExpression(params.content, params.mapping));
|
|
32
34
|
break;
|
|
33
35
|
}
|
|
34
36
|
case FormatterActions.JAVASCRIPT_SCOPE_TREE: {
|
|
35
|
-
|
|
37
|
+
Platform.HostRuntime.HOST_RUNTIME.workerScope.postMessage(
|
|
38
|
+
FormatterWorker.ScopeParser.parseScopes(params.content, params.sourceType)?.export());
|
|
36
39
|
break;
|
|
37
40
|
}
|
|
38
41
|
default:
|
|
@@ -40,4 +43,4 @@ self.onmessage = function(event: MessageEvent): void {
|
|
|
40
43
|
}
|
|
41
44
|
};
|
|
42
45
|
|
|
43
|
-
|
|
46
|
+
Platform.HostRuntime.HOST_RUNTIME.workerScope.postMessage('workerReady');
|
|
@@ -45,7 +45,7 @@ export class ExecutionContextSelector implements SDK.TargetManager.SDKModelObser
|
|
|
45
45
|
|
|
46
46
|
modelRemoved(runtimeModel: SDK.RuntimeModel.RuntimeModel): void {
|
|
47
47
|
const currentExecutionContext = this.#context.flavor(SDK.RuntimeModel.ExecutionContext);
|
|
48
|
-
if (currentExecutionContext
|
|
48
|
+
if (currentExecutionContext?.runtimeModel === runtimeModel) {
|
|
49
49
|
this.#currentExecutionContextGone();
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -183,7 +183,7 @@ export class MainImpl {
|
|
|
183
183
|
Host.userMetrics.syncSetting(Common.Settings.Settings.instance().moduleSetting<boolean>('sync-preferences').get());
|
|
184
184
|
const veLogging = config.devToolsVeLogging;
|
|
185
185
|
|
|
186
|
-
// Used by
|
|
186
|
+
// Used by e2e to put VE Logs into "test mode".
|
|
187
187
|
const veLogsTestMode = Common.Settings.Settings.instance().createSetting('veLogsTestMode', false).get();
|
|
188
188
|
|
|
189
189
|
if (veLogging?.enabled) {
|
|
@@ -504,7 +504,7 @@ export class MainImpl {
|
|
|
504
504
|
LiveMetrics.LiveMetrics.instance();
|
|
505
505
|
CrUXManager.CrUXManager.instance();
|
|
506
506
|
|
|
507
|
-
|
|
507
|
+
AiAssistanceModel.BuiltInAi.BuiltInAi.instance();
|
|
508
508
|
|
|
509
509
|
new PauseListener();
|
|
510
510
|
|
|
@@ -717,7 +717,7 @@ export class MainImpl {
|
|
|
717
717
|
// @ts-expect-error Used in ElementsTreeOutline
|
|
718
718
|
eventCopy['original'] = event;
|
|
719
719
|
const document = event.target && (event.target as HTMLElement).ownerDocument;
|
|
720
|
-
const target = document ?
|
|
720
|
+
const target = document ? UI.DOMUtilities.deepActiveElement(document) : null;
|
|
721
721
|
if (target) {
|
|
722
722
|
target.dispatchEvent(eventCopy);
|
|
723
723
|
}
|
|
@@ -778,7 +778,7 @@ export class ZoomActionDelegate implements UI.ActionRegistration.ActionDelegate
|
|
|
778
778
|
export class SearchActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
779
779
|
handleAction(_context: UI.Context.Context, actionId: string): boolean {
|
|
780
780
|
let searchableView = UI.SearchableView.SearchableView.fromElement(
|
|
781
|
-
|
|
781
|
+
UI.DOMUtilities.deepActiveElement(document),
|
|
782
782
|
);
|
|
783
783
|
if (!searchableView) {
|
|
784
784
|
const currentPanel = (UI.InspectorView.InspectorView.instance().currentPanelDeprecated() as UI.Panel.Panel);
|
|
@@ -9,8 +9,8 @@ import * as Bindings from '../models/bindings/bindings.js';
|
|
|
9
9
|
import * as Workspace from '../models/workspace/workspace.js';
|
|
10
10
|
|
|
11
11
|
export interface CreationOptions {
|
|
12
|
-
// Settings things
|
|
13
12
|
settingsCreationOptions: Common.Settings.SettingsCreationOptions;
|
|
13
|
+
overrideAutoStartModels?: Set<SDK.SDKModel.SDKModelConstructor>;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export class Universe {
|
|
@@ -24,7 +24,7 @@ export class Universe {
|
|
|
24
24
|
...options.settingsCreationOptions,
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
const targetManager = new SDK.TargetManager.TargetManager();
|
|
27
|
+
const targetManager = new SDK.TargetManager.TargetManager(options.overrideAutoStartModels);
|
|
28
28
|
this.context.set(SDK.TargetManager.TargetManager, targetManager);
|
|
29
29
|
|
|
30
30
|
const workspace = new Workspace.Workspace.WorkspaceImpl();
|