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
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import type * as Bidi from 'webdriver-bidi-protocol';
|
|
8
8
|
|
|
9
9
|
import type {BrowserContextOptions} from '../../api/Browser.js';
|
|
10
|
+
import type {DownloadBehavior} from '../../common/DownloadBehavior.js';
|
|
10
11
|
import {UnsupportedOperation} from '../../common/Errors.js';
|
|
11
12
|
import {EventEmitter} from '../../common/EventEmitter.js';
|
|
12
13
|
import {inertIfDisposed, throwIfDisposed} from '../../util/decorators.js';
|
|
@@ -228,32 +229,52 @@ export class Browser extends EventEmitter<{
|
|
|
228
229
|
} = await this.session.send('browser.createUserContext', {
|
|
229
230
|
proxy: proxyConfig,
|
|
230
231
|
});
|
|
231
|
-
if (options.downloadBehavior
|
|
232
|
-
|
|
233
|
-
'`allowAndName` is not supported in WebDriver BiDi',
|
|
234
|
-
);
|
|
232
|
+
if (options.downloadBehavior) {
|
|
233
|
+
await this.setDownloadBehavior(options.downloadBehavior, [userContext]);
|
|
235
234
|
}
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
return this.#createUserContext(userContext);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Sets the download behavior for the given user contexts. If no user
|
|
240
|
+
* contexts are provided, the behavior is applied globally.
|
|
241
|
+
*/
|
|
242
|
+
@throwIfDisposed<Browser>(browser => {
|
|
243
|
+
// SAFETY: By definition of `disposed`, `#reason` is defined.
|
|
244
|
+
return browser.#reason!;
|
|
245
|
+
})
|
|
246
|
+
async setDownloadBehavior(
|
|
247
|
+
downloadBehavior: DownloadBehavior,
|
|
248
|
+
userContexts?: [string, ...string[]],
|
|
249
|
+
): Promise<void> {
|
|
250
|
+
switch (downloadBehavior.policy) {
|
|
251
|
+
case 'allowAndName':
|
|
238
252
|
throw new UnsupportedOperation(
|
|
239
|
-
'`
|
|
253
|
+
'`allowAndName` is not supported in WebDriver BiDi',
|
|
240
254
|
);
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
+
case 'allow':
|
|
256
|
+
if (downloadBehavior.downloadPath === undefined) {
|
|
257
|
+
throw new UnsupportedOperation(
|
|
258
|
+
'`downloadPath` is required in `allow` download behavior',
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
await this.session.send('browser.setDownloadBehavior', {
|
|
262
|
+
downloadBehavior: {
|
|
263
|
+
type: 'allowed',
|
|
264
|
+
destinationFolder: downloadBehavior.downloadPath,
|
|
265
|
+
},
|
|
266
|
+
userContexts,
|
|
267
|
+
});
|
|
268
|
+
return;
|
|
269
|
+
case 'deny':
|
|
270
|
+
await this.session.send('browser.setDownloadBehavior', {
|
|
271
|
+
downloadBehavior: {type: 'denied'},
|
|
272
|
+
userContexts,
|
|
273
|
+
});
|
|
274
|
+
return;
|
|
275
|
+
case 'default':
|
|
276
|
+
return;
|
|
255
277
|
}
|
|
256
|
-
return this.#createUserContext(userContext);
|
|
257
278
|
}
|
|
258
279
|
|
|
259
280
|
@throwIfDisposed<Browser>(browser => {
|
|
@@ -114,6 +114,8 @@ export class BrowsingContext extends EventEmitter<{
|
|
|
114
114
|
userprompt: UserPrompt;
|
|
115
115
|
/** Emitted whenever the frame history is updated. */
|
|
116
116
|
historyUpdated: void;
|
|
117
|
+
/** Emitted whenever a cross-document navigation commits. */
|
|
118
|
+
navigationCommitted: void;
|
|
117
119
|
/** Emitted whenever the frame emits `DOMContentLoaded` */
|
|
118
120
|
DOMContentLoaded: void;
|
|
119
121
|
/** Emitted whenever the frame emits `load` */
|
|
@@ -247,6 +249,13 @@ export class BrowsingContext extends EventEmitter<{
|
|
|
247
249
|
this.emit('historyUpdated', undefined);
|
|
248
250
|
});
|
|
249
251
|
|
|
252
|
+
sessionEmitter.on('browsingContext.navigationCommitted', info => {
|
|
253
|
+
if (info.context !== this.id) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
this.emit('navigationCommitted', undefined);
|
|
257
|
+
});
|
|
258
|
+
|
|
250
259
|
sessionEmitter.on('browsingContext.domContentLoaded', info => {
|
|
251
260
|
if (info.context !== this.id) {
|
|
252
261
|
return;
|
|
@@ -633,11 +642,10 @@ export class BrowsingContext extends EventEmitter<{
|
|
|
633
642
|
return context.#reason!;
|
|
634
643
|
})
|
|
635
644
|
async setTimezoneOverride(timezoneId?: string): Promise<void> {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
}
|
|
645
|
+
// CDP requires `GMT` prefix before timezone offset, while BiDi does not. Remove the
|
|
646
|
+
// `GMT` for interop between CDP and BiDi. Keep plain `GMT`, which is a valid
|
|
647
|
+
// timezone ID on its own.
|
|
648
|
+
timezoneId = timezoneId?.replace(/^GMT(?=[+-])/, '');
|
|
641
649
|
await this.userContext.browser.session.send(
|
|
642
650
|
'emulation.setTimezoneOverride',
|
|
643
651
|
{
|
|
@@ -43,6 +43,7 @@ export class Navigation extends EventEmitter<{
|
|
|
43
43
|
readonly #browsingContext: BrowsingContext;
|
|
44
44
|
readonly #disposables = new DisposableStack();
|
|
45
45
|
#id?: string | null;
|
|
46
|
+
readonly #committedNavigations = new Set<string>();
|
|
46
47
|
|
|
47
48
|
private constructor(context: BrowsingContext) {
|
|
48
49
|
super();
|
|
@@ -96,15 +97,34 @@ export class Navigation extends EventEmitter<{
|
|
|
96
97
|
this.#navigation = Navigation.from(this.#browsingContext);
|
|
97
98
|
});
|
|
98
99
|
|
|
100
|
+
sessionEmitter.on('browsingContext.navigationCommitted', info => {
|
|
101
|
+
if (
|
|
102
|
+
info.context !== this.#browsingContext.id ||
|
|
103
|
+
info.navigation === null
|
|
104
|
+
) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
// Record the commit even if it does not match this navigation. A
|
|
108
|
+
// nested navigation can commit and then finish this navigation.
|
|
109
|
+
this.#committedNavigations.add(info.navigation);
|
|
110
|
+
if (!this.#matches(info.navigation)) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
this.dispose();
|
|
114
|
+
});
|
|
115
|
+
|
|
99
116
|
for (const eventName of [
|
|
100
117
|
'browsingContext.domContentLoaded',
|
|
101
118
|
'browsingContext.load',
|
|
102
|
-
'browsingContext.navigationCommitted',
|
|
103
119
|
] as const) {
|
|
104
120
|
sessionEmitter.on(eventName, info => {
|
|
105
121
|
if (
|
|
106
122
|
info.context !== this.#browsingContext.id ||
|
|
107
123
|
info.navigation === null ||
|
|
124
|
+
// Lifecycle events that come before the commit are from the
|
|
125
|
+
// previous document. Browsers can report them with the ID of the
|
|
126
|
+
// new navigation (e.g. the error page of a failed navigation).
|
|
127
|
+
!this.#committedNavigations.has(info.navigation) ||
|
|
108
128
|
!this.#matches(info.navigation)
|
|
109
129
|
) {
|
|
110
130
|
return;
|
|
@@ -14,6 +14,13 @@ import {stringToTypedArray} from '../../util/encoding.js';
|
|
|
14
14
|
|
|
15
15
|
import type {BrowsingContext} from './BrowsingContext.js';
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Redirect statuses as defined by the Fetch standard.
|
|
19
|
+
*
|
|
20
|
+
* @see https://fetch.spec.whatwg.org/#redirect-status
|
|
21
|
+
*/
|
|
22
|
+
const REDIRECT_STATUSES = new Set([301, 302, 303, 307, 308]);
|
|
23
|
+
|
|
17
24
|
/**
|
|
18
25
|
* @internal
|
|
19
26
|
*/
|
|
@@ -102,12 +109,15 @@ export class Request extends EventEmitter<{
|
|
|
102
109
|
sessionEmitter.on('network.authRequired', event => {
|
|
103
110
|
if (
|
|
104
111
|
event.context !== this.#browsingContext.id ||
|
|
105
|
-
event.request.request !== this.id
|
|
106
|
-
// Don't try to authenticate for events that are not blocked
|
|
107
|
-
!event.isBlocked
|
|
112
|
+
event.request.request !== this.id
|
|
108
113
|
) {
|
|
109
114
|
return;
|
|
110
115
|
}
|
|
116
|
+
this.#event.isBlocked = event.isBlocked;
|
|
117
|
+
// Don't try to authenticate for events that are not blocked
|
|
118
|
+
if (!event.isBlocked) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
111
121
|
this.emit('authenticate', undefined);
|
|
112
122
|
});
|
|
113
123
|
sessionEmitter.on('network.fetchError', event => {
|
|
@@ -119,6 +129,7 @@ export class Request extends EventEmitter<{
|
|
|
119
129
|
return;
|
|
120
130
|
}
|
|
121
131
|
this.#error = event.errorText;
|
|
132
|
+
this.#event.isBlocked = event.isBlocked;
|
|
122
133
|
this.#event.request.headers = event.request.headers;
|
|
123
134
|
this.#event.request.timings = event.request.timings;
|
|
124
135
|
this.emit('error', this.#error);
|
|
@@ -133,6 +144,7 @@ export class Request extends EventEmitter<{
|
|
|
133
144
|
return;
|
|
134
145
|
}
|
|
135
146
|
this.#response = event.response;
|
|
147
|
+
this.#event.isBlocked = event.isBlocked;
|
|
136
148
|
this.#event.request.headers = event.request.headers;
|
|
137
149
|
this.#event.request.timings = event.request.timings;
|
|
138
150
|
this.emit('response', this.#response);
|
|
@@ -146,11 +158,21 @@ export class Request extends EventEmitter<{
|
|
|
146
158
|
return;
|
|
147
159
|
}
|
|
148
160
|
this.#response = event.response;
|
|
161
|
+
this.#event.isBlocked = event.isBlocked;
|
|
149
162
|
this.#event.request.headers = event.request.headers;
|
|
150
163
|
this.#event.request.timings = event.request.timings;
|
|
151
164
|
this.emit('success', this.#response);
|
|
152
|
-
//
|
|
153
|
-
|
|
165
|
+
// A redirect continues as a new `network.beforeRequestSent` event with
|
|
166
|
+
// the next redirect count, so the request is kept until then. A
|
|
167
|
+
// redirect status without a `Location` header is a final response
|
|
168
|
+
// (https://fetch.spec.whatwg.org/#http-redirect-fetch), and any other
|
|
169
|
+
// status, including 304 Not Modified, completes the request.
|
|
170
|
+
if (
|
|
171
|
+
REDIRECT_STATUSES.has(this.#response.status) &&
|
|
172
|
+
this.#response.headers.some(header => {
|
|
173
|
+
return header.name.toLowerCase() === 'location';
|
|
174
|
+
})
|
|
175
|
+
) {
|
|
154
176
|
return;
|
|
155
177
|
}
|
|
156
178
|
this.dispose();
|
|
@@ -9,6 +9,7 @@ import {DisposableStack} from '../util/disposable.js';
|
|
|
9
9
|
import {isErrorLike} from '../util/ErrorLike.js';
|
|
10
10
|
|
|
11
11
|
import type {ExecutionContext} from './ExecutionContext.js';
|
|
12
|
+
import {CDP_BINDING_PREFIX} from './utils.js';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* @internal
|
|
@@ -52,6 +53,7 @@ export class Binding {
|
|
|
52
53
|
isTrivial: boolean,
|
|
53
54
|
): Promise<void> {
|
|
54
55
|
const stack = new DisposableStack();
|
|
56
|
+
const cdpName = CDP_BINDING_PREFIX + this.#name;
|
|
55
57
|
try {
|
|
56
58
|
if (!isTrivial) {
|
|
57
59
|
// Getting non-trivial arguments.
|
|
@@ -60,7 +62,7 @@ export class Binding {
|
|
|
60
62
|
// @ts-expect-error Code is evaluated in a different context.
|
|
61
63
|
return globalThis[name].args.get(seq);
|
|
62
64
|
},
|
|
63
|
-
|
|
65
|
+
cdpName,
|
|
64
66
|
id,
|
|
65
67
|
);
|
|
66
68
|
const properties = await handles.getProperties();
|
|
@@ -88,7 +90,7 @@ export class Binding {
|
|
|
88
90
|
callbacks.get(seq).resolve(result);
|
|
89
91
|
callbacks.delete(seq);
|
|
90
92
|
},
|
|
91
|
-
|
|
93
|
+
cdpName,
|
|
92
94
|
id,
|
|
93
95
|
await this.#fn(...args),
|
|
94
96
|
);
|
|
@@ -110,7 +112,7 @@ export class Binding {
|
|
|
110
112
|
callbacks.get(seq).reject(error);
|
|
111
113
|
callbacks.delete(seq);
|
|
112
114
|
},
|
|
113
|
-
|
|
115
|
+
cdpName,
|
|
114
116
|
id,
|
|
115
117
|
error.message,
|
|
116
118
|
error.stack,
|
|
@@ -127,7 +129,7 @@ export class Binding {
|
|
|
127
129
|
callbacks.get(seq).reject(error);
|
|
128
130
|
callbacks.delete(seq);
|
|
129
131
|
},
|
|
130
|
-
|
|
132
|
+
cdpName,
|
|
131
133
|
id,
|
|
132
134
|
error,
|
|
133
135
|
)
|
|
@@ -157,21 +157,46 @@ export class ExtensionTransport implements ConnectionTransport {
|
|
|
157
157
|
});
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
case 'Target.attachToTarget': {
|
|
163
|
+
switch (parsed.params?.targetId) {
|
|
164
|
+
case pageTargetInfo.targetId:
|
|
165
|
+
this.#dispatchResponse({
|
|
166
|
+
id: parsed.id,
|
|
167
|
+
sessionId: parsed.sessionId,
|
|
168
|
+
method: parsed.method,
|
|
169
|
+
result: {
|
|
170
|
+
sessionId: 'pageTargetSessionId',
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
return;
|
|
174
|
+
case tabTargetInfo.targetId:
|
|
175
|
+
this.#dispatchResponse({
|
|
176
|
+
id: parsed.id,
|
|
177
|
+
sessionId: parsed.sessionId,
|
|
178
|
+
method: parsed.method,
|
|
179
|
+
result: {
|
|
180
|
+
sessionId: 'tabTargetSessionId',
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
160
186
|
}
|
|
161
187
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
188
|
+
const sessionId =
|
|
189
|
+
parsed.sessionId === 'pageTargetSessionId' ? undefined : parsed.sessionId;
|
|
165
190
|
chrome.debugger
|
|
166
191
|
.sendCommand(
|
|
167
|
-
{tabId: this.#tabId, sessionId
|
|
192
|
+
{tabId: this.#tabId, sessionId},
|
|
168
193
|
parsed.method,
|
|
169
194
|
parsed.params,
|
|
170
195
|
)
|
|
171
196
|
.then(response => {
|
|
172
197
|
this.#dispatchResponse({
|
|
173
198
|
id: parsed.id,
|
|
174
|
-
sessionId: parsed.sessionId
|
|
199
|
+
sessionId: parsed.sessionId,
|
|
175
200
|
method: parsed.method,
|
|
176
201
|
result: response,
|
|
177
202
|
});
|
|
@@ -179,7 +204,7 @@ export class ExtensionTransport implements ConnectionTransport {
|
|
|
179
204
|
.catch(err => {
|
|
180
205
|
this.#dispatchResponse({
|
|
181
206
|
id: parsed.id,
|
|
182
|
-
sessionId: parsed.sessionId
|
|
207
|
+
sessionId: parsed.sessionId,
|
|
183
208
|
method: parsed.method,
|
|
184
209
|
error: {
|
|
185
210
|
code: err?.code,
|
|
@@ -9,6 +9,7 @@ import type {Protocol} from 'devtools-protocol';
|
|
|
9
9
|
import {type CDPSession, CDPSessionEvent} from '../api/CDPSession.js';
|
|
10
10
|
import {FrameEvent} from '../api/Frame.js';
|
|
11
11
|
import {PageEvent, type NewDocumentScriptEvaluation} from '../api/Page.js';
|
|
12
|
+
import type {WebWorker} from '../api/WebWorker.js';
|
|
12
13
|
import {DEBUG_PREFIXES, type Logger} from '../common/Debug.js';
|
|
13
14
|
import {EventEmitter} from '../common/EventEmitter.js';
|
|
14
15
|
import type {TimeoutSettings} from '../common/TimeoutSettings.js';
|
|
@@ -271,6 +272,10 @@ export class FrameManager extends EventEmitter<FrameManagerEvents> {
|
|
|
271
272
|
return this.#page;
|
|
272
273
|
}
|
|
273
274
|
|
|
275
|
+
worker(client: CDPSession): WebWorker | null {
|
|
276
|
+
return this.#page.worker(client);
|
|
277
|
+
}
|
|
278
|
+
|
|
274
279
|
mainFrame(): CdpFrame {
|
|
275
280
|
const mainFrame = this._frameTree.getMainFrame();
|
|
276
281
|
assert(mainFrame, 'Requesting main frame too early!');
|
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
STATUS_TEXTS,
|
|
18
18
|
handleError,
|
|
19
19
|
} from '../api/HTTPRequest.js';
|
|
20
|
+
import type {Page} from '../api/Page.js';
|
|
21
|
+
import type {WebWorker} from '../api/WebWorker.js';
|
|
20
22
|
import {DEBUG_PREFIXES, type Logger} from '../common/Debug.js';
|
|
21
23
|
import {
|
|
22
24
|
mergeUint8Arrays,
|
|
@@ -65,6 +67,7 @@ export class CdpHTTPRequest extends HTTPRequest {
|
|
|
65
67
|
#initiator?: Protocol.Network.Initiator;
|
|
66
68
|
#logger: Logger;
|
|
67
69
|
#resolution: InterceptResolution | null = null;
|
|
70
|
+
#worker: WebWorker | null;
|
|
68
71
|
|
|
69
72
|
override get client(): CDPSession {
|
|
70
73
|
return this.#client;
|
|
@@ -88,6 +91,7 @@ export class CdpHTTPRequest extends HTTPRequest {
|
|
|
88
91
|
constructor(
|
|
89
92
|
client: CDPSession,
|
|
90
93
|
frame: Frame | null,
|
|
94
|
+
worker: WebWorker | null,
|
|
91
95
|
interceptionId: string | undefined,
|
|
92
96
|
allowInterception: boolean,
|
|
93
97
|
data: {
|
|
@@ -153,6 +157,7 @@ export class CdpHTTPRequest extends HTTPRequest {
|
|
|
153
157
|
}
|
|
154
158
|
this.#hasPostData = data.request.hasPostData ?? false;
|
|
155
159
|
this.#frame = frame;
|
|
160
|
+
this.#worker = worker;
|
|
156
161
|
this._redirectChain = redirectChain;
|
|
157
162
|
this.#initiator = data.initiator;
|
|
158
163
|
|
|
@@ -225,6 +230,14 @@ export class CdpHTTPRequest extends HTTPRequest {
|
|
|
225
230
|
return this._response;
|
|
226
231
|
}
|
|
227
232
|
|
|
233
|
+
override page(): Page | null {
|
|
234
|
+
return this.#frame?.page() ?? null;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
override worker(): WebWorker | null {
|
|
238
|
+
return this.#worker;
|
|
239
|
+
}
|
|
240
|
+
|
|
228
241
|
override frame(): Frame | null {
|
|
229
242
|
return this.#frame;
|
|
230
243
|
}
|
|
@@ -251,7 +264,11 @@ export class CdpHTTPRequest extends HTTPRequest {
|
|
|
251
264
|
}
|
|
252
265
|
|
|
253
266
|
protected canBeIntercepted(): boolean {
|
|
254
|
-
return
|
|
267
|
+
return (
|
|
268
|
+
!this.url().startsWith('data:') &&
|
|
269
|
+
!this._fromMemoryCache &&
|
|
270
|
+
Boolean(this._interceptionId)
|
|
271
|
+
);
|
|
255
272
|
}
|
|
256
273
|
|
|
257
274
|
/**
|
|
@@ -14,6 +14,7 @@ import {stringToTypedArray} from '../util/encoding.js';
|
|
|
14
14
|
import {normalizeHeaderValue} from '../util/httpUtils.js';
|
|
15
15
|
|
|
16
16
|
import type {CdpHTTPRequest} from './HTTPRequest.js';
|
|
17
|
+
import {createResponseBodyStream} from './ResponseBodyStream.js';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* @internal
|
|
@@ -30,6 +31,7 @@ export class CdpHTTPResponse extends HTTPResponse {
|
|
|
30
31
|
#headers: Record<string, string> = {};
|
|
31
32
|
#securityDetails: SecurityDetails | null;
|
|
32
33
|
#timing: Protocol.Network.ResourceTiming | null;
|
|
34
|
+
#encodedDataLength = 0;
|
|
33
35
|
|
|
34
36
|
constructor(
|
|
35
37
|
request: CdpHTTPRequest,
|
|
@@ -62,6 +64,7 @@ export class CdpHTTPResponse extends HTTPResponse {
|
|
|
62
64
|
? new SecurityDetails(responsePayload.securityDetails)
|
|
63
65
|
: null;
|
|
64
66
|
this.#timing = responsePayload.timing || null;
|
|
67
|
+
this._setEncodedDataLength(responsePayload.encodedDataLength);
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
#parseStatusTextFromExtraInfo(
|
|
@@ -85,6 +88,15 @@ export class CdpHTTPResponse extends HTTPResponse {
|
|
|
85
88
|
return statusText;
|
|
86
89
|
}
|
|
87
90
|
|
|
91
|
+
_setEncodedDataLength(encodedDataLength: number): void {
|
|
92
|
+
// Chromium reports -1 when no data was transferred over the network (e.g.
|
|
93
|
+
// data: or file: URLs) or when the size is unknown (e.g. synchronous XHRs
|
|
94
|
+
// to data: URLs). Keep the last known value in that case, defaulting to 0.
|
|
95
|
+
if (encodedDataLength >= 0) {
|
|
96
|
+
this.#encodedDataLength = encodedDataLength;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
88
100
|
_resolveBody(err?: Error): void {
|
|
89
101
|
if (err) {
|
|
90
102
|
return this.#bodyLoadedDeferred.reject(err);
|
|
@@ -120,6 +132,10 @@ export class CdpHTTPResponse extends HTTPResponse {
|
|
|
120
132
|
return this.#timing;
|
|
121
133
|
}
|
|
122
134
|
|
|
135
|
+
override encodedDataLength(): number {
|
|
136
|
+
return this.#encodedDataLength;
|
|
137
|
+
}
|
|
138
|
+
|
|
123
139
|
override content(): Promise<Uint8Array> {
|
|
124
140
|
if (!this.#contentPromise) {
|
|
125
141
|
this.#contentPromise = this.#bodyLoadedDeferred
|
|
@@ -154,6 +170,38 @@ export class CdpHTTPResponse extends HTTPResponse {
|
|
|
154
170
|
return this.#contentPromise;
|
|
155
171
|
}
|
|
156
172
|
|
|
173
|
+
override async stream(): Promise<ReadableStream<Uint8Array>> {
|
|
174
|
+
if (this.#bodyLoadedDeferred.finished()) {
|
|
175
|
+
return await this.#contentStream();
|
|
176
|
+
}
|
|
177
|
+
try {
|
|
178
|
+
// Use the request's client, as it might have been updated for an adopted
|
|
179
|
+
// OOPIF.
|
|
180
|
+
return await createResponseBodyStream(
|
|
181
|
+
this.#request.client,
|
|
182
|
+
this.#request.id,
|
|
183
|
+
);
|
|
184
|
+
} catch (error) {
|
|
185
|
+
if (
|
|
186
|
+
error instanceof ProtocolError &&
|
|
187
|
+
error.originalMessage.includes('already finished loading')
|
|
188
|
+
) {
|
|
189
|
+
return await this.#contentStream();
|
|
190
|
+
}
|
|
191
|
+
throw error;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
async #contentStream(): Promise<ReadableStream<Uint8Array>> {
|
|
196
|
+
const content = await this.content();
|
|
197
|
+
return new ReadableStream({
|
|
198
|
+
start(controller) {
|
|
199
|
+
controller.enqueue(content);
|
|
200
|
+
controller.close();
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
157
205
|
override request(): CdpHTTPRequest {
|
|
158
206
|
return this.#request;
|
|
159
207
|
}
|
|
@@ -47,6 +47,17 @@ export interface SessionEvent<T> {
|
|
|
47
47
|
client: CDPSession;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* A stored `Network.requestWillBeSent` event. With request interception
|
|
52
|
+
* enabled, it can also hold a `Network.loadingFailed` event that arrived
|
|
53
|
+
* before the `Fetch.requestPaused` event that creates the request.
|
|
54
|
+
*
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
export interface StoredRequestWillBeSent extends SessionEvent<Protocol.Network.RequestWillBeSentEvent> {
|
|
58
|
+
loadingFailed?: SessionEvent<Protocol.Network.LoadingFailedEvent>;
|
|
59
|
+
}
|
|
60
|
+
|
|
50
61
|
/**
|
|
51
62
|
* @internal
|
|
52
63
|
*/
|
|
@@ -90,10 +101,7 @@ export class NetworkEventManager {
|
|
|
90
101
|
* `_onRequestWillBeSent`, `_onRequestPaused`, `_onRequestPaused`, ...
|
|
91
102
|
* (see crbug.com/1196004)
|
|
92
103
|
*/
|
|
93
|
-
#requestWillBeSentMap = new Map<
|
|
94
|
-
NetworkRequestId,
|
|
95
|
-
SessionEvent<Protocol.Network.RequestWillBeSentEvent>
|
|
96
|
-
>();
|
|
104
|
+
#requestWillBeSentMap = new Map<NetworkRequestId, StoredRequestWillBeSent>();
|
|
97
105
|
#requestPausedMap = new Map<
|
|
98
106
|
NetworkRequestId,
|
|
99
107
|
SessionEvent<Protocol.Fetch.RequestPausedEvent>
|
|
@@ -128,6 +136,34 @@ export class NetworkEventManager {
|
|
|
128
136
|
this.#responseReceivedExtraInfoMap.delete(networkRequestId);
|
|
129
137
|
}
|
|
130
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Ids of the requests whose Network events come from `client`, both the
|
|
141
|
+
* ones already emitted and the ones still waiting for more events.
|
|
142
|
+
*/
|
|
143
|
+
requestIdsForClient(client: CDPSession): Set<NetworkRequestId> {
|
|
144
|
+
const ids = new Set<NetworkRequestId>();
|
|
145
|
+
for (const [id, request] of this.#httpRequestsMap) {
|
|
146
|
+
if (request.client === client) {
|
|
147
|
+
ids.add(id);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
for (const [id, stored] of this.#requestWillBeSentMap) {
|
|
151
|
+
if (stored.client === client) {
|
|
152
|
+
ids.add(id);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
for (const [id, infos] of this.#queuedRedirectInfoMap) {
|
|
156
|
+
if (
|
|
157
|
+
infos.some(info => {
|
|
158
|
+
return info.client === client;
|
|
159
|
+
})
|
|
160
|
+
) {
|
|
161
|
+
ids.add(id);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return ids;
|
|
165
|
+
}
|
|
166
|
+
|
|
131
167
|
requestExtraInfo(
|
|
132
168
|
networkRequestId: NetworkRequestId,
|
|
133
169
|
): Protocol.Network.RequestWillBeSentExtraInfoEvent[] {
|
|
@@ -190,7 +226,7 @@ export class NetworkEventManager {
|
|
|
190
226
|
|
|
191
227
|
getRequestWillBeSent(
|
|
192
228
|
networkRequestId: NetworkRequestId,
|
|
193
|
-
):
|
|
229
|
+
): StoredRequestWillBeSent | undefined {
|
|
194
230
|
return this.#requestWillBeSentMap.get(networkRequestId);
|
|
195
231
|
}
|
|
196
232
|
|
|
@@ -231,6 +267,23 @@ export class NetworkEventManager {
|
|
|
231
267
|
this.#httpRequestsMap.delete(networkRequestId);
|
|
232
268
|
}
|
|
233
269
|
|
|
270
|
+
/**
|
|
271
|
+
* With request interception enabled, Network.loadingFailed can arrive before
|
|
272
|
+
* the Fetch.requestPaused event that creates the request. The failure is
|
|
273
|
+
* kept with the stored requestWillBeSent event until then, so that
|
|
274
|
+
* `requestfailed` is not lost.
|
|
275
|
+
*/
|
|
276
|
+
storeLoadingFailedBeforeRequest(
|
|
277
|
+
networkRequestId: NetworkRequestId,
|
|
278
|
+
event: Protocol.Network.LoadingFailedEvent,
|
|
279
|
+
client: CDPSession,
|
|
280
|
+
): void {
|
|
281
|
+
const requestWillBeSent = this.#requestWillBeSentMap.get(networkRequestId);
|
|
282
|
+
if (requestWillBeSent) {
|
|
283
|
+
requestWillBeSent.loadingFailed = {event, client};
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
234
287
|
getQueuedEventGroup(
|
|
235
288
|
networkRequestId: NetworkRequestId,
|
|
236
289
|
): QueuedEventGroup | undefined {
|