chrome-devtools-frontend 1.0.1736236 → 1.0.1739869
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +1 -1
- package/.agents/skills/version-control/SKILL.md +63 -11
- package/.stylelintrc.json +3 -1
- package/docs/devtools-protocol.md +3 -1
- package/eslint.config.mjs +127 -6
- package/front_end/application_tokens.css +0 -30
- package/front_end/core/host/AidaClient.ts +14 -36
- package/front_end/core/host/AidaGcaTranslation.ts +8 -5
- package/front_end/core/root/Runtime.ts +0 -5
- package/front_end/core/sdk/SourceMap.ts +30 -3
- package/front_end/core/sdk/SourceMapRangeMappings.ts +57 -0
- package/front_end/design_system_tokens.css +1 -0
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +5 -9
- package/front_end/entrypoints/main/GlobalAiButton.ts +2 -9
- package/front_end/entrypoints/main/MainImpl.ts +0 -4
- package/front_end/generated/SupportedCSSProperties.ts +24 -23
- package/front_end/models/ai-utils/AiUtils.ts +1 -5
- package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -18
- package/front_end/models/ai_assistance/contexts/FileContext.ts +1 -2
- package/front_end/models/ai_assistance/tools/ListSources.ts +3 -1
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +0 -6
- package/front_end/models/javascript_metadata/NativeFunctions.ts +9 -5
- package/front_end/models/trace/EventsSerializer.ts +0 -8
- package/front_end/models/trace/extras/TraceFilter.ts +16 -8
- package/front_end/models/trace/extras/TraceTree.ts +104 -67
- package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +0 -5
- package/front_end/models/trace/handlers/RendererHandler.ts +7 -6
- package/front_end/models/trace/handlers/SamplesHandler.ts +1 -1
- package/front_end/models/trace/helpers/Extensions.ts +1 -3
- package/front_end/models/trace/helpers/SamplesIntegrator.ts +155 -87
- package/front_end/models/trace/helpers/Trace.ts +15 -12
- package/front_end/models/trace/helpers/TreeHelpers.ts +38 -10
- package/front_end/models/trace/insights/SlowCSSSelector.ts +3 -3
- package/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +19 -4
- package/front_end/models/workspace/UISourceCode.ts +30 -8
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -7
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +15 -34
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -16
- package/front_end/panels/ai_assistance/components/chatView.css +0 -212
- package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/animation/animationTimeline.css +5 -3
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +66 -3
- package/front_end/panels/application/PrivateVerificationTokensView.ts +114 -26
- package/front_end/panels/application/ResourcesPanel.ts +1 -0
- package/front_end/panels/application/backgroundServiceView.css +2 -2
- package/front_end/panels/application/components/backForwardCacheView.css +1 -1
- package/front_end/panels/application/components/permissionsPolicySection.css +0 -4
- package/front_end/panels/application/frameDetailsReportView.css +0 -7
- package/front_end/panels/application/indexedDBViews.css +3 -3
- package/front_end/panels/application/privateVerificationTokensView.css +6 -0
- package/front_end/panels/application/resourcesPanel.css +0 -48
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +1 -1
- package/front_end/panels/application/serviceWorkersView.css +2 -2
- package/front_end/panels/comments/CommentsPane.ts +1 -1
- package/front_end/panels/comments/commentsPane.css +1 -1
- package/front_end/panels/common/common.ts +0 -1
- package/front_end/panels/console/ConsoleView.ts +11 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +5 -1
- package/front_end/panels/console/consolePinPane.css +1 -1
- package/front_end/panels/console/consoleView.css +6 -5
- package/front_end/panels/elements/DOMTreeWidget.ts +47 -5
- package/front_end/panels/elements/StylePropertiesSection.ts +4 -9
- package/front_end/panels/elements/StylePropertyTreeElement.ts +52 -34
- package/front_end/panels/elements/classesPaneWidget.css +3 -7
- package/front_end/panels/elements/components/CSSQuery.ts +6 -5
- package/front_end/panels/elements/layoutPane.css +0 -1
- package/front_end/panels/elements/metricsSidebarPane.css +2 -2
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +0 -6
- package/front_end/panels/elements/stylesSidebarPane.css +0 -1
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +1 -0
- package/front_end/panels/emulation/deviceModeView.css +0 -1
- package/front_end/panels/explain/components/consoleInsight.css +1 -6
- package/front_end/panels/issues/AffectedBlockedByResponseView.ts +88 -46
- package/front_end/panels/issues/AffectedHeavyAdView.ts +72 -43
- package/front_end/panels/issues/AffectedResourcesView.ts +81 -13
- package/front_end/panels/issues/GenericIssueDetailsView.ts +112 -32
- package/front_end/panels/issues/issues.ts +2 -0
- package/front_end/panels/issues/issuesTree.css +9 -2
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +34 -17
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +39 -17
- package/front_end/panels/layer_viewer/Layers3DView.ts +34 -13
- package/front_end/panels/layer_viewer/layerDetailsView.css +2 -2
- package/front_end/panels/layer_viewer/layers3DView.css +0 -4
- package/front_end/panels/lighthouse/lighthousePanel.css +0 -9
- package/front_end/panels/linear_memory_inspector/components/linearMemoryValueInterpreter.css +2 -2
- package/front_end/panels/media/playerListView.css +0 -18
- package/front_end/panels/media/playerPropertiesView.css +1 -1
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +2 -2
- package/front_end/panels/network/NetworkLogView.ts +9 -2
- package/front_end/panels/network/NetworkWaterfallColumn.ts +22 -10
- package/front_end/panels/network/RequestPreviewView.ts +182 -63
- package/front_end/panels/network/RequestTimingView.ts +16 -2
- package/front_end/panels/network/SignedExchangeInfoView.ts +242 -158
- package/front_end/panels/network/networkConfigView.css +3 -3
- package/front_end/panels/network/networkLogView.css +4 -16
- package/front_end/panels/network/networkPanel.css +0 -7
- package/front_end/panels/network/networkTimingTable.css +12 -27
- package/front_end/panels/network/signedExchangeInfoView.css +12 -8
- package/front_end/panels/performance_monitor/performanceMonitor.css +2 -2
- package/front_end/panels/profiler/IsolateSelector.ts +31 -10
- package/front_end/panels/profiler/profilesPanel.css +0 -19
- package/front_end/panels/protocol_monitor/JSONEditor.css +1 -1
- package/front_end/panels/recorder/ControlButton.ts +1 -1
- package/front_end/panels/recorder/RecordingView.ts +22 -1
- package/front_end/panels/recorder/StepView.ts +26 -1
- package/front_end/panels/recorder/TimelineSection.ts +22 -6
- package/front_end/panels/recorder/controlButton.css +2 -9
- package/front_end/panels/recorder/recorderPanel.css +0 -1
- package/front_end/panels/recorder/recordingView.css +32 -32
- package/front_end/panels/recorder/replaySection.css +2 -0
- package/front_end/panels/recorder/stepView.css +18 -14
- package/front_end/panels/recorder/timelineSection.css +60 -84
- package/front_end/panels/screencast/screencastView.css +2 -2
- package/front_end/panels/search/searchView.css +1 -1
- package/front_end/panels/security/SecurityPanel.ts +474 -418
- package/front_end/panels/security/SecurityPanelSidebar.ts +68 -48
- package/front_end/panels/security/lockIcon.css +52 -50
- package/front_end/panels/security/mainView.css +149 -145
- package/front_end/panels/security/originView.css +117 -115
- package/front_end/panels/sensors/LocationsSettingsTab.ts +2 -50
- package/front_end/panels/sensors/SensorsView.ts +6 -21
- package/front_end/panels/sensors/locationsSettingsTab.css +1 -21
- package/front_end/panels/settings/AISettingsTab.ts +1 -2
- package/front_end/panels/settings/SettingsScreen.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +31 -6
- package/front_end/panels/sources/NavigatorView.ts +105 -31
- package/front_end/panels/sources/breakpointsView.css +5 -3
- package/front_end/panels/sources/scopeChainSidebarPane.css +1 -1
- package/front_end/panels/sources/sourcesView.css +2 -1
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +18 -5
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -0
- package/front_end/panels/timeline/TimelineController.ts +30 -26
- package/front_end/panels/timeline/TimelineDetailsView.ts +10 -9
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +4 -16
- package/front_end/panels/timeline/TimelineLayersView.ts +108 -46
- package/front_end/panels/timeline/TimelineMiniMap.ts +132 -54
- package/front_end/panels/timeline/TimelinePanel.ts +4 -2
- package/front_end/panels/timeline/TimelineTreeView.ts +25 -9
- package/front_end/panels/timeline/components/DetailsView.ts +7 -14
- package/front_end/panels/timeline/components/NetworkTrackWidget.ts +5 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -1
- package/front_end/panels/timeline/components/interactionBreakdown.css +1 -0
- package/front_end/panels/timeline/components/networkRequestDetails.css +2 -1
- package/front_end/panels/timeline/components/networkTrackWidget.css +1 -1
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -0
- package/front_end/panels/timeline/docs/profile_calls.md +7 -9
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +0 -7
- package/front_end/panels/timeline/timelineDetailsView.css +2 -2
- package/front_end/panels/web_audio/webAudio.css +1 -2
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
- package/front_end/panels/webauthn/webauthnPane.css +1 -1
- package/front_end/panels/whats_new/ReleaseNoteText.ts +6 -6
- package/front_end/panels/whats_new/resources/WNDT.md +6 -6
- package/front_end/third_party/axe-core/README.chromium +2 -3
- 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/es5-iife/puppeteer-core-browser.d.ts +328 -11
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +907 -588
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +119 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts +120 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.d.ts +16 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts +26 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +23 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js +21 -14
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts +5 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js +4 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js +158 -67
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js +28 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.js +19 -11
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +17 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Input.js +62 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.d.ts +29 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.js +60 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts +9 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js +24 -9
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js +16 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.d.ts +6 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.js +37 -20
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js +10 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Navigation.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Navigation.js +18 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Navigation.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Request.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Request.js +24 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Request.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.js +6 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExtensionTransport.js +30 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExtensionTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js +12 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js +40 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.d.ts +23 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.js +37 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js +74 -16
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js +34 -23
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.d.ts +10 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.js +94 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js +29 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/utils.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/utils.js +6 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/utils.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConsoleMessage.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts +4 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js +34 -15
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +11 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js +10 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/decorators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +328 -11
- package/front_end/third_party/puppeteer/package/package.json +10 -8
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +118 -0
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +119 -0
- package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +25 -2
- package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +28 -0
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +65 -38
- package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +27 -7
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +43 -7
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserConnector.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +5 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +38 -8
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +27 -12
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +19 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Input.ts +72 -5
- package/front_end/third_party/puppeteer/package/src/bidi/NetworkEvents.ts +82 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +37 -13
- package/front_end/third_party/puppeteer/package/src/bidi/Realm.ts +26 -14
- package/front_end/third_party/puppeteer/package/src/bidi/core/Browser.ts +43 -22
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +13 -5
- package/front_end/third_party/puppeteer/package/src/bidi/core/Navigation.ts +21 -1
- package/front_end/third_party/puppeteer/package/src/bidi/core/Request.ts +27 -5
- package/front_end/third_party/puppeteer/package/src/cdp/Binding.ts +6 -4
- package/front_end/third_party/puppeteer/package/src/cdp/ExtensionTransport.ts +31 -6
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +5 -0
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +18 -1
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +48 -0
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkEventManager.ts +58 -5
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +94 -14
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +50 -28
- package/front_end/third_party/puppeteer/package/src/cdp/ResponseBodyStream.ts +106 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +38 -3
- package/front_end/third_party/puppeteer/package/src/cdp/cdp.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/cdp/utils.ts +6 -5
- package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +5 -0
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +17 -8
- package/front_end/third_party/puppeteer/package/src/common/util.ts +32 -15
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +21 -13
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +10 -10
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/decorators.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +2 -0
- package/front_end/ui/comments/CommentAnchorResolver.ts +45 -4
- package/front_end/ui/comments/CommentOverlayManager.ts +45 -12
- package/front_end/ui/components/buttons/FloatingButton.ts +2 -6
- package/front_end/ui/components/buttons/button.css +2 -2
- package/front_end/ui/components/buttons/floatingButton.css +0 -44
- package/front_end/ui/components/diff_view/diffView.css +0 -2
- package/front_end/ui/components/icon_button/iconButton.css +1 -1
- package/front_end/ui/components/markdown_view/markdownView.css +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +29 -0
- package/front_end/ui/components/tree_outline/treeOutline.css +1 -1
- package/front_end/ui/legacy/ContextMenu.ts +7 -5
- package/front_end/ui/legacy/InspectorDrawerView.ts +1 -0
- package/front_end/ui/legacy/InspectorView.ts +5 -1
- package/front_end/ui/legacy/PopoverHelper.ts +1 -0
- package/front_end/ui/legacy/RootView.ts +9 -3
- package/front_end/ui/legacy/SplitWidget.ts +1 -0
- package/front_end/ui/legacy/Treeoutline.ts +9 -0
- package/front_end/ui/legacy/UIUtils.ts +1 -1
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +130 -137
- package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +1 -0
- package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +3 -1
- package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +7 -6
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +34 -20
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +43 -14
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +2 -2
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +1 -10
- package/front_end/ui/legacy/components/source_frame/imageView.css +2 -2
- package/front_end/ui/legacy/filter.css +7 -3
- package/front_end/ui/legacy/infobar.css +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +3 -55
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +3 -3
- package/front_end/ui/legacy/listWidget.css +3 -8
- package/front_end/ui/legacy/softDropDownButton.css +1 -1
- package/front_end/ui/legacy/tabbedPane.css +2 -9
- package/front_end/ui/legacy/treeoutline.css +3 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +134 -0
- package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
- package/inspector_overlay/tool_highlight.css +0 -7
- package/inspector_overlay/tool_highlight.ts +0 -1
- package/package.json +1 -1
- package/front_end/Images/geminiInDevTools.png +0 -0
- package/front_end/Images/geminiInDevTools_2x.png +0 -0
- package/front_end/generated/InspectorBackendCommands.ts +0 -1690
- package/front_end/generated/protocol-mapping.d.ts +0 -5986
- package/front_end/generated/protocol-proxy-api.d.ts +0 -5452
- package/front_end/generated/protocol.ts +0 -23364
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +0 -193
- package/front_end/panels/common/geminiRebrandPromoDialog.css +0 -47
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTTPRequest.d.ts","sourceRoot":"","sources":["../../../src/cdp/HTTPRequest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,KAAK,gCAAgC,EAErC,WAAW,EAEX,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAGhC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAiB,KAAK,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAO/D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAgBvD;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;;IACpC,EAAE,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,cAAc,EAAE,CAAC;IACjC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"HTTPRequest.d.ts","sourceRoot":"","sources":["../../../src/cdp/HTTPRequest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,KAAK,gCAAgC,EAErC,WAAW,EAEX,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAGhC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,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;
|
|
24
25
|
get client() {
|
|
25
26
|
return this.#client;
|
|
26
27
|
}
|
|
@@ -36,7 +37,7 @@ export class CdpHTTPRequest extends HTTPRequest {
|
|
|
36
37
|
set _fetchClient(fetchClient) {
|
|
37
38
|
this.#fetchClient = fetchClient;
|
|
38
39
|
}
|
|
39
|
-
constructor(client, frame, interceptionId, allowInterception, data, redirectChain, logger, fetchClient = client) {
|
|
40
|
+
constructor(client, frame, worker, interceptionId, allowInterception, data, redirectChain, logger, fetchClient = client) {
|
|
40
41
|
super();
|
|
41
42
|
this.#logger = logger;
|
|
42
43
|
this.#client = client;
|
|
@@ -67,6 +68,7 @@ export class CdpHTTPRequest extends HTTPRequest {
|
|
|
67
68
|
}
|
|
68
69
|
this.#hasPostData = data.request.hasPostData ?? false;
|
|
69
70
|
this.#frame = frame;
|
|
71
|
+
this.#worker = worker;
|
|
70
72
|
this._redirectChain = redirectChain;
|
|
71
73
|
this.#initiator = data.initiator;
|
|
72
74
|
this.interception.enabled = allowInterception;
|
|
@@ -125,6 +127,12 @@ export class CdpHTTPRequest extends HTTPRequest {
|
|
|
125
127
|
response() {
|
|
126
128
|
return this._response;
|
|
127
129
|
}
|
|
130
|
+
page() {
|
|
131
|
+
return this.#frame?.page() ?? null;
|
|
132
|
+
}
|
|
133
|
+
worker() {
|
|
134
|
+
return this.#worker;
|
|
135
|
+
}
|
|
128
136
|
frame() {
|
|
129
137
|
return this.#frame;
|
|
130
138
|
}
|
|
@@ -146,7 +154,9 @@ export class CdpHTTPRequest extends HTTPRequest {
|
|
|
146
154
|
};
|
|
147
155
|
}
|
|
148
156
|
canBeIntercepted() {
|
|
149
|
-
return !this.url().startsWith('data:') &&
|
|
157
|
+
return (!this.url().startsWith('data:') &&
|
|
158
|
+
!this._fromMemoryCache &&
|
|
159
|
+
Boolean(this._interceptionId));
|
|
150
160
|
}
|
|
151
161
|
/**
|
|
152
162
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTTPRequest.js","sourceRoot":"","sources":["../../../src/cdp/HTTPRequest.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,YAAY,EACZ,WAAW,EACX,yBAAyB,EAGzB,YAAY,EACZ,WAAW,GACZ,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"HTTPRequest.js","sourceRoot":"","sources":["../../../src/cdp/HTTPRequest.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,YAAY,EACZ,WAAW,EACX,yBAAyB,EAGzB,YAAY,EACZ,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAC,cAAc,EAAc,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAkB7B;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IACpC,EAAE,CAAS;IAIpB,OAAO,CAAa;IACpB,YAAY,CAAa;IACzB,oBAAoB,CAAU;IAE9B,IAAI,CAAS;IACb,aAAa,CAAe;IAE5B,OAAO,CAAS;IAChB,YAAY,GAAG,KAAK,CAAC;IACrB,SAAS,CAAU;IACnB,cAAc,CAAc;IAC5B,oBAAoB,GAAG,KAAK,CAAC;IAC7B,QAAQ,GAA2B,EAAE,CAAC;IACtC,MAAM,CAAe;IACrB,UAAU,CAA8B;IACxC,OAAO,CAAS;IAChB,WAAW,GAA+B,IAAI,CAAC;IAC/C,OAAO,CAAmB;IAE1B,IAAa,MAAM;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAa,MAAM,CAAC,SAAqB;QACvC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAI,YAAY,CAAC,WAAuB;QACtC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED,YACE,MAA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,KAAK,CACb,qEAAqE,CACtE,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,CAAC,YAAY;aACpB,IAAI,CAAC,mBAAmB,EAAE;YACzB,SAAS,EAAE,IAAI,CAAC,eAAe;YAC/B,WAAW,EAAE,WAAW,IAAI,QAAQ;SACrC,CAAC;aACD,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,OAAO,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;;OAKG;IACH,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,WAAW,EAAE,MAAM,KAAK,yBAAyB,CAAC,QAAQ;YACpE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS;YAC5B,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,mBAAmB;QACvB,QAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;YACjC,KAAK,yBAAyB,CAAC,QAAQ;gBACrC,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;YAC1D,KAAK,yBAAyB,CAAC,OAAO;gBACpC,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YACxD,KAAK,yBAAyB,CAAC,KAAK;gBAClC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;CACF"}
|
|
@@ -14,6 +14,7 @@ import type { CdpHTTPRequest } from './HTTPRequest.js';
|
|
|
14
14
|
export declare class CdpHTTPResponse extends HTTPResponse {
|
|
15
15
|
#private;
|
|
16
16
|
constructor(request: CdpHTTPRequest, responsePayload: Protocol.Network.Response, extraInfo: Protocol.Network.ResponseReceivedExtraInfoEvent | null);
|
|
17
|
+
_setEncodedDataLength(encodedDataLength: number): void;
|
|
17
18
|
_resolveBody(err?: Error): void;
|
|
18
19
|
remoteAddress(): RemoteAddress;
|
|
19
20
|
url(): string;
|
|
@@ -22,7 +23,9 @@ export declare class CdpHTTPResponse extends HTTPResponse {
|
|
|
22
23
|
headers(): Record<string, string>;
|
|
23
24
|
securityDetails(): SecurityDetails | null;
|
|
24
25
|
timing(): Protocol.Network.ResourceTiming | null;
|
|
26
|
+
encodedDataLength(): number;
|
|
25
27
|
content(): Promise<Uint8Array>;
|
|
28
|
+
stream(): Promise<ReadableStream<Uint8Array>>;
|
|
26
29
|
request(): CdpHTTPRequest;
|
|
27
30
|
fromCache(): boolean;
|
|
28
31
|
fromServiceWorker(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTTPResponse.d.ts","sourceRoot":"","sources":["../../../src/cdp/HTTPResponse.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAE,KAAK,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAExE,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAK7D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"HTTPResponse.d.ts","sourceRoot":"","sources":["../../../src/cdp/HTTPResponse.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAE,KAAK,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAExE,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAK7D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAGrD;;GAEG;AACH,qBAAa,eAAgB,SAAQ,YAAY;;gBAe7C,OAAO,EAAE,cAAc,EACvB,eAAe,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAC1C,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,8BAA8B,GAAG,IAAI;IAoDnE,qBAAqB,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI;IAStD,YAAY,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI;IAOtB,aAAa,IAAI,aAAa;IAI9B,GAAG,IAAI,MAAM;IAIb,MAAM,IAAI,MAAM;IAIhB,UAAU,IAAI,MAAM;IAIpB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIjC,eAAe,IAAI,eAAe,GAAG,IAAI;IAIzC,MAAM,IAAI,QAAQ,CAAC,OAAO,CAAC,cAAc,GAAG,IAAI;IAIhD,iBAAiB,IAAI,MAAM;IAI3B,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;IAkCxB,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAgCnD,OAAO,IAAI,cAAc;IAIzB,SAAS,IAAI,OAAO;IAIpB,iBAAiB,IAAI,OAAO;IAI5B,KAAK,IAAI,KAAK,GAAG,IAAI;CAG/B"}
|
|
@@ -4,6 +4,7 @@ import { SecurityDetails } from '../common/SecurityDetails.js';
|
|
|
4
4
|
import { Deferred } from '../util/Deferred.js';
|
|
5
5
|
import { stringToTypedArray } from '../util/encoding.js';
|
|
6
6
|
import { normalizeHeaderValue } from '../util/httpUtils.js';
|
|
7
|
+
import { createResponseBodyStream } from './ResponseBodyStream.js';
|
|
7
8
|
/**
|
|
8
9
|
* @internal
|
|
9
10
|
*/
|
|
@@ -19,6 +20,7 @@ export class CdpHTTPResponse extends HTTPResponse {
|
|
|
19
20
|
#headers = {};
|
|
20
21
|
#securityDetails;
|
|
21
22
|
#timing;
|
|
23
|
+
#encodedDataLength = 0;
|
|
22
24
|
constructor(request, responsePayload, extraInfo) {
|
|
23
25
|
super();
|
|
24
26
|
this.#request = request;
|
|
@@ -43,6 +45,7 @@ export class CdpHTTPResponse extends HTTPResponse {
|
|
|
43
45
|
? new SecurityDetails(responsePayload.securityDetails)
|
|
44
46
|
: null;
|
|
45
47
|
this.#timing = responsePayload.timing || null;
|
|
48
|
+
this._setEncodedDataLength(responsePayload.encodedDataLength);
|
|
46
49
|
}
|
|
47
50
|
#parseStatusTextFromExtraInfo(extraInfo) {
|
|
48
51
|
if (!extraInfo || !extraInfo.headersText) {
|
|
@@ -62,6 +65,14 @@ export class CdpHTTPResponse extends HTTPResponse {
|
|
|
62
65
|
}
|
|
63
66
|
return statusText;
|
|
64
67
|
}
|
|
68
|
+
_setEncodedDataLength(encodedDataLength) {
|
|
69
|
+
// Chromium reports -1 when no data was transferred over the network (e.g.
|
|
70
|
+
// data: or file: URLs) or when the size is unknown (e.g. synchronous XHRs
|
|
71
|
+
// to data: URLs). Keep the last known value in that case, defaulting to 0.
|
|
72
|
+
if (encodedDataLength >= 0) {
|
|
73
|
+
this.#encodedDataLength = encodedDataLength;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
65
76
|
_resolveBody(err) {
|
|
66
77
|
if (err) {
|
|
67
78
|
return this.#bodyLoadedDeferred.reject(err);
|
|
@@ -89,6 +100,9 @@ export class CdpHTTPResponse extends HTTPResponse {
|
|
|
89
100
|
timing() {
|
|
90
101
|
return this.#timing;
|
|
91
102
|
}
|
|
103
|
+
encodedDataLength() {
|
|
104
|
+
return this.#encodedDataLength;
|
|
105
|
+
}
|
|
92
106
|
content() {
|
|
93
107
|
if (!this.#contentPromise) {
|
|
94
108
|
this.#contentPromise = this.#bodyLoadedDeferred
|
|
@@ -114,6 +128,32 @@ export class CdpHTTPResponse extends HTTPResponse {
|
|
|
114
128
|
}
|
|
115
129
|
return this.#contentPromise;
|
|
116
130
|
}
|
|
131
|
+
async stream() {
|
|
132
|
+
if (this.#bodyLoadedDeferred.finished()) {
|
|
133
|
+
return await this.#contentStream();
|
|
134
|
+
}
|
|
135
|
+
try {
|
|
136
|
+
// Use the request's client, as it might have been updated for an adopted
|
|
137
|
+
// OOPIF.
|
|
138
|
+
return await createResponseBodyStream(this.#request.client, this.#request.id);
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
if (error instanceof ProtocolError &&
|
|
142
|
+
error.originalMessage.includes('already finished loading')) {
|
|
143
|
+
return await this.#contentStream();
|
|
144
|
+
}
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
async #contentStream() {
|
|
149
|
+
const content = await this.content();
|
|
150
|
+
return new ReadableStream({
|
|
151
|
+
start(controller) {
|
|
152
|
+
controller.enqueue(content);
|
|
153
|
+
controller.close();
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
}
|
|
117
157
|
request() {
|
|
118
158
|
return this.#request;
|
|
119
159
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTTPResponse.js","sourceRoot":"","sources":["../../../src/cdp/HTTPResponse.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,YAAY,EAAqB,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAC,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAC,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"HTTPResponse.js","sourceRoot":"","sources":["../../../src/cdp/HTTPResponse.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,YAAY,EAAqB,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAC,aAAa,E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AC,CAAC;gBAC5B,UAAU,CAAC,KAAK,EAAE,CAAC;YACrB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAEQ,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEQ,SAAS;QAChB,OAAO,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC/D,CAAC;IAEQ,iBAAiB;QACxB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAEQ,KAAK;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -38,6 +38,16 @@ export interface SessionEvent<T> {
|
|
|
38
38
|
event: T;
|
|
39
39
|
client: CDPSession;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* A stored `Network.requestWillBeSent` event. With request interception
|
|
43
|
+
* enabled, it can also hold a `Network.loadingFailed` event that arrived
|
|
44
|
+
* before the `Fetch.requestPaused` event that creates the request.
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export interface StoredRequestWillBeSent extends SessionEvent<Protocol.Network.RequestWillBeSentEvent> {
|
|
49
|
+
loadingFailed?: SessionEvent<Protocol.Network.LoadingFailedEvent>;
|
|
50
|
+
}
|
|
41
51
|
/**
|
|
42
52
|
* @internal
|
|
43
53
|
*/
|
|
@@ -50,6 +60,11 @@ export type NetworkRequestId = string;
|
|
|
50
60
|
export declare class NetworkEventManager {
|
|
51
61
|
#private;
|
|
52
62
|
forget(networkRequestId: NetworkRequestId): void;
|
|
63
|
+
/**
|
|
64
|
+
* Ids of the requests whose Network events come from `client`, both the
|
|
65
|
+
* ones already emitted and the ones still waiting for more events.
|
|
66
|
+
*/
|
|
67
|
+
requestIdsForClient(client: CDPSession): Set<NetworkRequestId>;
|
|
53
68
|
requestExtraInfo(networkRequestId: NetworkRequestId): Protocol.Network.RequestWillBeSentExtraInfoEvent[];
|
|
54
69
|
responseExtraInfo(networkRequestId: NetworkRequestId): Protocol.Network.ResponseReceivedExtraInfoEvent[];
|
|
55
70
|
private queuedRedirectInfo;
|
|
@@ -57,7 +72,7 @@ export declare class NetworkEventManager {
|
|
|
57
72
|
takeQueuedRedirectInfo(fetchRequestId: FetchRequestId): RedirectInfo | undefined;
|
|
58
73
|
inFlightRequestsCount(): number;
|
|
59
74
|
storeRequestWillBeSent(networkRequestId: NetworkRequestId, event: Protocol.Network.RequestWillBeSentEvent, client: CDPSession): void;
|
|
60
|
-
getRequestWillBeSent(networkRequestId: NetworkRequestId):
|
|
75
|
+
getRequestWillBeSent(networkRequestId: NetworkRequestId): StoredRequestWillBeSent | undefined;
|
|
61
76
|
forgetRequestWillBeSent(networkRequestId: NetworkRequestId): void;
|
|
62
77
|
getRequestPaused(networkRequestId: NetworkRequestId): SessionEvent<Protocol.Fetch.RequestPausedEvent> | undefined;
|
|
63
78
|
forgetRequestPaused(networkRequestId: NetworkRequestId): void;
|
|
@@ -65,6 +80,13 @@ export declare class NetworkEventManager {
|
|
|
65
80
|
getRequest(networkRequestId: NetworkRequestId): CdpHTTPRequest | undefined;
|
|
66
81
|
storeRequest(networkRequestId: NetworkRequestId, request: CdpHTTPRequest): void;
|
|
67
82
|
forgetRequest(networkRequestId: NetworkRequestId): void;
|
|
83
|
+
/**
|
|
84
|
+
* With request interception enabled, Network.loadingFailed can arrive before
|
|
85
|
+
* the Fetch.requestPaused event that creates the request. The failure is
|
|
86
|
+
* kept with the stored requestWillBeSent event until then, so that
|
|
87
|
+
* `requestfailed` is not lost.
|
|
88
|
+
*/
|
|
89
|
+
storeLoadingFailedBeforeRequest(networkRequestId: NetworkRequestId, event: Protocol.Network.LoadingFailedEvent, client: CDPSession): void;
|
|
68
90
|
getQueuedEventGroup(networkRequestId: NetworkRequestId): QueuedEventGroup | undefined;
|
|
69
91
|
queueEventGroup(networkRequestId: NetworkRequestId, event: QueuedEventGroup): void;
|
|
70
92
|
forgetQueuedEventGroup(networkRequestId: NetworkRequestId): void;
|
package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkEventManager.d.ts","sourceRoot":"","sources":["../../../src/cdp/NetworkEventManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qBAAqB,EAAE,QAAQ,CAAC,OAAO,CAAC,qBAAqB,CAAC;IAC9D,oBAAoB,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC7D,kBAAkB,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC;CAC1D;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,sBAAsB,CAAC;IAC/C,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,MAAM,EAAE,UAAU,CAAC;IACnB,WAAW,EAAE,UAAU,CAAC;CACzB;AAGD;;;;;;GAMG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,KAAK,EAAE,CAAC,CAAC;IACT,MAAM,EAAE,UAAU,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEtC;;;;GAIG;AACH,qBAAa,mBAAmB;;
|
|
1
|
+
{"version":3,"file":"NetworkEventManager.d.ts","sourceRoot":"","sources":["../../../src/cdp/NetworkEventManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,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IAOP,mBAAmB,CACjB,gBAAgB,EAAE,gBAAgB,GACjC,gBAAgB,GAAG,SAAS;IAI/B,eAAe,CACb,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,gBAAgB,GACtB,IAAI;IAIP,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IAIhE,UAAU,IAAI,IAAI;CAoCnB"}
|
|
@@ -67,6 +67,31 @@ export class NetworkEventManager {
|
|
|
67
67
|
this.#queuedRedirectInfoMap.delete(networkRequestId);
|
|
68
68
|
this.#responseReceivedExtraInfoMap.delete(networkRequestId);
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Ids of the requests whose Network events come from `client`, both the
|
|
72
|
+
* ones already emitted and the ones still waiting for more events.
|
|
73
|
+
*/
|
|
74
|
+
requestIdsForClient(client) {
|
|
75
|
+
const ids = new Set();
|
|
76
|
+
for (const [id, request] of this.#httpRequestsMap) {
|
|
77
|
+
if (request.client === client) {
|
|
78
|
+
ids.add(id);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
for (const [id, stored] of this.#requestWillBeSentMap) {
|
|
82
|
+
if (stored.client === client) {
|
|
83
|
+
ids.add(id);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
for (const [id, infos] of this.#queuedRedirectInfoMap) {
|
|
87
|
+
if (infos.some(info => {
|
|
88
|
+
return info.client === client;
|
|
89
|
+
})) {
|
|
90
|
+
ids.add(id);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return ids;
|
|
94
|
+
}
|
|
70
95
|
requestExtraInfo(networkRequestId) {
|
|
71
96
|
if (!this.#requestWillBeSentExtraInfoMap.has(networkRequestId)) {
|
|
72
97
|
this.#requestWillBeSentExtraInfoMap.set(networkRequestId, []);
|
|
@@ -127,6 +152,18 @@ export class NetworkEventManager {
|
|
|
127
152
|
forgetRequest(networkRequestId) {
|
|
128
153
|
this.#httpRequestsMap.delete(networkRequestId);
|
|
129
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* With request interception enabled, Network.loadingFailed can arrive before
|
|
157
|
+
* the Fetch.requestPaused event that creates the request. The failure is
|
|
158
|
+
* kept with the stored requestWillBeSent event until then, so that
|
|
159
|
+
* `requestfailed` is not lost.
|
|
160
|
+
*/
|
|
161
|
+
storeLoadingFailedBeforeRequest(networkRequestId, event, client) {
|
|
162
|
+
const requestWillBeSent = this.#requestWillBeSentMap.get(networkRequestId);
|
|
163
|
+
if (requestWillBeSent) {
|
|
164
|
+
requestWillBeSent.loadingFailed = { event, client };
|
|
165
|
+
}
|
|
166
|
+
}
|
|
130
167
|
getQueuedEventGroup(networkRequestId) {
|
|
131
168
|
return this.#queuedEventGroupMap.get(networkRequestId);
|
|
132
169
|
}
|
package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkEventManager.js","sourceRoot":"","sources":["../../../src/cdp/NetworkEventManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"NetworkEventManager.js","sourceRoot":"","sources":["../../../src/cdp/NetworkEventManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAuDhD;;;;GAIG;AACH,MAAM,OAAO,mBAAmB;IAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,qBAAqB,GAAG,IAAI,GAAG,EAA6C,CAAC;IAC7E,iBAAiB,GAAG,IAAI,GAAG,EAGxB,CAAC;IACJ,gBAAgB,GAAG,IAAI,GAAG,EAAoC,CAAC;IAC/D,8BAA8B,GAAG,IAA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,CAAC;gBAC3C,OAAO;oBACL,QAAQ,EAAE,gBAAgB;oBAC1B,KAAK,EAAE,GAAG,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC,GAAG,EAAE,EAAE;iBACrC,CAAC;YACJ,CAAC;YACD,CAAC;gBACC,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,CAAC,GAAG,CACT,iBAAiB,EACjB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,QAAQ,EAAE,CAAC,CAAC,CACnD,CAAC;QACF,OAAO,CAAC,GAAG,CACT,sBAAsB,EACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,qBAAqB,EAAE,QAAQ,EAAE,CAAC,CAAC,CACxD,CAAC;QACF,OAAO,CAAC,GAAG,CACT,sBAAsB,EACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,6BAA6B,EAAE,QAAQ,EAAE,CAAC,CAAC,CAChE,CAAC;QACF,OAAO,CAAC,GAAG,CACT,sBAAsB,EACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,iBAAiB,EAAE,QAAQ,EAAE,CAAC,CAAC,CACpD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -8,6 +8,7 @@ import { type CDPSession } from '../api/CDPSession.js';
|
|
|
8
8
|
import type { Frame } from '../api/Frame.js';
|
|
9
9
|
import { type HeadersInput } from '../api/HTTPRequest.js';
|
|
10
10
|
import type { Credentials, Page } from '../api/Page.js';
|
|
11
|
+
import type { WebWorker } from '../api/WebWorker.js';
|
|
11
12
|
import { type Logger } from '../common/Debug.js';
|
|
12
13
|
import { EventEmitter } from '../common/EventEmitter.js';
|
|
13
14
|
import { type NetworkManagerEvents } from '../common/NetworkManagerEvents.js';
|
|
@@ -52,6 +53,7 @@ export interface InternalNetworkConditions extends NetworkConditions {
|
|
|
52
53
|
*/
|
|
53
54
|
export interface FrameProvider {
|
|
54
55
|
frame(id: string): Frame | null;
|
|
56
|
+
worker(client: CDPSession): WebWorker | null;
|
|
55
57
|
page(): Page;
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkManager.d.ts","sourceRoot":"","sources":["../../../src/cdp/NetworkManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAkB,KAAK,UAAU,EAAC,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAuB,KAAK,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EAAC,WAAW,EAAE,IAAI,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAiB,KAAK,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,mCAAmC,CAAC;AAc3C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC;IAChC,IAAI,IAAI,IAAI,CAAC;CACd;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 -93,6 +93,39 @@ export class NetworkManager extends EventEmitter {
|
|
|
93
93
|
async #removeClient(client) {
|
|
94
94
|
this.#clients.get(client)?.dispose();
|
|
95
95
|
this.#clients.delete(client);
|
|
96
|
+
// Only dedicated workers leave requests pending when their session goes
|
|
97
|
+
// away. The worker is still known here: the session is closed before the
|
|
98
|
+
// page handles the target detaching.
|
|
99
|
+
if (!this.#frameManager.worker(client)) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
for (const requestId of this.#networkEventManager.requestIdsForClient(client)) {
|
|
103
|
+
if (client.connection()?._closed) {
|
|
104
|
+
this.#networkEventManager.forgetRequest(requestId);
|
|
105
|
+
this.#networkEventManager.forget(requestId);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
this.#abortPendingWorkerRequest(requestId);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Chrome does not send `Network.loadingFailed` or `Network.loadingFinished`
|
|
114
|
+
* for requests that are still pending when a dedicated worker is
|
|
115
|
+
* terminated. Fail them so that listeners observe the end of the request
|
|
116
|
+
* and they no longer count as in flight (e.g. for `waitForNetworkIdle`).
|
|
117
|
+
*/
|
|
118
|
+
#abortPendingWorkerRequest(requestId) {
|
|
119
|
+
const request = this.#networkEventManager.getRequest(requestId);
|
|
120
|
+
if (!request) {
|
|
121
|
+
// The request was never surfaced (e.g. still waiting for
|
|
122
|
+
// `Fetch.requestPaused`), so only drop the buffered events.
|
|
123
|
+
this.#networkEventManager.forget(requestId);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
request._failureText = 'net::ERR_ABORTED';
|
|
127
|
+
this.#forgetRequest(request, true);
|
|
128
|
+
this.emit(NetworkManagerEvent.RequestFailed, request);
|
|
96
129
|
}
|
|
97
130
|
async authenticate(credentials) {
|
|
98
131
|
this.#credentials = credentials;
|
|
@@ -311,6 +344,10 @@ export class NetworkManager extends EventEmitter {
|
|
|
311
344
|
if (this.#userRequestInterceptionEnabled &&
|
|
312
345
|
!event.request.url.startsWith('data:')) {
|
|
313
346
|
const { requestId: networkRequestId } = event;
|
|
347
|
+
const previousRequestWillBeSent = this.#networkEventManager.getRequestWillBeSent(networkRequestId);
|
|
348
|
+
if (previousRequestWillBeSent && event.redirectResponse) {
|
|
349
|
+
this.#onRequest(previousRequestWillBeSent.client, previousRequestWillBeSent.event, undefined);
|
|
350
|
+
}
|
|
314
351
|
this.#networkEventManager.storeRequestWillBeSent(networkRequestId, event, client);
|
|
315
352
|
/**
|
|
316
353
|
* CDP may have sent a Fetch.requestPaused event already. Check for it.
|
|
@@ -390,7 +427,7 @@ export class NetworkManager extends EventEmitter {
|
|
|
390
427
|
// own Network.requestWillBeSent.
|
|
391
428
|
if (requestWillBeSentEvent.request.url !== event.request.url ||
|
|
392
429
|
requestWillBeSentEvent.request.method !== event.request.method) {
|
|
393
|
-
this.#
|
|
430
|
+
this.#onRequest(networkClient, requestWillBeSentEvent, undefined);
|
|
394
431
|
this.#networkEventManager.storeRequestPaused(networkRequestId, event, client);
|
|
395
432
|
return;
|
|
396
433
|
}
|
|
@@ -439,11 +476,21 @@ export class NetworkManager extends EventEmitter {
|
|
|
439
476
|
const frame = event.frameId
|
|
440
477
|
? this.#frameManager.frame(event.frameId)
|
|
441
478
|
: null;
|
|
442
|
-
const
|
|
479
|
+
const worker = this.#frameManager.worker(client);
|
|
480
|
+
const request = new CdpHTTPRequest(client, frame, worker, event.requestId, this.#userRequestInterceptionEnabled, event, [], this.#logger);
|
|
443
481
|
this.emit(NetworkManagerEvent.Request, request);
|
|
444
482
|
void request.finalizeInterceptions();
|
|
445
483
|
}
|
|
446
484
|
#onRequest(client, event, fetchRequestId, fetchClient = client, fromMemoryCache = false) {
|
|
485
|
+
// With request interception enabled, Network.loadingFailed may have
|
|
486
|
+
// arrived before the Fetch.requestPaused that created this request.
|
|
487
|
+
const storedRequestWillBeSent = this.#networkEventManager.getRequestWillBeSent(event.requestId);
|
|
488
|
+
const loadingFailed = storedRequestWillBeSent?.event === event
|
|
489
|
+
? storedRequestWillBeSent.loadingFailed
|
|
490
|
+
: undefined;
|
|
491
|
+
if (storedRequestWillBeSent?.event === event) {
|
|
492
|
+
this.#networkEventManager.forgetRequestWillBeSent(event.requestId);
|
|
493
|
+
}
|
|
447
494
|
let redirectChain = [];
|
|
448
495
|
if (event.redirectResponse) {
|
|
449
496
|
// We want to emit a response and requestfinished for the
|
|
@@ -485,7 +532,8 @@ export class NetworkManager extends EventEmitter {
|
|
|
485
532
|
const frame = event.frameId
|
|
486
533
|
? this.#frameManager.frame(event.frameId)
|
|
487
534
|
: null;
|
|
488
|
-
const
|
|
535
|
+
const worker = this.#frameManager.worker(client);
|
|
536
|
+
const request = new CdpHTTPRequest(client, frame, worker, fetchRequestId, this.#userRequestInterceptionEnabled, event, redirectChain, this.#logger, fetchClient);
|
|
489
537
|
const extraInfo = this.#networkEventManager
|
|
490
538
|
.requestExtraInfo(event.requestId)
|
|
491
539
|
.shift();
|
|
@@ -494,9 +542,15 @@ export class NetworkManager extends EventEmitter {
|
|
|
494
542
|
}
|
|
495
543
|
request._fromMemoryCache = fromMemoryCache;
|
|
496
544
|
this.#networkEventManager.storeRequest(event.requestId, request);
|
|
497
|
-
this.#networkEventManager.forgetRequestWillBeSent(event.requestId);
|
|
498
545
|
this.emit(NetworkManagerEvent.Request, request);
|
|
499
|
-
|
|
546
|
+
const interceptionsFinalized = request.finalizeInterceptions();
|
|
547
|
+
if (loadingFailed) {
|
|
548
|
+
// Emit the failure once the request's interception handlers have run,
|
|
549
|
+
// using the session that reported it.
|
|
550
|
+
void interceptionsFinalized.finally(() => {
|
|
551
|
+
this.#emitLoadingFailed(loadingFailed.client, loadingFailed.event);
|
|
552
|
+
});
|
|
553
|
+
}
|
|
500
554
|
}
|
|
501
555
|
#onRequestWillBeSentExtraInfo(_client, event) {
|
|
502
556
|
const request = this.#networkEventManager.getRequest(event.requestId);
|
|
@@ -601,6 +655,12 @@ export class NetworkManager extends EventEmitter {
|
|
|
601
655
|
this.#networkEventManager.responseExtraInfo(event.requestId).push(event);
|
|
602
656
|
}
|
|
603
657
|
#forgetRequest(request, events) {
|
|
658
|
+
// Settle the body so `response.content()` does not wait forever. Under
|
|
659
|
+
// certain conditions we never get the Network.responseReceived event from
|
|
660
|
+
// protocol (@see https://crbug.com/883475), so the response can be
|
|
661
|
+
// missing. A body that was already settled (e.g. rejected for a redirect)
|
|
662
|
+
// keeps its value.
|
|
663
|
+
request.response()?._resolveBody();
|
|
604
664
|
const requestId = request.id;
|
|
605
665
|
const interceptionId = request._interceptionId;
|
|
606
666
|
this.#networkEventManager.forgetRequest(requestId);
|
|
@@ -630,11 +690,7 @@ export class NetworkManager extends EventEmitter {
|
|
|
630
690
|
return;
|
|
631
691
|
}
|
|
632
692
|
this.#adoptCdpSessionIfNeeded(client, request);
|
|
633
|
-
|
|
634
|
-
// event from protocol. @see https://crbug.com/883475
|
|
635
|
-
if (request.response()) {
|
|
636
|
-
request.response()?._resolveBody();
|
|
637
|
-
}
|
|
693
|
+
request.response()?._setEncodedDataLength(event.encodedDataLength);
|
|
638
694
|
this.#forgetRequest(request, true);
|
|
639
695
|
this.emit(NetworkManagerEvent.RequestFinished, request);
|
|
640
696
|
}
|
|
@@ -651,17 +707,19 @@ export class NetworkManager extends EventEmitter {
|
|
|
651
707
|
}
|
|
652
708
|
#emitLoadingFailed(client, event) {
|
|
653
709
|
const request = this.#networkEventManager.getRequest(event.requestId);
|
|
654
|
-
// For certain requestIds we never receive requestWillBeSent event.
|
|
655
|
-
// @see https://crbug.com/750469
|
|
656
710
|
if (!request) {
|
|
711
|
+
// With request interception enabled, the request is only created on
|
|
712
|
+
// Fetch.requestPaused, which can arrive after Network.loadingFailed.
|
|
713
|
+
// Keep the failure until then so that `requestfailed` is still emitted.
|
|
714
|
+
if (this.#userRequestInterceptionEnabled) {
|
|
715
|
+
this.#networkEventManager.storeLoadingFailedBeforeRequest(event.requestId, event, client);
|
|
716
|
+
}
|
|
717
|
+
// For certain requestIds we never receive requestWillBeSent event.
|
|
718
|
+
// @see https://crbug.com/750469
|
|
657
719
|
return;
|
|
658
720
|
}
|
|
659
721
|
this.#adoptCdpSessionIfNeeded(client, request);
|
|
660
722
|
request._failureText = event.errorText || event.blockedReason || null;
|
|
661
|
-
const response = request.response();
|
|
662
|
-
if (response) {
|
|
663
|
-
response._resolveBody();
|
|
664
|
-
}
|
|
665
723
|
this.#forgetRequest(request, true);
|
|
666
724
|
this.emit(NetworkManagerEvent.RequestFailed, request);
|
|
667
725
|
}
|