chrome-devtools-frontend 1.0.1538523 → 1.0.1539972
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/eslint.config.mjs +1 -1
- package/front_end/core/common/Debouncer.ts +2 -2
- package/front_end/core/common/Gzip.ts +1 -1
- package/front_end/core/common/Throttler.ts +3 -3
- package/front_end/core/host/GdpClient.ts +4 -0
- package/front_end/core/protocol_client/CDPConnection.ts +12 -10
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +181 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +55 -249
- package/front_end/core/protocol_client/protocol_client.ts +2 -2
- package/front_end/core/sdk/ChildTargetManager.ts +5 -41
- package/front_end/core/sdk/Connections.ts +9 -58
- package/front_end/core/sdk/DOMModel.ts +1 -0
- package/front_end/core/sdk/DebuggerModel.ts +3 -16
- package/front_end/core/sdk/RehydratingConnection.ts +1 -1
- package/front_end/core/sdk/RemoteObject.ts +4 -0
- package/front_end/core/sdk/Target.ts +3 -6
- package/front_end/core/sdk/TargetManager.ts +1 -2
- package/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts +13 -26
- package/front_end/entrypoints/node_app/{NodeConnectionsPanel.ts → app/NodeConnectionsPanel.ts} +8 -8
- package/front_end/entrypoints/node_app/{NodeMain.ts → app/NodeMain.ts} +12 -11
- package/front_end/entrypoints/node_app/app/app.ts +6 -0
- package/front_end/entrypoints/node_app/node_app.ts +4 -2
- package/front_end/generated/Deprecation.ts +8 -0
- package/front_end/generated/{InspectorBackendCommands.js → InspectorBackendCommands.ts} +18 -36
- package/front_end/generated/SupportedCSSProperties.js +50 -9
- package/front_end/generated/protocol.ts +2 -2
- package/front_end/models/ai_assistance/EvaluateAction.ts +88 -5
- package/front_end/models/ai_assistance/injected.ts +15 -2
- package/front_end/models/live-metrics/web-vitals-injected/README.md +1 -1
- package/front_end/models/trace/Styles.ts +1 -1
- package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +18 -3
- package/front_end/models/trace/types/TraceEvents.ts +19 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +49 -26
- package/front_end/panels/ai_assistance/PatchWidget.ts +22 -12
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -1
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -135
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +170 -0
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +4 -4
- package/front_end/panels/ai_assistance/components/chatView.css +0 -31
- package/front_end/panels/ai_assistance/components/disabledWidget.css +45 -0
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/application/components/FrameDetailsView.ts +1 -1
- package/front_end/panels/common/AiCodeCompletionDisclaimer.ts +4 -4
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +2 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +123 -95
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
- package/front_end/panels/elements/NodeStackTraceWidget.ts +8 -2
- package/front_end/panels/elements/PropertiesWidget.ts +3 -2
- package/front_end/panels/event_listeners/EventListenersView.ts +9 -5
- package/front_end/panels/explain/components/ConsoleInsight.ts +2 -3
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +57 -33
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +2 -2
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +12 -5
- package/front_end/panels/network/RequestInitiatorView.ts +1 -1
- package/front_end/panels/network/RequestPayloadView.ts +2 -1
- package/front_end/panels/network/RequestTimingView.ts +4 -2
- package/front_end/panels/network/components/EditableSpan.ts +1 -1
- package/front_end/panels/network/components/RequestHeadersView.ts +24 -17
- package/front_end/panels/protocol_monitor/JSONEditor.ts +2 -2
- package/front_end/panels/recorder/RecorderController.ts +6 -7
- package/front_end/panels/recorder/components/StepView.ts +1 -1
- package/front_end/panels/recorder/models/RecordingPlayer.ts +7 -6
- package/front_end/panels/settings/components/SyncSection.ts +1 -1
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +4 -4
- package/front_end/panels/sources/BreakpointsView.ts +3 -3
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +4 -3
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +3 -2
- package/front_end/panels/timeline/TimelineFlameChartView.ts +10 -10
- package/front_end/panels/timeline/TimelinePanel.ts +3 -3
- package/front_end/panels/timeline/TimelineUIUtils.ts +21 -24
- package/front_end/panels/timeline/components/FieldSettingsDialog.ts +9 -5
- package/front_end/panels/timeline/components/LiveMetricsView.ts +20 -9
- package/front_end/panels/timeline/components/MetricCard.ts +4 -2
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +3 -2
- package/front_end/panels/utils/utils.ts +4 -2
- package/front_end/services/puppeteer/PuppeteerConnection.ts +57 -53
- 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/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +5 -0
- 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/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +1 -0
- 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 +29 -9
- 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 +1 -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 +11 -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/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +9 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +21 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.js +11 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExtensionTransport.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExtensionTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +1 -0
- 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 +6 -0
- 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/cdp/TargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js +29 -27
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.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/node/BrowserLauncher.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +10 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.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 +14 -3
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +97 -43
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +5 -0
- 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/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +1 -0
- 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 +29 -9
- 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 +1 -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 +11 -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/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +9 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +21 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.js +11 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExtensionTransport.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExtensionTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +1 -0
- 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 +6 -0
- 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/cdp/TargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js +30 -28
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +10 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.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 +14 -3
- package/front_end/third_party/puppeteer/package/package.json +3 -3
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +4 -2
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +6 -0
- package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserConnector.ts +8 -1
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +38 -10
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +13 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +8 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +32 -0
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/CdpSession.ts +2 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Connection.ts +15 -1
- package/front_end/third_party/puppeteer/package/src/cdp/ExtensionTransport.ts +5 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +8 -0
- package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +36 -43
- package/front_end/third_party/puppeteer/package/src/common/CallbackRegistry.ts +7 -5
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +8 -0
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +22 -1
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/dialogs/ButtonDialog.ts +15 -5
- package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -1
- package/front_end/ui/components/helpers/helpers.ts +0 -2
- package/front_end/ui/components/menus/Menu.ts +5 -3
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/survey_link/SurveyLink.docs.ts +22 -0
- package/front_end/ui/components/switch/Switch.docs.ts +38 -0
- package/front_end/ui/components/tooltips/Tooltip.ts +69 -45
- package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -2
- package/front_end/ui/legacy/SelectMenu.docs.ts +14 -0
- package/front_end/ui/legacy/Slider.docs.ts +49 -0
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +3 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +453 -347
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +77 -5
- package/front_end/ui/legacy/components/utils/Linkifier.ts +62 -3
- package/front_end/ui/visual_logging/KnownContextValues.ts +8 -0
- package/package.json +1 -1
- package/front_end/core/protocol_client/NodeURL.ts +0 -42
- package/front_end/third_party/puppeteer/package/src/templates/version.ts.tmpl +0 -4
- package/front_end/ui/components/docs/color_swatch/basic.html +0 -32
- package/front_end/ui/components/docs/color_swatch/basic.ts +0 -38
- package/front_end/ui/components/docs/color_swatch/change-color.html +0 -24
- package/front_end/ui/components/docs/color_swatch/change-color.ts +0 -28
- package/front_end/ui/components/docs/combo_box/basic.html +0 -20
- package/front_end/ui/components/docs/combo_box/basic.ts +0 -49
- package/front_end/ui/components/docs/computed_style_property/basic.html +0 -25
- package/front_end/ui/components/docs/computed_style_property/basic.ts +0 -19
- package/front_end/ui/components/docs/computed_style_property/traceable.html +0 -25
- package/front_end/ui/components/docs/computed_style_property/traceable.ts +0 -16
- package/front_end/ui/components/docs/computed_style_trace/basic.html +0 -25
- package/front_end/ui/components/docs/computed_style_trace/basic.ts +0 -24
- package/front_end/ui/components/docs/console_insight/basic.html +0 -28
- package/front_end/ui/components/docs/console_insight/basic.ts +0 -103
- package/front_end/ui/components/docs/console_insight/error.html +0 -28
- package/front_end/ui/components/docs/console_insight/error.ts +0 -33
- package/front_end/ui/components/docs/console_insight/loading.html +0 -28
- package/front_end/ui/components/docs/console_insight/loading.ts +0 -47
- package/front_end/ui/components/docs/elements_breadcrumbs/basic.html +0 -43
- package/front_end/ui/components/docs/elements_breadcrumbs/basic.ts +0 -54
- package/front_end/ui/components/docs/elements_breadcrumbs/helpers.ts +0 -29
- package/front_end/ui/components/docs/elements_breadcrumbs/scroll-to-active-element.html +0 -38
- package/front_end/ui/components/docs/elements_breadcrumbs/scroll-to-active-element.ts +0 -90
- package/front_end/ui/components/docs/elements_breadcrumbs/scroll.html +0 -29
- package/front_end/ui/components/docs/elements_breadcrumbs/scroll.ts +0 -62
- package/front_end/ui/components/docs/icon_button/basic.html +0 -34
- package/front_end/ui/components/docs/icon_button/basic.ts +0 -67
- package/front_end/ui/components/docs/issue_counter/basic.html +0 -35
- package/front_end/ui/components/docs/issue_counter/basic.ts +0 -34
- package/front_end/ui/components/docs/issue_link_icon/basic.html +0 -31
- package/front_end/ui/components/docs/issue_link_icon/basic.ts +0 -26
- package/front_end/ui/components/docs/legacy_color_invert/basic.html +0 -77
- package/front_end/ui/components/docs/legacy_color_invert/basic.ts +0 -98
- package/front_end/ui/components/docs/linear_memory_inspector/basic.html +0 -26
- package/front_end/ui/components/docs/linear_memory_inspector/basic.ts +0 -44
- package/front_end/ui/components/docs/menu/basic.html +0 -28
- package/front_end/ui/components/docs/menu/basic.ts +0 -66
- package/front_end/ui/components/docs/recorder_control_button/basic.html +0 -20
- package/front_end/ui/components/docs/recorder_control_button/basic.ts +0 -15
- package/front_end/ui/components/docs/recorder_recording_list_view/basic.html +0 -20
- package/front_end/ui/components/docs/recorder_recording_list_view/basic.ts +0 -26
- package/front_end/ui/components/docs/recorder_select_button/basic.html +0 -20
- package/front_end/ui/components/docs/recorder_select_button/basic.ts +0 -81
- package/front_end/ui/components/docs/recorder_split_view/basic.html +0 -17
- package/front_end/ui/components/docs/recorder_split_view/basic.ts +0 -22
- package/front_end/ui/components/docs/request_link_icon/basic.html +0 -31
- package/front_end/ui/components/docs/request_link_icon/basic.ts +0 -21
- package/front_end/ui/components/docs/slider/basic.ts +0 -62
- package/front_end/ui/components/docs/style_property_editor/flex.html +0 -21
- package/front_end/ui/components/docs/style_property_editor/flex.ts +0 -52
- package/front_end/ui/components/docs/style_property_editor/grid.html +0 -22
- package/front_end/ui/components/docs/style_property_editor/grid.ts +0 -50
- package/front_end/ui/components/docs/style_property_editor/masonry.html +0 -21
- package/front_end/ui/components/docs/style_property_editor/masonry.ts +0 -50
- package/front_end/ui/components/docs/survey_link/basic.html +0 -20
- package/front_end/ui/components/docs/survey_link/basic.ts +0 -28
- package/front_end/ui/components/docs/switch/basic.ts +0 -51
- package/front_end/ui/components/docs/tree_outline/basic.html +0 -33
- package/front_end/ui/components/docs/tree_outline/basic.ts +0 -38
- package/front_end/ui/components/docs/tree_outline/custom-renderers.html +0 -32
- package/front_end/ui/components/docs/tree_outline/custom-renderers.ts +0 -61
- package/front_end/ui/components/docs/tree_outline/lazy-children.html +0 -32
- package/front_end/ui/components/docs/tree_outline/lazy-children.ts +0 -91
- package/front_end/ui/components/docs/tree_outline/sample-data.ts +0 -67
- package/front_end/ui/components/helpers/directives.ts +0 -38
- /package/front_end/entrypoints/node_app/{nodeConnectionsPanel.css → app/nodeConnectionsPanel.css} +0 -0
|
@@ -7,14 +7,17 @@ import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
|
|
|
7
7
|
import type * as Protocol from '../../generated/protocol.js';
|
|
8
8
|
import type * as Platform from '../platform/platform.js';
|
|
9
9
|
|
|
10
|
+
import {
|
|
11
|
+
type CDPConnection,
|
|
12
|
+
type CDPConnectionObserver,
|
|
13
|
+
CDPErrorStatus,
|
|
14
|
+
type CDPEvent,
|
|
15
|
+
type Command,
|
|
16
|
+
type CommandParams,
|
|
17
|
+
type Event
|
|
18
|
+
} from './CDPConnection.js';
|
|
10
19
|
import {ConnectionTransport} from './ConnectionTransport.js';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
export const DevToolsStubErrorCode = -32015;
|
|
14
|
-
// TODO(dgozman): we are not reporting generic errors in tests, but we should
|
|
15
|
-
// instead report them and just have some expected errors in test expectations.
|
|
16
|
-
const GenericErrorCode = -32000;
|
|
17
|
-
const ConnectionClosedErrorCode = -32001;
|
|
20
|
+
import {DevToolsCDPConnection} from './DevToolsCDPConnection.js';
|
|
18
21
|
|
|
19
22
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
23
|
type MessageParams = Record<string, any>;
|
|
@@ -59,25 +62,9 @@ export const qualifyName = (domain: string, name: UnqualifiedName): QualifiedNam
|
|
|
59
62
|
type EventParameterNames = Map<QualifiedName, string[]>;
|
|
60
63
|
type ReadonlyEventParameterNames = ReadonlyMap<QualifiedName, string[]>;
|
|
61
64
|
|
|
62
|
-
|
|
63
|
-
name: string;
|
|
64
|
-
type: string;
|
|
65
|
-
optional: boolean;
|
|
66
|
-
description: string;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
type Callback = (error: MessageError|null, arg1: Object|null) => void;
|
|
70
|
-
interface ResponseWithError {
|
|
71
|
-
error: MessageError|null;
|
|
72
|
-
result: Object|null;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
interface CallbackWithDebugInfo {
|
|
76
|
-
resolve: (response: ResponseWithError) => void;
|
|
77
|
-
method: string;
|
|
78
|
-
}
|
|
65
|
+
type CommandParameter = InspectorBackendCommands.CommandParameter;
|
|
79
66
|
|
|
80
|
-
export class InspectorBackend {
|
|
67
|
+
export class InspectorBackend implements InspectorBackendCommands.InspectorBackendAPI {
|
|
81
68
|
readonly agentPrototypes = new Map<ProtocolDomainName, AgentPrototype>();
|
|
82
69
|
#eventParameterNamesForDomain = new Map<ProtocolDomainName, EventParameterNames>();
|
|
83
70
|
readonly typeMap = new Map<QualifiedName, CommandParameter[]>();
|
|
@@ -195,49 +182,19 @@ export const test = {
|
|
|
195
182
|
onMessageReceived: null as ((message: Object) => void) | null,
|
|
196
183
|
};
|
|
197
184
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
export class SessionRouter {
|
|
201
|
-
readonly #connection: ConnectionTransport;
|
|
202
|
-
#lastMessageId = 1;
|
|
203
|
-
#pendingResponsesCount = 0;
|
|
204
|
-
readonly #pendingLongPollingMessageIds = new Set<number>();
|
|
185
|
+
export class SessionRouter implements CDPConnectionObserver {
|
|
186
|
+
readonly #connection: CDPConnection;
|
|
205
187
|
readonly #sessions = new Map<string, {
|
|
206
188
|
target: TargetBase,
|
|
207
|
-
callbacks: Map<number, CallbackWithDebugInfo>,
|
|
208
|
-
proxyConnection: ConnectionTransport|undefined|null,
|
|
209
189
|
}>();
|
|
210
|
-
#pendingScripts: Array<() => void> = [];
|
|
211
190
|
|
|
212
|
-
constructor(connection:
|
|
191
|
+
constructor(connection: CDPConnection) {
|
|
213
192
|
this.#connection = connection;
|
|
193
|
+
this.#connection.observe(this);
|
|
194
|
+
}
|
|
214
195
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
this.#connection.setOnMessage(this.onMessage.bind(this));
|
|
219
|
-
|
|
220
|
-
this.#connection.setOnDisconnect(reason => {
|
|
221
|
-
const session = this.#sessions.get('');
|
|
222
|
-
if (session) {
|
|
223
|
-
session.target.dispose(reason);
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
registerSession(target: TargetBase, sessionId: string, proxyConnection?: ConnectionTransport|null): void {
|
|
229
|
-
// Only the Audits panel uses proxy connections. If it is ever possible to have multiple active at the
|
|
230
|
-
// same time, it should be tested thoroughly.
|
|
231
|
-
if (proxyConnection) {
|
|
232
|
-
for (const session of this.#sessions.values()) {
|
|
233
|
-
if (session.proxyConnection) {
|
|
234
|
-
console.error('Multiple simultaneous proxy connections are currently unsupported');
|
|
235
|
-
break;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
this.#sessions.set(sessionId, {target, callbacks: new Map(), proxyConnection});
|
|
196
|
+
registerSession(target: TargetBase, sessionId: string): void {
|
|
197
|
+
this.#sessions.set(sessionId, {target});
|
|
241
198
|
}
|
|
242
199
|
|
|
243
200
|
unregisterSession(sessionId: string): void {
|
|
@@ -245,178 +202,27 @@ export class SessionRouter {
|
|
|
245
202
|
if (!session) {
|
|
246
203
|
return;
|
|
247
204
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
result: null,
|
|
251
|
-
error: {
|
|
252
|
-
message: `Session is unregistering, can\'t dispatch pending call to ${method}`,
|
|
253
|
-
code: ConnectionClosedErrorCode,
|
|
254
|
-
data: null,
|
|
255
|
-
}
|
|
256
|
-
});
|
|
205
|
+
if (this.#connection instanceof DevToolsCDPConnection) {
|
|
206
|
+
this.#connection.resolvePendingCalls(sessionId);
|
|
257
207
|
}
|
|
258
208
|
this.#sessions.delete(sessionId);
|
|
259
209
|
}
|
|
260
210
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
connection(): ConnectionTransport {
|
|
266
|
-
return this.#connection;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
sendMessage(sessionId: string, domain: string, method: QualifiedName, params: Object|null):
|
|
270
|
-
Promise<ResponseWithError> {
|
|
271
|
-
const messageId = this.nextMessageId();
|
|
272
|
-
const messageObject: Message = {
|
|
273
|
-
id: messageId,
|
|
274
|
-
method,
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
if (params) {
|
|
278
|
-
messageObject.params = params;
|
|
211
|
+
onDisconnect(reason: string): void {
|
|
212
|
+
const session = this.#sessions.get('');
|
|
213
|
+
if (session) {
|
|
214
|
+
session.target.dispose(reason);
|
|
279
215
|
}
|
|
280
|
-
if (sessionId) {
|
|
281
|
-
messageObject.sessionId = sessionId;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
if (test.dumpProtocol) {
|
|
285
|
-
test.dumpProtocol('frontend: ' + JSON.stringify(messageObject));
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
if (test.onMessageSent) {
|
|
289
|
-
const paramsObject = JSON.parse(JSON.stringify(params || {}));
|
|
290
|
-
test.onMessageSent({domain, method, params: (paramsObject as Object), id: messageId, sessionId});
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
++this.#pendingResponsesCount;
|
|
294
|
-
if (LongPollingMethods.has(method)) {
|
|
295
|
-
this.#pendingLongPollingMessageIds.add(messageId);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
const session = this.#sessions.get(sessionId);
|
|
299
|
-
if (!session) {
|
|
300
|
-
return Promise.resolve({error: null, result: null});
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
return new Promise(resolve => {
|
|
304
|
-
session.callbacks.set(messageId, {resolve, method});
|
|
305
|
-
this.#connection.sendRawMessage(JSON.stringify(messageObject));
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
private sendRawMessageForTesting(method: QualifiedName, params: Object|null, callback: Callback|null, sessionId = ''):
|
|
310
|
-
void {
|
|
311
|
-
const domain = method.split('.')[0];
|
|
312
|
-
void this.sendMessage(sessionId, domain, method, params).then(({error, result}) => callback?.(error, result));
|
|
313
216
|
}
|
|
314
217
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
test.dumpProtocol('backend: ' + ((typeof message === 'string') ? message : JSON.stringify(message)));
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
if (test.onMessageReceived) {
|
|
321
|
-
const messageObjectCopy = JSON.parse((typeof message === 'string') ? message : JSON.stringify(message));
|
|
322
|
-
test.onMessageReceived(messageObjectCopy);
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
const messageObject = ((typeof message === 'string') ? JSON.parse(message) : message) as Message;
|
|
326
|
-
|
|
327
|
-
// Send all messages to proxy connections.
|
|
328
|
-
let suppressUnknownMessageErrors = false;
|
|
329
|
-
for (const session of this.#sessions.values()) {
|
|
330
|
-
if (!session.proxyConnection) {
|
|
331
|
-
continue;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
if (!session.proxyConnection.onMessage) {
|
|
335
|
-
InspectorBackend.reportProtocolError(
|
|
336
|
-
'Protocol Error: the session has a proxyConnection with no _onMessage', messageObject);
|
|
337
|
-
continue;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
session.proxyConnection.onMessage(messageObject);
|
|
341
|
-
suppressUnknownMessageErrors = true;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
const sessionId = messageObject.sessionId || '';
|
|
218
|
+
onEvent<T extends Event>(event: CDPEvent<T>): void {
|
|
219
|
+
const sessionId = event.sessionId || '';
|
|
345
220
|
const session = this.#sessions.get(sessionId);
|
|
346
|
-
|
|
347
|
-
// In the DevTools MCP case, we may share the transport with puppeteer so we silently
|
|
348
|
-
// ignore unknown sessions.
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// If this message is directly for the target controlled by the proxy connection, don't handle it.
|
|
353
|
-
if (session.proxyConnection) {
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
if (session.target.getNeedsNodeJSPatching()) {
|
|
358
|
-
NodeURL.patch(messageObject);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
if (messageObject.id !== undefined) { // just a response for some request
|
|
362
|
-
const callback = session.callbacks.get(messageObject.id);
|
|
363
|
-
session.callbacks.delete(messageObject.id);
|
|
364
|
-
if (!callback) {
|
|
365
|
-
if (messageObject.error?.code === ConnectionClosedErrorCode) {
|
|
366
|
-
// Ignore the errors that are sent as responses after the session closes.
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
if (!suppressUnknownMessageErrors) {
|
|
370
|
-
InspectorBackend.reportProtocolError('Protocol Error: the message with wrong id', messageObject);
|
|
371
|
-
}
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
callback.resolve({error: messageObject.error || null, result: messageObject.result || null});
|
|
376
|
-
--this.#pendingResponsesCount;
|
|
377
|
-
this.#pendingLongPollingMessageIds.delete(messageObject.id);
|
|
378
|
-
|
|
379
|
-
if (this.#pendingScripts.length && !this.hasOutstandingNonLongPollingRequests()) {
|
|
380
|
-
this.deprecatedRunAfterPendingDispatches();
|
|
381
|
-
}
|
|
382
|
-
} else {
|
|
383
|
-
if (messageObject.method === undefined) {
|
|
384
|
-
InspectorBackend.reportProtocolError('Protocol Error: the message without method', messageObject);
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
// This cast is justified as we just checked for the presence of messageObject.method.
|
|
388
|
-
const eventMessage = messageObject as EventMessage;
|
|
389
|
-
session.target.dispatch(eventMessage);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
private hasOutstandingNonLongPollingRequests(): boolean {
|
|
394
|
-
return this.#pendingResponsesCount - this.#pendingLongPollingMessageIds.size > 0;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
private deprecatedRunAfterPendingDispatches(script?: (() => void)): void {
|
|
398
|
-
if (script) {
|
|
399
|
-
this.#pendingScripts.push(script);
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
// Execute all promises.
|
|
403
|
-
window.setTimeout(() => {
|
|
404
|
-
if (!this.hasOutstandingNonLongPollingRequests()) {
|
|
405
|
-
this.executeAfterPendingDispatches();
|
|
406
|
-
} else {
|
|
407
|
-
this.deprecatedRunAfterPendingDispatches();
|
|
408
|
-
}
|
|
409
|
-
}, 0);
|
|
221
|
+
session?.target.dispatch(event as unknown as EventMessage);
|
|
410
222
|
}
|
|
411
223
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
const scripts = this.#pendingScripts;
|
|
415
|
-
this.#pendingScripts = [];
|
|
416
|
-
for (let id = 0; id < scripts.length; ++id) {
|
|
417
|
-
scripts[id]();
|
|
418
|
-
}
|
|
419
|
-
}
|
|
224
|
+
get connection(): CDPConnection {
|
|
225
|
+
return this.#connection;
|
|
420
226
|
}
|
|
421
227
|
}
|
|
422
228
|
|
|
@@ -439,16 +245,12 @@ interface DispatcherMap extends Map<ProtocolDomainName, ProtocolProxyApi.Protoco
|
|
|
439
245
|
}
|
|
440
246
|
|
|
441
247
|
export class TargetBase {
|
|
442
|
-
needsNodeJSPatching: boolean;
|
|
443
248
|
readonly sessionId: string;
|
|
444
249
|
#router: SessionRouter|null;
|
|
445
250
|
#agents: AgentsMap = new Map();
|
|
446
251
|
#dispatchers: DispatcherMap = new Map();
|
|
447
252
|
|
|
448
|
-
constructor(
|
|
449
|
-
needsNodeJSPatching: boolean, parentTarget: TargetBase|null, sessionId: string,
|
|
450
|
-
connection: ConnectionTransport|null) {
|
|
451
|
-
this.needsNodeJSPatching = needsNodeJSPatching;
|
|
253
|
+
constructor(parentTarget: TargetBase|null, sessionId: string, connection: CDPConnection|null) {
|
|
452
254
|
this.sessionId = sessionId;
|
|
453
255
|
|
|
454
256
|
if (parentTarget && !sessionId) {
|
|
@@ -461,7 +263,7 @@ export class TargetBase {
|
|
|
461
263
|
} else if (connection) {
|
|
462
264
|
router = new SessionRouter(connection);
|
|
463
265
|
} else {
|
|
464
|
-
router = new SessionRouter(ConnectionTransport.getFactory()());
|
|
266
|
+
router = new SessionRouter(new DevToolsCDPConnection(ConnectionTransport.getFactory()()));
|
|
465
267
|
}
|
|
466
268
|
|
|
467
269
|
this.#router = router;
|
|
@@ -503,10 +305,6 @@ export class TargetBase {
|
|
|
503
305
|
return !this.#router;
|
|
504
306
|
}
|
|
505
307
|
|
|
506
|
-
markAsNodeJSForTest(): void {
|
|
507
|
-
this.needsNodeJSPatching = true;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
308
|
router(): SessionRouter|null {
|
|
511
309
|
return this.#router;
|
|
512
310
|
}
|
|
@@ -836,12 +634,15 @@ export class TargetBase {
|
|
|
836
634
|
registerWebAuthnDispatcher(dispatcher: ProtocolProxyApi.WebAuthnDispatcher): void {
|
|
837
635
|
this.registerDispatcher('WebAuthn', dispatcher);
|
|
838
636
|
}
|
|
839
|
-
|
|
840
|
-
getNeedsNodeJSPatching(): boolean {
|
|
841
|
-
return this.needsNodeJSPatching;
|
|
842
|
-
}
|
|
843
637
|
}
|
|
844
638
|
|
|
639
|
+
/** These are not logged as console.error */
|
|
640
|
+
const IGNORED_ERRORS = new Set<CDPErrorStatus>([
|
|
641
|
+
CDPErrorStatus.DEVTOOLS_STUB_ERROR,
|
|
642
|
+
CDPErrorStatus.SERVER_ERROR,
|
|
643
|
+
CDPErrorStatus.SESSION_NOT_FOUND,
|
|
644
|
+
]);
|
|
645
|
+
|
|
845
646
|
/**
|
|
846
647
|
* This is a class that serves as the prototype for a domains #agents (every target
|
|
847
648
|
* has it's own set of #agents). The InspectorBackend keeps an instance of this class
|
|
@@ -875,21 +676,26 @@ class AgentPrototype {
|
|
|
875
676
|
}
|
|
876
677
|
|
|
877
678
|
private invoke(method: QualifiedName, request: Object|null): Promise<Protocol.ProtocolResponseWithError> {
|
|
878
|
-
const
|
|
879
|
-
if (!
|
|
679
|
+
const connection = this.target.router()?.connection;
|
|
680
|
+
if (!connection) {
|
|
880
681
|
return Promise.resolve(
|
|
881
682
|
{result: null, getError: () => `Connection is closed, can\'t dispatch pending call to ${method}`});
|
|
882
683
|
}
|
|
883
684
|
|
|
884
|
-
return
|
|
885
|
-
|
|
886
|
-
error
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
685
|
+
return connection.send(method as Command, request as CommandParams<Command>, this.target.sessionId)
|
|
686
|
+
.then(response => {
|
|
687
|
+
if ('error' in response && response.error) {
|
|
688
|
+
if (!test.suppressRequestErrors && !IGNORED_ERRORS.has(response.error.code)) {
|
|
689
|
+
console.error('Request ' + method + ' failed. ' + JSON.stringify(response.error));
|
|
690
|
+
}
|
|
691
|
+
return {getError: () => response.error.message};
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
if ('result' in response) {
|
|
695
|
+
return {...response.result, getError: () => undefined};
|
|
696
|
+
}
|
|
697
|
+
return {getError: () => undefined};
|
|
698
|
+
});
|
|
893
699
|
}
|
|
894
700
|
}
|
|
895
701
|
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import * as CDPConnection from './CDPConnection.js';
|
|
6
6
|
import * as ConnectionTransport from './ConnectionTransport.js';
|
|
7
|
+
import * as DevToolsCDPConnection from './DevToolsCDPConnection.js';
|
|
7
8
|
import * as InspectorBackend from './InspectorBackend.js';
|
|
8
|
-
import * as NodeURL from './NodeURL.js';
|
|
9
9
|
|
|
10
10
|
export {
|
|
11
11
|
CDPConnection,
|
|
12
12
|
ConnectionTransport,
|
|
13
|
+
DevToolsCDPConnection,
|
|
13
14
|
InspectorBackend,
|
|
14
|
-
NodeURL,
|
|
15
15
|
};
|
|
@@ -7,9 +7,7 @@ import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
|
|
|
7
7
|
import type * as Protocol from '../../generated/protocol.js';
|
|
8
8
|
import * as Common from '../common/common.js';
|
|
9
9
|
import * as Host from '../host/host.js';
|
|
10
|
-
import type * as ProtocolClient from '../protocol_client/protocol_client.js';
|
|
11
10
|
|
|
12
|
-
import {ParallelConnection} from './Connections.js';
|
|
13
11
|
import {PrimaryPageChangeType, ResourceTreeModel} from './ResourceTreeModel.js';
|
|
14
12
|
import {SDKModel} from './SDKModel.js';
|
|
15
13
|
import {SecurityOriginManager} from './SecurityOriginManager.js';
|
|
@@ -36,7 +34,6 @@ export class ChildTargetManager extends SDKModel<EventTypes> implements Protocol
|
|
|
36
34
|
readonly #targetInfos = new Map<Protocol.Target.TargetID, Protocol.Target.TargetInfo>();
|
|
37
35
|
readonly #childTargetsBySessionId = new Map<Protocol.Target.SessionID, Target>();
|
|
38
36
|
readonly #childTargetsById = new Map<Protocol.Target.TargetID|'main', Target>();
|
|
39
|
-
readonly #parallelConnections = new Map<string, ProtocolClient.ConnectionTransport.ConnectionTransport>();
|
|
40
37
|
#parentTargetId: Protocol.Target.TargetID|null = null;
|
|
41
38
|
|
|
42
39
|
constructor(parentTarget: Target) {
|
|
@@ -244,15 +241,11 @@ export class ChildTargetManager extends SDKModel<EventTypes> implements Protocol
|
|
|
244
241
|
}
|
|
245
242
|
|
|
246
243
|
detachedFromTarget({sessionId}: Protocol.Target.DetachedFromTargetEvent): void {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
target.dispose('target terminated');
|
|
253
|
-
this.#childTargetsBySessionId.delete(sessionId);
|
|
254
|
-
this.#childTargetsById.delete(target.id());
|
|
255
|
-
}
|
|
244
|
+
const target = this.#childTargetsBySessionId.get(sessionId);
|
|
245
|
+
if (target) {
|
|
246
|
+
target.dispose('target terminated');
|
|
247
|
+
this.#childTargetsBySessionId.delete(sessionId);
|
|
248
|
+
this.#childTargetsById.delete(target.id());
|
|
256
249
|
}
|
|
257
250
|
}
|
|
258
251
|
|
|
@@ -260,35 +253,6 @@ export class ChildTargetManager extends SDKModel<EventTypes> implements Protocol
|
|
|
260
253
|
// We use flatten protocol.
|
|
261
254
|
}
|
|
262
255
|
|
|
263
|
-
async createParallelConnection(onMessage: (arg0: Object|string) => void):
|
|
264
|
-
Promise<{connection: ProtocolClient.ConnectionTransport.ConnectionTransport, sessionId: string}> {
|
|
265
|
-
// The main Target id is actually just `main`, instead of the real targetId.
|
|
266
|
-
// Get the real id (requires an async operation) so that it can be used synchronously later.
|
|
267
|
-
const targetId = await this.getParentTargetId();
|
|
268
|
-
const {connection, sessionId} =
|
|
269
|
-
await this.createParallelConnectionAndSessionForTarget(this.#parentTarget, targetId);
|
|
270
|
-
connection.setOnMessage(onMessage);
|
|
271
|
-
this.#parallelConnections.set(sessionId, connection);
|
|
272
|
-
return {connection, sessionId};
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
private async createParallelConnectionAndSessionForTarget(target: Target, targetId: Protocol.Target.TargetID):
|
|
276
|
-
Promise<{
|
|
277
|
-
connection: ProtocolClient.ConnectionTransport.ConnectionTransport,
|
|
278
|
-
sessionId: string,
|
|
279
|
-
}> {
|
|
280
|
-
const targetAgent = target.targetAgent();
|
|
281
|
-
const targetRouter = (target.router() as ProtocolClient.InspectorBackend.SessionRouter);
|
|
282
|
-
const sessionId = (await targetAgent.invoke_attachToTarget({targetId, flatten: true})).sessionId;
|
|
283
|
-
const connection = new ParallelConnection(targetRouter.connection(), sessionId);
|
|
284
|
-
targetRouter.registerSession(target, sessionId, connection);
|
|
285
|
-
connection.setOnDisconnect(() => {
|
|
286
|
-
targetRouter.unregisterSession(sessionId);
|
|
287
|
-
void targetAgent.invoke_detachFromTarget({sessionId});
|
|
288
|
-
});
|
|
289
|
-
return {connection, sessionId};
|
|
290
|
-
}
|
|
291
|
-
|
|
292
256
|
targetInfos(): Protocol.Target.TargetInfo[] {
|
|
293
257
|
return Array.from(this.#targetInfos.values());
|
|
294
258
|
}
|
|
@@ -9,7 +9,7 @@ import type * as Platform from '../platform/platform.js';
|
|
|
9
9
|
import * as ProtocolClient from '../protocol_client/protocol_client.js';
|
|
10
10
|
import * as Root from '../root/root.js';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import {RehydratingConnectionTransport} from './RehydratingConnection.js';
|
|
13
13
|
|
|
14
14
|
const UIStrings = {
|
|
15
15
|
/**
|
|
@@ -81,7 +81,7 @@ export class MainConnection implements ProtocolClient.ConnectionTransport.Connec
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
export class
|
|
84
|
+
export class WebSocketTransport implements ProtocolClient.ConnectionTransport.ConnectionTransport {
|
|
85
85
|
#socket: WebSocket|null;
|
|
86
86
|
onMessage: ((arg0: Object|string) => void)|null = null;
|
|
87
87
|
#onDisconnect: ((arg0: string) => void)|null = null;
|
|
@@ -176,7 +176,7 @@ export class WebSocketConnection implements ProtocolClient.ConnectionTransport.C
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
export class
|
|
179
|
+
export class StubTransport implements ProtocolClient.ConnectionTransport.ConnectionTransport {
|
|
180
180
|
onMessage: ((arg0: Object|string) => void)|null = null;
|
|
181
181
|
#onDisconnect: ((arg0: string) => void)|null = null;
|
|
182
182
|
|
|
@@ -196,7 +196,7 @@ export class StubConnection implements ProtocolClient.ConnectionTransport.Connec
|
|
|
196
196
|
const messageObject = JSON.parse(message);
|
|
197
197
|
const error = {
|
|
198
198
|
message: 'This is a stub connection, can\'t dispatch message.',
|
|
199
|
-
code: ProtocolClient.
|
|
199
|
+
code: ProtocolClient.CDPConnection.CDPErrorStatus.DEVTOOLS_STUB_ERROR,
|
|
200
200
|
data: messageObject,
|
|
201
201
|
};
|
|
202
202
|
if (this.onMessage) {
|
|
@@ -213,80 +213,31 @@ export class StubConnection implements ProtocolClient.ConnectionTransport.Connec
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
export interface ParallelConnectionInterface extends ProtocolClient.ConnectionTransport.ConnectionTransport {
|
|
217
|
-
getSessionId: () => string;
|
|
218
|
-
getOnDisconnect: () => ((arg0: string) => void) | null;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export class ParallelConnection implements ParallelConnectionInterface {
|
|
222
|
-
readonly #connection: ProtocolClient.ConnectionTransport.ConnectionTransport;
|
|
223
|
-
#sessionId: string;
|
|
224
|
-
onMessage: ((arg0: Object) => void)|null = null;
|
|
225
|
-
#onDisconnect: ((arg0: string) => void)|null = null;
|
|
226
|
-
constructor(connection: ProtocolClient.ConnectionTransport.ConnectionTransport, sessionId: string) {
|
|
227
|
-
this.#connection = connection;
|
|
228
|
-
this.#sessionId = sessionId;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
setOnMessage(onMessage: (arg0: Object) => void): void {
|
|
232
|
-
this.onMessage = onMessage;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
setOnDisconnect(onDisconnect: (arg0: string) => void): void {
|
|
236
|
-
this.#onDisconnect = onDisconnect;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
getOnDisconnect(): ((arg0: string) => void)|null {
|
|
240
|
-
return this.#onDisconnect;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
sendRawMessage(message: string): void {
|
|
244
|
-
const messageObject = JSON.parse(message);
|
|
245
|
-
// If the message isn't for a specific session, it must be for the root session.
|
|
246
|
-
if (!messageObject.sessionId) {
|
|
247
|
-
messageObject.sessionId = this.#sessionId;
|
|
248
|
-
}
|
|
249
|
-
this.#connection.sendRawMessage(JSON.stringify(messageObject));
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
getSessionId(): string {
|
|
253
|
-
return this.#sessionId;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
async disconnect(): Promise<void> {
|
|
257
|
-
if (this.#onDisconnect) {
|
|
258
|
-
this.#onDisconnect.call(null, 'force disconnect');
|
|
259
|
-
}
|
|
260
|
-
this.#onDisconnect = null;
|
|
261
|
-
this.onMessage = null;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
216
|
export async function initMainConnection(
|
|
266
217
|
createRootTarget: () => Promise<void>,
|
|
267
218
|
onConnectionLost: (message: Platform.UIString.LocalizedString) => void): Promise<void> {
|
|
268
|
-
ProtocolClient.ConnectionTransport.ConnectionTransport.setFactory(
|
|
219
|
+
ProtocolClient.ConnectionTransport.ConnectionTransport.setFactory(createMainTransport.bind(null, onConnectionLost));
|
|
269
220
|
await createRootTarget();
|
|
270
221
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.connectionReady();
|
|
271
222
|
}
|
|
272
223
|
|
|
273
|
-
function
|
|
224
|
+
function createMainTransport(onConnectionLost: (message: Platform.UIString.LocalizedString) => void):
|
|
274
225
|
ProtocolClient.ConnectionTransport.ConnectionTransport {
|
|
275
226
|
if (Root.Runtime.Runtime.isTraceApp()) {
|
|
276
|
-
return new
|
|
227
|
+
return new RehydratingConnectionTransport(onConnectionLost);
|
|
277
228
|
}
|
|
278
229
|
|
|
279
230
|
const wsParam = Root.Runtime.Runtime.queryParam('ws');
|
|
280
231
|
const wssParam = Root.Runtime.Runtime.queryParam('wss');
|
|
281
232
|
if (wsParam || wssParam) {
|
|
282
233
|
const ws = (wsParam ? `ws://${wsParam}` : `wss://${wssParam}`) as Platform.DevToolsPath.UrlString;
|
|
283
|
-
return new
|
|
234
|
+
return new WebSocketTransport(ws, onConnectionLost);
|
|
284
235
|
}
|
|
285
236
|
|
|
286
237
|
const notEmbeddedOrWs = Host.InspectorFrontendHost.InspectorFrontendHostInstance.isHostedMode();
|
|
287
238
|
if (notEmbeddedOrWs) {
|
|
288
239
|
// eg., hosted mode (e.g. `http://localhost:9222/devtools/inspector.html`) without a WebSocket URL,
|
|
289
|
-
return new
|
|
240
|
+
return new StubTransport();
|
|
290
241
|
}
|
|
291
242
|
|
|
292
243
|
return new MainConnection();
|
|
@@ -632,6 +632,7 @@ export class DOMNode {
|
|
|
632
632
|
}
|
|
633
633
|
|
|
634
634
|
async getSubtree(depth: number, pierce: boolean): Promise<DOMNode[]|null> {
|
|
635
|
+
console.assert(depth > 0, 'Do not fetch an infinite subtree to avoid crashing the renderer for large documents');
|
|
635
636
|
const response = await this.#agent.invoke_requestChildNodes({nodeId: this.id, depth, pierce});
|
|
636
637
|
return response.getError() ? null : this.childrenInternal;
|
|
637
638
|
}
|
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
|
|
6
6
|
import * as Protocol from '../../generated/protocol.js';
|
|
7
7
|
import * as Common from '../common/common.js';
|
|
8
|
-
import * as Host from '../host/host.js';
|
|
9
8
|
import * as i18n from '../i18n/i18n.js';
|
|
10
|
-
import * as Platform from '../platform/platform.js';
|
|
9
|
+
import type * as Platform from '../platform/platform.js';
|
|
11
10
|
import * as Root from '../root/root.js';
|
|
12
11
|
|
|
13
12
|
import type {PageResourceLoadInitiator} from './PageResourceLoader.js';
|
|
@@ -18,7 +17,7 @@ import {Script} from './Script.js';
|
|
|
18
17
|
import {SDKModel} from './SDKModel.js';
|
|
19
18
|
import {SourceMap} from './SourceMap.js';
|
|
20
19
|
import {SourceMapManager} from './SourceMapManager.js';
|
|
21
|
-
import {Capability, type Target
|
|
20
|
+
import {Capability, type Target} from './Target.js';
|
|
22
21
|
|
|
23
22
|
const UIStrings = {
|
|
24
23
|
/**
|
|
@@ -456,17 +455,6 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
|
456
455
|
async setBreakpointByURL(
|
|
457
456
|
url: Platform.DevToolsPath.UrlString, lineNumber: number, columnNumber?: number,
|
|
458
457
|
condition?: BackendCondition): Promise<SetBreakpointResult> {
|
|
459
|
-
// Convert file url to node-js path.
|
|
460
|
-
let urlRegex;
|
|
461
|
-
if (this.target().type() === Type.NODE && Common.ParsedURL.schemeIs(url, 'file:')) {
|
|
462
|
-
const platformPath = Common.ParsedURL.ParsedURL.urlToRawPathString(url, Host.Platform.isWin());
|
|
463
|
-
urlRegex =
|
|
464
|
-
`${Platform.StringUtilities.escapeForRegExp(platformPath)}|${Platform.StringUtilities.escapeForRegExp(url)}`;
|
|
465
|
-
if (Host.Platform.isWin() && platformPath.match(/^.:\\/)) {
|
|
466
|
-
// Match upper or lower case drive letter
|
|
467
|
-
urlRegex = `[${platformPath[0].toUpperCase()}${platformPath[0].toLowerCase()}]` + urlRegex.substr(1);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
458
|
// Adjust column if needed.
|
|
471
459
|
let minColumnNumber = 0;
|
|
472
460
|
const scripts = this.#scriptsBySourceURL.get(url) || [];
|
|
@@ -479,8 +467,7 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
|
479
467
|
columnNumber = Math.max(columnNumber || 0, minColumnNumber);
|
|
480
468
|
const response = await this.agent.invoke_setBreakpointByUrl({
|
|
481
469
|
lineNumber,
|
|
482
|
-
url
|
|
483
|
-
urlRegex,
|
|
470
|
+
url,
|
|
484
471
|
columnNumber,
|
|
485
472
|
condition,
|
|
486
473
|
});
|
|
@@ -63,7 +63,7 @@ export const enum RehydratingConnectionState {
|
|
|
63
63
|
REHYDRATED = 3,
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export class
|
|
66
|
+
export class RehydratingConnectionTransport implements ProtocolClient.ConnectionTransport.ConnectionTransport {
|
|
67
67
|
rehydratingConnectionState: RehydratingConnectionState = RehydratingConnectionState.UNINITIALIZED;
|
|
68
68
|
onDisconnect: ((arg0: string) => void)|null = null;
|
|
69
69
|
onMessage: ((arg0: Object) => void)|null = null;
|