chrome-devtools-frontend 1.0.1738725 → 1.0.1742811
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-accessibility-and-semantic-html.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +44 -7
- package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-view-output-and-callback-contracts.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +1 -1
- package/.agents/skills/code-review/SKILL.md +23 -6
- package/.agents/skills/devtools-verification/SKILL.md +2 -1
- package/.agents/skills/migrate-chromium-test/SKILL.md +1 -0
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +27 -11
- package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +41 -23
- package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +12 -7
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +3 -0
- package/.agents/skills/ui-widgets/SKILL.md +22 -7
- package/.agents/skills/version-control/SKILL.md +10 -1
- package/.agents/skills/visual-regression-audit/SKILL.md +88 -0
- package/.gitallowed +2 -1
- package/.stylelintignore +1 -0
- package/.stylelintrc.json +5 -1
- package/AUTHORS +1 -0
- package/DIR_METADATA +2 -1
- package/PRESUBMIT_test.py +143 -0
- package/config/owner/INFRA_OWNERS +0 -1
- package/docs/contributing/infrastructure.md +2 -2
- package/docs/ui_engineering.md +14 -4
- package/eslint.config.mjs +119 -9
- package/front_end/application_tokens.css +0 -65
- package/front_end/core/host/AidaClient.ts +1 -1
- package/front_end/core/host/AidaClientTypes.ts +2 -0
- package/front_end/core/host/AidaErrors.ts +3 -3
- package/front_end/core/host/AidaGcaTranslation.ts +39 -0
- package/front_end/core/host/GcaClient.ts +32 -20
- package/front_end/core/host/GcaTypes.ts +4 -2
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
- package/front_end/core/i18n/DevToolsLocale.ts +0 -1
- package/front_end/core/sdk/DebuggerModel.ts +25 -13
- package/front_end/core/sdk/PreloadingModel.ts +2 -2
- package/front_end/core/sdk/RehydratingConnection.ts +59 -30
- package/front_end/core/sdk/SourceMap.ts +30 -3
- package/front_end/core/sdk/SourceMapRangeMappings.ts +57 -0
- package/front_end/core/sdk/StorageKeyManager.ts +0 -1
- package/front_end/core/sdk/Target.ts +6 -0
- package/front_end/core/sdk/TargetManager.ts +10 -4
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +5 -9
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +12 -2
- package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +159 -52
- package/front_end/entrypoints/inspector_main/outermostTargetSelector.css +77 -25
- package/front_end/entrypoints/main/MainImpl.ts +32 -15
- package/front_end/models/ai_assistance/AiAgent2.ts +95 -46
- package/front_end/models/ai_assistance/AiConversation.ts +1 -1
- package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -2
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +3 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +5 -4
- package/front_end/models/ai_assistance/performance/AICallTree.ts +7 -9
- package/front_end/models/ai_assistance/performance/AIQueries.ts +4 -8
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +11 -1
- package/front_end/models/ai_assistance/skills/lighthouse.md +1 -0
- package/front_end/models/ai_assistance/skills/network.md +3 -4
- package/front_end/models/ai_assistance/skills/sources.md +1 -2
- package/front_end/models/ai_assistance/skills/styling.md +3 -4
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +11 -3
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +84 -23
- package/front_end/models/ai_assistance/tools/ListSources.ts +41 -13
- package/front_end/models/badges/Badge.ts +0 -1
- package/front_end/models/bindings/ResourceMapping.ts +1 -1
- package/front_end/models/bindings/ResourceScriptMapping.ts +1 -1
- package/front_end/models/breakpoints/BreakpointManager.ts +2 -4
- package/front_end/models/breakpoints/RecurringPauseDetector.ts +140 -0
- package/front_end/models/breakpoints/breakpoints.ts +2 -1
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +2 -2
- package/front_end/models/persistence/Automapping.ts +0 -1
- package/front_end/models/trace/Processor.ts +16 -7
- package/front_end/models/trace/README.md +17 -1
- package/front_end/models/trace/extras/ThirdParties.ts +4 -6
- package/front_end/models/trace/extras/TraceFilter.ts +16 -8
- package/front_end/models/trace/extras/TraceTree.ts +159 -125
- package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +0 -5
- package/front_end/models/trace/handlers/MetaHandler.ts +3 -0
- 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/handlers/types.ts +15 -0
- 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 +19 -14
- 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/trace/lantern/simulation/Simulator.ts +4 -1
- package/front_end/models/web_mcp/WebMCPModel.ts +19 -9
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +30 -3
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +2 -4
- package/front_end/panels/ai_assistance/components/chatMessage.css +1 -22
- package/front_end/panels/ai_assistance/components/chatView.css +0 -180
- package/front_end/panels/ai_assistance/components/exploreWidget.css +1 -19
- package/front_end/panels/ai_assistance/components/optInChangeDialog.css +1 -1
- package/front_end/panels/ai_assistance/components/walkthroughView.css +0 -13
- package/front_end/panels/animation/AnimationGroupPreviewUI.ts +3 -2
- package/front_end/panels/animation/AnimationTimeline.ts +5 -3
- package/front_end/panels/animation/animationTimeline.css +10 -8
- package/front_end/panels/application/ApplicationPanelSidebar.ts +14 -11
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +66 -3
- package/front_end/panels/application/ReportingApiView.ts +0 -1
- package/front_end/panels/application/SubAppsView.ts +0 -1
- package/front_end/panels/application/WebMCPTreeElement.ts +3 -6
- package/front_end/panels/application/WebMCPView.ts +30 -0
- package/front_end/panels/application/components/ReportsGrid.ts +0 -1
- package/front_end/panels/application/components/backForwardCacheView.css +1 -8
- package/front_end/panels/application/components/permissionsPolicySection.css +2 -2
- package/front_end/panels/application/components/protocolHandlersView.css +46 -39
- package/front_end/panels/application/components/trustTokensView.css +0 -4
- package/front_end/panels/application/cookieItemsView.css +0 -7
- package/front_end/panels/application/indexedDBViews.css +0 -6
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +0 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +0 -1
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -5
- package/front_end/panels/application/preloading/components/preloadingGrid.css +0 -9
- package/front_end/panels/application/resourcesPanel.css +0 -48
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +2 -9
- package/front_end/panels/application/serviceWorkersView.css +5 -4
- package/front_end/panels/application/storageView.css +0 -5
- package/front_end/panels/application/webMCPView.css +17 -0
- package/front_end/panels/browser_debugger/ObjectEventListenersSidebarPane.ts +15 -20
- package/front_end/panels/changes/changesView.css +0 -5
- package/front_end/panels/common/ExtensionServer.ts +80 -10
- package/front_end/panels/console/ConsolePanel.ts +92 -18
- package/front_end/panels/console/consoleContextSelector.css +1 -8
- package/front_end/panels/console/consoleInsightTeaser.css +10 -17
- package/front_end/panels/console/consolePinPane.css +3 -1
- package/front_end/panels/console/consoleView.css +14 -18
- package/front_end/panels/coverage/coverageListView.css +0 -4
- package/front_end/panels/css_overview/cssOverviewCompletedView.css +0 -22
- package/front_end/panels/css_overview/cssOverviewStartView.css +0 -43
- package/front_end/panels/developer_resources/developerResourcesListView.css +0 -4
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +52 -45
- package/front_end/panels/elements/LayoutPane.ts +1 -3
- package/front_end/panels/elements/PropertiesWidget.ts +26 -8
- package/front_end/panels/elements/PropertyRenderer.ts +45 -21
- package/front_end/panels/elements/StandaloneStylesContainer.ts +6 -7
- package/front_end/panels/elements/StyleEditorWidget.ts +110 -63
- package/front_end/panels/elements/StylePropertiesSection.ts +18 -14
- package/front_end/panels/elements/StylePropertyTreeElement.ts +556 -527
- package/front_end/panels/elements/StylesContainer.ts +5 -6
- package/front_end/panels/elements/StylesSidebarPane.ts +12 -15
- package/front_end/panels/elements/classesPaneWidget.css +3 -7
- package/front_end/panels/elements/components/CSSQuery.ts +6 -5
- package/front_end/panels/elements/components/CSSVariableValueView.ts +17 -4
- package/front_end/panels/elements/components/StylePropertyEditor.ts +178 -140
- package/front_end/panels/elements/components/cssQuery.css +1 -1
- package/front_end/panels/elements/components/stylePropertyEditor.css +60 -56
- package/front_end/panels/elements/layoutPane.css +2 -2
- package/front_end/panels/elements/metricsSidebarPane.css +7 -8
- package/front_end/panels/elements/platformFontsWidget.css +1 -1
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +1 -12
- package/front_end/panels/elements/stylesSidebarPane.css +3 -5
- package/front_end/panels/emulation/deviceModeView.css +1 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +9 -2
- package/front_end/panels/event_listeners/eventListenersView.css +1 -1
- package/front_end/panels/explain/components/consoleInsight.css +1 -7
- 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 +13 -43
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +1 -1
- package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
- package/front_end/panels/layer_viewer/paintProfiler.css +4 -3
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +1 -6
- package/front_end/panels/lighthouse/lighthousePanel.css +0 -9
- package/front_end/panels/lighthouse/lighthouseStartView.css +5 -16
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +0 -1
- package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +2 -2
- package/front_end/panels/linear_memory_inspector/components/linearMemoryValueInterpreter.css +2 -2
- package/front_end/panels/linear_memory_inspector/components/linearMemoryViewer.css +2 -2
- package/front_end/panels/linear_memory_inspector/components/valueInterpreterSettings.css +1 -1
- package/front_end/panels/media/playerListView.css +1 -2
- package/front_end/panels/media/playerPropertiesView.css +1 -1
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +4 -4
- package/front_end/panels/network/NetworkLogView.ts +603 -582
- package/front_end/panels/network/RequestCookiesView.ts +0 -1
- package/front_end/panels/network/RequestTimingView.ts +16 -2
- package/front_end/panels/network/networkConfigView.css +3 -4
- package/front_end/panels/network/networkLogView.css +363 -377
- package/front_end/panels/network/networkPanel.css +1 -7
- package/front_end/panels/network/networkTimingTable.css +12 -27
- package/front_end/panels/network/networkWaterfallColumn.css +1 -1
- package/front_end/panels/network/requestConditionsDrawer.css +0 -4
- package/front_end/panels/network/requestCookiesView.css +7 -1
- package/front_end/panels/network/requestPayloadTree.css +0 -4
- package/front_end/panels/profiler/HeapProfileView.ts +1 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +0 -7
- package/front_end/panels/profiler/profilesPanel.css +0 -11
- package/front_end/panels/recorder/ControlButton.ts +1 -1
- package/front_end/panels/recorder/RecorderPanel.ts +1 -1
- package/front_end/panels/recorder/RecordingView.ts +32 -11
- package/front_end/panels/recorder/StepView.ts +31 -5
- package/front_end/panels/recorder/TimelineSection.ts +22 -6
- package/front_end/panels/recorder/controlButton.css +2 -9
- package/front_end/panels/recorder/createRecordingView.css +1 -1
- package/front_end/panels/recorder/recorderPanel.css +0 -9
- package/front_end/panels/recorder/recordingListView.css +4 -4
- package/front_end/panels/recorder/recordingView.css +44 -52
- package/front_end/panels/recorder/replaySection.css +2 -0
- package/front_end/panels/recorder/stepEditor.css +4 -4
- package/front_end/panels/recorder/stepView.css +47 -21
- package/front_end/panels/recorder/timelineSection.css +63 -83
- package/front_end/panels/screencast/ScreencastApp.ts +0 -1
- package/front_end/panels/search/searchView.css +1 -1
- package/front_end/panels/security/mainView.css +1 -1
- package/front_end/panels/security/originView.css +2 -2
- package/front_end/panels/sensors/SensorsView.ts +273 -361
- package/front_end/panels/settings/BackendLinkingSettingsTab.ts +0 -1
- package/front_end/panels/settings/backendLinkingSettingsTab.css +7 -7
- package/front_end/panels/settings/components/syncSection.css +0 -1
- package/front_end/panels/settings/workspaceSettingsTab.css +0 -5
- package/front_end/panels/sources/CSSPlugin.ts +177 -98
- package/front_end/panels/sources/DebuggerPausedMessage.ts +100 -27
- package/front_end/panels/sources/NavigatorView.ts +926 -946
- package/front_end/panels/sources/SourcesPanel.ts +9 -2
- package/front_end/panels/sources/breakpointsView.css +6 -28
- package/front_end/panels/sources/components/HeadersView.css +2 -2
- package/front_end/panels/sources/debuggerPausedMessage.css +7 -0
- package/front_end/panels/sources/navigatorTree.css +7 -2
- package/front_end/panels/sources/sourcesNavigator.css +0 -9
- package/front_end/panels/sources/sourcesView.css +2 -1
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +0 -10
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +3 -0
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +18 -5
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +0 -10
- package/front_end/panels/timeline/ModificationsManager.ts +0 -1
- package/front_end/panels/timeline/ThreadAppender.ts +2 -6
- 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/TimelineMiniMap.ts +132 -54
- package/front_end/panels/timeline/TimelinePanel.ts +2 -2
- package/front_end/panels/timeline/TimelineTreeView.ts +63 -50
- package/front_end/panels/timeline/TimelineUIUtils.ts +8 -10
- package/front_end/panels/timeline/components/DetailsView.ts +7 -14
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +0 -2
- package/front_end/panels/timeline/components/NetworkTrackWidget.ts +5 -1
- package/front_end/panels/timeline/components/fieldSettingsDialog.css +1 -6
- package/front_end/panels/timeline/components/insights/baseInsightComponent.css +0 -12
- package/front_end/panels/timeline/components/interactionBreakdown.css +1 -1
- package/front_end/panels/timeline/components/layoutShiftDetails.css +2 -9
- package/front_end/panels/timeline/components/liveMetricsView.css +0 -16
- package/front_end/panels/timeline/components/metricCard.css +1 -5
- package/front_end/panels/timeline/components/networkRequestDetails.css +3 -3
- package/front_end/panels/timeline/components/networkRequestTooltip.css +6 -4
- package/front_end/panels/timeline/components/networkTrackWidget.css +1 -1
- package/front_end/panels/timeline/components/sidebarAnnotationsTab.css +1 -1
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -1
- package/front_end/panels/timeline/docs/profile_calls.md +7 -9
- package/front_end/panels/timeline/timelineDetailsView.css +1 -12
- package/front_end/panels/timeline/timelineFlamechartPopover.css +0 -4
- package/front_end/panels/timeline/timelineMiniMap.css +1 -4
- package/front_end/panels/timeline/timelinePanel.css +0 -4
- package/front_end/panels/timeline/timelineStatusDialog.css +1 -1
- package/front_end/panels/timeline/timelineTreeView.css +0 -12
- package/front_end/panels/timeline/utils/EntryNodes.ts +1 -1
- package/front_end/panels/webauthn/webauthnPane.css +2 -8
- package/front_end/panels/whats_new/ReleaseNoteText.ts +1 -1
- 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/components/adorners/adorner.css +1 -1
- package/front_end/ui/components/buttons/button.css +0 -28
- package/front_end/ui/components/buttons/textButton.css +1 -45
- package/front_end/ui/components/diff_view/diffView.css +0 -2
- package/front_end/ui/components/input/checkbox.css +3 -3
- package/front_end/ui/components/issue_counter/issueLinkIcon.css +2 -2
- package/front_end/ui/components/menus/Menu.ts +14 -0
- package/front_end/ui/components/menus/menu.css +2 -14
- package/front_end/ui/components/menus/menuItem.css +0 -4
- package/front_end/ui/components/request_link_icon/requestLinkIcon.css +2 -2
- package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
- package/front_end/ui/components/survey_link/surveyLink.css +3 -3
- package/front_end/ui/components/switch/switch.css +3 -2
- package/front_end/ui/components/text_editor/theme.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +29 -0
- package/front_end/ui/components/tree_outline/treeOutline.css +1 -24
- package/front_end/ui/legacy/ContextMenu.ts +5 -5
- package/front_end/ui/legacy/SoftContextMenu.ts +24 -8
- package/front_end/ui/legacy/Toolbar.ts +1 -1
- package/front_end/ui/legacy/Treeoutline.ts +31 -78
- package/front_end/ui/legacy/UIUtils.ts +9 -17
- package/front_end/ui/legacy/checkboxTextLabel.css +2 -44
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +39 -27
- package/front_end/ui/legacy/components/color_picker/spectrum.css +2 -10
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +2 -6
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +34 -26
- package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +1 -0
- package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/swatchPopover.css +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +83 -21
- package/front_end/ui/legacy/components/object_ui/objectPopover.css +0 -4
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +41 -14
- package/front_end/ui/legacy/components/perf_ui/chartViewport.css +1 -9
- package/front_end/ui/legacy/components/perf_ui/filmStripView.css +1 -1
- package/front_end/ui/legacy/components/perf_ui/overviewGrid.css +2 -1
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +0 -5
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +6 -3
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +95 -1
- 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/inspectorCommon.css +7 -81
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +1 -1
- package/front_end/ui/legacy/listWidget.css +2 -2
- package/front_end/ui/legacy/progressIndicator.css +1 -1
- package/front_end/ui/legacy/tabbedPane.css +6 -10
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
- package/front_end/ui/visual_logging/LoggingDriver.ts +4 -0
- package/front_end/ui/visual_logging/visual_logging.ts +1 -1
- package/inspector_overlay/common.ts +0 -3
- package/inspector_overlay/main.ts +1 -3
- package/inspector_overlay/tool_highlight.css +0 -7
- package/inspector_overlay/tool_highlight.ts +0 -1
- package/inspector_overlay/tool_source_order.css +0 -4
- package/package.json +1 -1
- package/front_end/generated/SupportedCSSProperties.ts +0 -9689
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
merge,
|
|
11
11
|
raceWith,
|
|
12
12
|
} from '../../third_party/rxjs/rxjs.js';
|
|
13
|
+
import type {ConsoleMessage} from '../common/ConsoleMessage.js';
|
|
13
14
|
import type {
|
|
14
15
|
Cookie,
|
|
15
16
|
CookieData,
|
|
@@ -30,6 +31,8 @@ import type {
|
|
|
30
31
|
PermissionState,
|
|
31
32
|
WaitForTargetOptions,
|
|
32
33
|
} from './Browser.js';
|
|
34
|
+
import type {HTTPRequest} from './HTTPRequest.js';
|
|
35
|
+
import type {HTTPResponse} from './HTTPResponse.js';
|
|
33
36
|
import type {Page} from './Page.js';
|
|
34
37
|
import type {Target} from './Target.js';
|
|
35
38
|
|
|
@@ -57,6 +60,116 @@ export const enum BrowserContextEvent {
|
|
|
57
60
|
* when a page is closed. Contains a {@link Target} instance.
|
|
58
61
|
*/
|
|
59
62
|
TargetDestroyed = 'targetdestroyed',
|
|
63
|
+
/**
|
|
64
|
+
* Emitted when JavaScript within any page or worker in the browser context
|
|
65
|
+
* calls one of the console API methods, e.g. `console.log` or
|
|
66
|
+
* `console.dir`. Contains a {@link ConsoleMessage} instance.
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* Use {@link ConsoleMessage.page}, {@link ConsoleMessage.frame} or
|
|
70
|
+
* {@link ConsoleMessage.worker} to identify the originating context.
|
|
71
|
+
* Messages from workers have no page or frame: use
|
|
72
|
+
* {@link ConsoleMessage.worker} for them. Messages logged by the browser
|
|
73
|
+
* itself (e.g. network errors or violations) can have no page, frame or
|
|
74
|
+
* worker.
|
|
75
|
+
*
|
|
76
|
+
* Events are only delivered for pages and workers that Puppeteer has
|
|
77
|
+
* attached to, e.g. via {@link BrowserContext.pages} or
|
|
78
|
+
* {@link Target.page}. Registering the listener before attaching
|
|
79
|
+
* guarantees that console messages replayed by the browser on attachment
|
|
80
|
+
* are not lost.
|
|
81
|
+
*
|
|
82
|
+
* With WebDriver BiDi, console messages that the browser replays while
|
|
83
|
+
* connecting are delivered once, right after {@link Puppeteer.connect}
|
|
84
|
+
* resolves: register the listener before awaiting anything else, or they
|
|
85
|
+
* are missed. Replayed messages can be delivered after messages logged
|
|
86
|
+
* later.
|
|
87
|
+
*
|
|
88
|
+
* Service workers and shared workers are not attached automatically:
|
|
89
|
+
* their console messages are only delivered after {@link Target.worker}
|
|
90
|
+
* has been called for their target. With WebDriver BiDi, their console
|
|
91
|
+
* messages are not reported.
|
|
92
|
+
*
|
|
93
|
+
* The {@link ConsoleMessage.args | arguments} are shared with listeners
|
|
94
|
+
* registered on {@link Page}, {@link WebWorker} and {@link Browser}.
|
|
95
|
+
* Disposing them in one listener invalidates them for all other listeners.
|
|
96
|
+
*
|
|
97
|
+
* @experimental
|
|
98
|
+
*/
|
|
99
|
+
Console = 'console',
|
|
100
|
+
/**
|
|
101
|
+
* Emitted when any page in the browser context issues a request. Contains
|
|
102
|
+
* a {@link HTTPRequest} instance.
|
|
103
|
+
*
|
|
104
|
+
* @remarks
|
|
105
|
+
* Use {@link HTTPRequest.page} or {@link HTTPRequest.frame} to identify
|
|
106
|
+
* the originating context. Requests from dedicated workers have no page
|
|
107
|
+
* or frame: use {@link HTTPRequest.worker} for them. Dedicated worker
|
|
108
|
+
* requests and {@link HTTPRequest.worker} are not supported with
|
|
109
|
+
* WebDriver BiDi.
|
|
110
|
+
*
|
|
111
|
+
* With CDP, events are only delivered for pages that have a {@link Page}
|
|
112
|
+
* instance, e.g. created via {@link BrowserContext.pages} or {@link Target.page}.
|
|
113
|
+
* Requests issued before the instance exists, such as the initial
|
|
114
|
+
* navigation of a popup, are not reported. With WebDriver BiDi, requests
|
|
115
|
+
* from all pages are reported. Requests from service workers and shared
|
|
116
|
+
* workers are not reported.
|
|
117
|
+
*
|
|
118
|
+
* These listeners only observe requests. Do not call
|
|
119
|
+
* `request.continue()`, `abort()` or `respond()` from them: they are not
|
|
120
|
+
* coordinated with page-level handlers (see
|
|
121
|
+
* {@link https://pptr.dev/guides/network-interception#cooperative-intercept-mode | cooperative intercept mode}).
|
|
122
|
+
* To intercept requests, use {@link Page.setRequestInterception} with a
|
|
123
|
+
* {@link PageEvent.Request} listener.
|
|
124
|
+
*
|
|
125
|
+
* @experimental
|
|
126
|
+
*/
|
|
127
|
+
Request = 'request',
|
|
128
|
+
/**
|
|
129
|
+
* Emitted when a request issued by any page in the browser context is
|
|
130
|
+
* served from the memory cache. Contains a {@link HTTPRequest} instance.
|
|
131
|
+
*
|
|
132
|
+
* @remarks
|
|
133
|
+
* The same delivery rules as for {@link BrowserContextEvent.Request} apply.
|
|
134
|
+
*
|
|
135
|
+
* @experimental
|
|
136
|
+
*/
|
|
137
|
+
RequestServedFromCache = 'requestservedfromcache',
|
|
138
|
+
/**
|
|
139
|
+
* Emitted when a response is received for a request issued by any page in
|
|
140
|
+
* the browser context. Contains a {@link HTTPResponse} instance.
|
|
141
|
+
*
|
|
142
|
+
* @remarks
|
|
143
|
+
* Use {@link HTTPResponse.request} to access the originating request. The
|
|
144
|
+
* same delivery rules as for {@link BrowserContextEvent.Request} apply.
|
|
145
|
+
*
|
|
146
|
+
* @experimental
|
|
147
|
+
*/
|
|
148
|
+
Response = 'response',
|
|
149
|
+
/**
|
|
150
|
+
* Emitted when a request issued by any page in the browser context fails,
|
|
151
|
+
* for example by timing out. Contains a {@link HTTPRequest} instance.
|
|
152
|
+
*
|
|
153
|
+
* @remarks
|
|
154
|
+
* HTTP error responses, such as 404 or 503, are still successful responses
|
|
155
|
+
* from HTTP standpoint, so the request completes with
|
|
156
|
+
* {@link BrowserContextEvent.RequestFinished} and not with
|
|
157
|
+
* {@link BrowserContextEvent.RequestFailed}. The same delivery rules as
|
|
158
|
+
* for {@link BrowserContextEvent.Request} apply.
|
|
159
|
+
*
|
|
160
|
+
* @experimental
|
|
161
|
+
*/
|
|
162
|
+
RequestFailed = 'requestfailed',
|
|
163
|
+
/**
|
|
164
|
+
* Emitted when a request issued by any page in the browser context
|
|
165
|
+
* finishes successfully. Contains a {@link HTTPRequest} instance.
|
|
166
|
+
*
|
|
167
|
+
* @remarks
|
|
168
|
+
* The same delivery rules as for {@link BrowserContextEvent.Request} apply.
|
|
169
|
+
*
|
|
170
|
+
* @experimental
|
|
171
|
+
*/
|
|
172
|
+
RequestFinished = 'requestfinished',
|
|
60
173
|
}
|
|
61
174
|
|
|
62
175
|
/**
|
|
@@ -66,6 +179,12 @@ export interface BrowserContextEvents extends Record<EventType, unknown> {
|
|
|
66
179
|
[BrowserContextEvent.TargetChanged]: Target;
|
|
67
180
|
[BrowserContextEvent.TargetCreated]: Target;
|
|
68
181
|
[BrowserContextEvent.TargetDestroyed]: Target;
|
|
182
|
+
[BrowserContextEvent.Console]: ConsoleMessage;
|
|
183
|
+
[BrowserContextEvent.Request]: HTTPRequest;
|
|
184
|
+
[BrowserContextEvent.RequestServedFromCache]: HTTPRequest;
|
|
185
|
+
[BrowserContextEvent.Response]: HTTPResponse;
|
|
186
|
+
[BrowserContextEvent.RequestFailed]: HTTPRequest;
|
|
187
|
+
[BrowserContextEvent.RequestFinished]: HTTPRequest;
|
|
69
188
|
}
|
|
70
189
|
|
|
71
190
|
/**
|
|
@@ -15,6 +15,8 @@ import {typedArrayToBase64} from '../util/encoding.js';
|
|
|
15
15
|
import type {CDPSession} from './CDPSession.js';
|
|
16
16
|
import type {Frame} from './Frame.js';
|
|
17
17
|
import type {HTTPResponse} from './HTTPResponse.js';
|
|
18
|
+
import type {Page} from './Page.js';
|
|
19
|
+
import type {WebWorker} from './WebWorker.js';
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
22
|
* @public
|
|
@@ -61,7 +63,13 @@ export function headersInputToRecord(
|
|
|
61
63
|
): Record<string, string> {
|
|
62
64
|
return Object.fromEntries(
|
|
63
65
|
Object.entries(normalizeHeadersInput(headers)).map(([key, value]) => {
|
|
64
|
-
|
|
66
|
+
const normalizedValue = Array.isArray(value) ? value.join(', ') : value;
|
|
67
|
+
if (/[\r\n]/.test(key) || /[\r\n]/.test(normalizedValue)) {
|
|
68
|
+
throw new Error(
|
|
69
|
+
`Invalid header: CRLF characters are not allowed in header names or values (header: "${key}").`,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return [key, normalizedValue];
|
|
65
73
|
}),
|
|
66
74
|
);
|
|
67
75
|
}
|
|
@@ -444,9 +452,24 @@ export abstract class HTTPRequest {
|
|
|
444
452
|
*/
|
|
445
453
|
abstract response(): HTTPResponse | null;
|
|
446
454
|
|
|
455
|
+
/**
|
|
456
|
+
* The page that initiated the request, or null if navigating to
|
|
457
|
+
* error pages or the request is coming from a worker.
|
|
458
|
+
*/
|
|
459
|
+
abstract page(): Page | null;
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* The worker that initiated the request, or null if the request
|
|
463
|
+
* was not initiated by a worker.
|
|
464
|
+
*
|
|
465
|
+
* @remarks
|
|
466
|
+
* Not supported with WebDriver BiDi.
|
|
467
|
+
*/
|
|
468
|
+
abstract worker(): WebWorker | null;
|
|
469
|
+
|
|
447
470
|
/**
|
|
448
471
|
* The frame that initiated the request, or null if navigating to
|
|
449
|
-
* error pages.
|
|
472
|
+
* error pages or the request is coming from a worker.
|
|
450
473
|
*/
|
|
451
474
|
abstract frame(): Frame | null;
|
|
452
475
|
|
|
@@ -80,6 +80,20 @@ export abstract class HTTPResponse {
|
|
|
80
80
|
*/
|
|
81
81
|
abstract timing(): Protocol.Network.ResourceTiming | null;
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Total number of bytes received for this request over the network.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* The value is updated when the response finishes loading. During the
|
|
88
|
+
* `response` event, it only covers the bytes received up to the response
|
|
89
|
+
* headers. To get the total encoded transfer size (headers + compressed
|
|
90
|
+
* body), read it in a `requestfinished` handler or after awaiting
|
|
91
|
+
* {@link HTTPResponse.content}. If the request fails after the response is
|
|
92
|
+
* received, the value is not updated. If the browser does not report a
|
|
93
|
+
* size, e.g. for `data:` or `file:` URLs, the value is `0`.
|
|
94
|
+
*/
|
|
95
|
+
abstract encodedDataLength(): number;
|
|
96
|
+
|
|
83
97
|
/**
|
|
84
98
|
* Promise which resolves to a buffer with response body.
|
|
85
99
|
*
|
|
@@ -93,6 +107,20 @@ export abstract class HTTPResponse {
|
|
|
93
107
|
*/
|
|
94
108
|
abstract content(): Promise<Uint8Array>;
|
|
95
109
|
|
|
110
|
+
/**
|
|
111
|
+
* Returns the response body as a stream of chunks as they arrive from the
|
|
112
|
+
* network.
|
|
113
|
+
*
|
|
114
|
+
* @remarks
|
|
115
|
+
*
|
|
116
|
+
* Call this from the {@link PageEvent.Response | response} event to
|
|
117
|
+
* receive the body while it is still loading. If the body has already
|
|
118
|
+
* finished loading, the stream contains the whole body as a single chunk.
|
|
119
|
+
*
|
|
120
|
+
* @experimental
|
|
121
|
+
*/
|
|
122
|
+
abstract stream(): Promise<ReadableStream<Uint8Array>>;
|
|
123
|
+
|
|
96
124
|
/**
|
|
97
125
|
* {@inheritDoc HTTPResponse.content}
|
|
98
126
|
*/
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
import type {Protocol} from 'devtools-protocol';
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
|
-
concat,
|
|
11
10
|
distinctUntilChanged,
|
|
12
11
|
EMPTY,
|
|
13
12
|
filter,
|
|
@@ -16,14 +15,10 @@ import {
|
|
|
16
15
|
from,
|
|
17
16
|
map,
|
|
18
17
|
merge,
|
|
19
|
-
mergeMap,
|
|
20
|
-
mergeScan,
|
|
21
|
-
of,
|
|
22
18
|
raceWith,
|
|
23
19
|
ReplaySubject,
|
|
24
20
|
startWith,
|
|
25
21
|
switchMap,
|
|
26
|
-
take,
|
|
27
22
|
takeUntil,
|
|
28
23
|
timer,
|
|
29
24
|
type Observable,
|
|
@@ -180,6 +175,16 @@ export interface Metrics {
|
|
|
180
175
|
* Total JavaScript heap size, in bytes.
|
|
181
176
|
*/
|
|
182
177
|
JSHeapTotalSize?: number;
|
|
178
|
+
/**
|
|
179
|
+
* The timestamp when the DOMContentLoaded event was fired, in monotonic
|
|
180
|
+
* time (seconds since an arbitrary point in the past).
|
|
181
|
+
*/
|
|
182
|
+
DomContentLoaded?: number;
|
|
183
|
+
/**
|
|
184
|
+
* The timestamp when the navigation started, in monotonic time (seconds
|
|
185
|
+
* since an arbitrary point in the past).
|
|
186
|
+
*/
|
|
187
|
+
NavigationStart?: number;
|
|
183
188
|
}
|
|
184
189
|
|
|
185
190
|
/**
|
|
@@ -858,36 +863,37 @@ export abstract class Page extends EventEmitter<PageEvents> {
|
|
|
858
863
|
constructor(logger: Logger) {
|
|
859
864
|
super(undefined, logger);
|
|
860
865
|
this.logger = logger;
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
map(response => {
|
|
871
|
-
return response.request();
|
|
872
|
-
}),
|
|
873
|
-
),
|
|
874
|
-
).pipe(
|
|
875
|
-
filter(request => {
|
|
876
|
-
return request.id === originalRequest.id;
|
|
877
|
-
}),
|
|
878
|
-
take(1),
|
|
879
|
-
map(() => {
|
|
880
|
-
return -1;
|
|
881
|
-
}),
|
|
882
|
-
),
|
|
883
|
-
);
|
|
866
|
+
// Pending requests by id, so that each event is handled in O(1) instead of
|
|
867
|
+
// being checked against every request that is still in flight.
|
|
868
|
+
const pending = new Map<string, number>();
|
|
869
|
+
let inflight = 0;
|
|
870
|
+
merge(
|
|
871
|
+
fromEmitterEvent(this, PageEvent.Request).pipe(
|
|
872
|
+
map(request => {
|
|
873
|
+
pending.set(request.id, (pending.get(request.id) ?? 0) + 1);
|
|
874
|
+
return ++inflight;
|
|
884
875
|
}),
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
876
|
+
),
|
|
877
|
+
merge(
|
|
878
|
+
fromEmitterEvent(this, PageEvent.RequestFailed),
|
|
879
|
+
fromEmitterEvent(this, PageEvent.RequestFinished),
|
|
880
|
+
fromEmitterEvent(this, PageEvent.Response).pipe(
|
|
881
|
+
map(response => {
|
|
882
|
+
return response.request();
|
|
883
|
+
}),
|
|
884
|
+
),
|
|
885
|
+
).pipe(
|
|
886
|
+
filter(request => {
|
|
887
|
+
return pending.has(request.id);
|
|
888
|
+
}),
|
|
889
|
+
map(request => {
|
|
890
|
+
inflight -= pending.get(request.id) ?? 0;
|
|
891
|
+
pending.delete(request.id);
|
|
892
|
+
return inflight;
|
|
893
|
+
}),
|
|
894
|
+
),
|
|
895
|
+
)
|
|
896
|
+
.pipe(takeUntil(fromEmitterEvent(this, PageEvent.Close)), startWith(0))
|
|
891
897
|
.subscribe(this.#inflight$);
|
|
892
898
|
}
|
|
893
899
|
|
|
@@ -922,7 +928,10 @@ export abstract class Page extends EventEmitter<PageEvents> {
|
|
|
922
928
|
*/
|
|
923
929
|
override on<K extends keyof EventsWithWildcard<PageEvents>>(
|
|
924
930
|
type: K,
|
|
925
|
-
handler: (
|
|
931
|
+
handler: (
|
|
932
|
+
event: EventsWithWildcard<PageEvents>[K],
|
|
933
|
+
eventData: K extends '*' ? PageEvents[keyof PageEvents] : never,
|
|
934
|
+
) => void,
|
|
926
935
|
): this {
|
|
927
936
|
if (type !== PageEvent.Request) {
|
|
928
937
|
return super.on(type, handler);
|
|
@@ -933,7 +942,10 @@ export abstract class Page extends EventEmitter<PageEvents> {
|
|
|
933
942
|
if (wrapper === undefined) {
|
|
934
943
|
wrapper = (event: HTTPRequest) => {
|
|
935
944
|
event.enqueueInterceptAction(() => {
|
|
936
|
-
return handler(
|
|
945
|
+
return handler(
|
|
946
|
+
event as EventsWithWildcard<PageEvents>[K],
|
|
947
|
+
undefined as never,
|
|
948
|
+
);
|
|
937
949
|
});
|
|
938
950
|
};
|
|
939
951
|
this.#requestHandlers.set(
|
|
@@ -952,7 +964,10 @@ export abstract class Page extends EventEmitter<PageEvents> {
|
|
|
952
964
|
*/
|
|
953
965
|
override off<K extends keyof EventsWithWildcard<PageEvents>>(
|
|
954
966
|
type: K,
|
|
955
|
-
handler
|
|
967
|
+
handler?: (
|
|
968
|
+
event: EventsWithWildcard<PageEvents>[K],
|
|
969
|
+
eventData: K extends '*' ? PageEvents[keyof PageEvents] : never,
|
|
970
|
+
) => void,
|
|
956
971
|
): this {
|
|
957
972
|
if (type === PageEvent.Request) {
|
|
958
973
|
handler =
|
|
@@ -1868,6 +1883,12 @@ export abstract class Page extends EventEmitter<PageEvents> {
|
|
|
1868
1883
|
*
|
|
1869
1884
|
* - `JSHeapTotalSize` : Total JavaScript heap size, in bytes.
|
|
1870
1885
|
*
|
|
1886
|
+
* - `DomContentLoaded` : The timestamp when the DOMContentLoaded event was
|
|
1887
|
+
* fired, in monotonic time (seconds).
|
|
1888
|
+
*
|
|
1889
|
+
* - `NavigationStart` : The timestamp when the navigation started, in
|
|
1890
|
+
* monotonic time (seconds).
|
|
1891
|
+
*
|
|
1871
1892
|
* @remarks
|
|
1872
1893
|
* All timestamps are in monotonic time: monotonically increasing time
|
|
1873
1894
|
* in seconds since an arbitrary point in the past.
|
|
@@ -3041,7 +3062,11 @@ export abstract class Page extends EventEmitter<PageEvents> {
|
|
|
3041
3062
|
*
|
|
3042
3063
|
* To generate a PDF with the `screen` media type, call
|
|
3043
3064
|
* {@link Page.emulateMediaType | `page.emulateMediaType('screen')`} before
|
|
3044
|
-
* calling `page.pdf()`.
|
|
3065
|
+
* calling `page.pdf()`. Note that this disables `@media print` stylesheets,
|
|
3066
|
+
* which may cause layout issues on pages that rely on print styles for
|
|
3067
|
+
* pagination. Call
|
|
3068
|
+
* {@link Page.emulateMediaType | `page.emulateMediaType(null)`} to restore
|
|
3069
|
+
* the default `print` media type.
|
|
3045
3070
|
*
|
|
3046
3071
|
* By default, `page.pdf()` generates a pdf with modified colors for printing.
|
|
3047
3072
|
* Use the
|
|
@@ -3569,6 +3594,8 @@ export const supportedMetrics = new Set<string>([
|
|
|
3569
3594
|
'TaskDuration',
|
|
3570
3595
|
'JSHeapUsedSize',
|
|
3571
3596
|
'JSHeapTotalSize',
|
|
3597
|
+
'DomContentLoaded',
|
|
3598
|
+
'NavigationStart',
|
|
3572
3599
|
]);
|
|
3573
3600
|
|
|
3574
3601
|
/** @see https://w3c.github.io/webdriver-bidi/#normalize-rect */
|
|
@@ -33,7 +33,12 @@ import {
|
|
|
33
33
|
import {DEBUG_PREFIXES, type Logger} from '../../common/Debug.js';
|
|
34
34
|
import type {EventType} from '../../common/EventEmitter.js';
|
|
35
35
|
import {EventEmitter} from '../../common/EventEmitter.js';
|
|
36
|
-
import type {
|
|
36
|
+
import type {
|
|
37
|
+
Awaitable,
|
|
38
|
+
HandleFor,
|
|
39
|
+
InnerParams,
|
|
40
|
+
NodeFor,
|
|
41
|
+
} from '../../common/types.js';
|
|
37
42
|
import {fromAbortSignal, timeout} from '../../common/util.js';
|
|
38
43
|
import type {
|
|
39
44
|
BoundingBox,
|
|
@@ -793,10 +798,13 @@ export abstract class Locator<T> extends EventEmitter<LocatorEvents> {
|
|
|
793
798
|
*
|
|
794
799
|
* @public
|
|
795
800
|
*/
|
|
796
|
-
map<To
|
|
801
|
+
map<To, Args extends unknown[] = []>(
|
|
802
|
+
mapper: Mapper<T, To, Args>,
|
|
803
|
+
...args: Args
|
|
804
|
+
): Locator<To> {
|
|
797
805
|
return new MappedLocator(this._clone(), handle => {
|
|
798
806
|
// SAFETY: TypeScript cannot deduce the type.
|
|
799
|
-
return (handle as any).evaluateHandle(mapper);
|
|
807
|
+
return (handle as any).evaluateHandle(mapper, ...args);
|
|
800
808
|
});
|
|
801
809
|
}
|
|
802
810
|
|
|
@@ -807,12 +815,16 @@ export abstract class Locator<T> extends EventEmitter<LocatorEvents> {
|
|
|
807
815
|
*
|
|
808
816
|
* @public
|
|
809
817
|
*/
|
|
810
|
-
filter<S extends T
|
|
818
|
+
filter<S extends T, Args extends unknown[] = []>(
|
|
819
|
+
predicate: Predicate<T, S, Args>,
|
|
820
|
+
...args: Args
|
|
821
|
+
): Locator<S> {
|
|
811
822
|
return new FilteredLocator(this._clone(), async (handle, signal) => {
|
|
812
823
|
await (handle as ElementHandle<Node>).frame.waitForFunction(
|
|
813
824
|
predicate,
|
|
814
825
|
{signal, timeout: this._timeout},
|
|
815
826
|
handle,
|
|
827
|
+
...args,
|
|
816
828
|
);
|
|
817
829
|
return true;
|
|
818
830
|
});
|
|
@@ -933,8 +945,13 @@ export class FunctionLocator<T> extends Locator<T> {
|
|
|
933
945
|
/**
|
|
934
946
|
* @public
|
|
935
947
|
*/
|
|
936
|
-
export type Predicate<
|
|
937
|
-
|
|
948
|
+
export type Predicate<
|
|
949
|
+
From,
|
|
950
|
+
To extends From = From,
|
|
951
|
+
Args extends unknown[] = [],
|
|
952
|
+
> =
|
|
953
|
+
| ((value: From, ...args: InnerParams<Args>) => value is To)
|
|
954
|
+
| ((value: From, ...args: InnerParams<Args>) => Awaitable<boolean>);
|
|
938
955
|
/**
|
|
939
956
|
* @internal
|
|
940
957
|
*/
|
|
@@ -1063,7 +1080,10 @@ export class FilteredLocator<From, To extends From> extends DelegatedLocator<
|
|
|
1063
1080
|
/**
|
|
1064
1081
|
* @public
|
|
1065
1082
|
*/
|
|
1066
|
-
export type Mapper<From, To> = (
|
|
1083
|
+
export type Mapper<From, To, Args extends unknown[] = []> = (
|
|
1084
|
+
value: From,
|
|
1085
|
+
...args: InnerParams<Args>
|
|
1086
|
+
) => Awaitable<To>;
|
|
1067
1087
|
/**
|
|
1068
1088
|
* @internal
|
|
1069
1089
|
*/
|
|
@@ -28,6 +28,7 @@ import type {Target} from '../api/Target.js';
|
|
|
28
28
|
import type {Connection as CdpConnection} from '../cdp/Connection.js';
|
|
29
29
|
import type {SupportedWebDriverCapabilities} from '../common/ConnectOptions.js';
|
|
30
30
|
import {DEBUG_PREFIXES, type Logger} from '../common/Debug.js';
|
|
31
|
+
import type {DownloadBehavior} from '../common/DownloadBehavior.js';
|
|
31
32
|
import {ProtocolError, UnsupportedOperation} from '../common/Errors.js';
|
|
32
33
|
import {EventEmitter} from '../common/EventEmitter.js';
|
|
33
34
|
import type {Viewport} from '../common/Viewport.js';
|
|
@@ -37,7 +38,7 @@ import {BidiBrowserContext} from './BrowserContext.js';
|
|
|
37
38
|
import type {BidiConnection, CdpEvent} from './Connection.js';
|
|
38
39
|
import type {Browser as BrowserCore} from './core/Browser.js';
|
|
39
40
|
import {Session} from './core/Session.js';
|
|
40
|
-
import
|
|
41
|
+
import {UserContext} from './core/UserContext.js';
|
|
41
42
|
import {BidiBrowserTarget} from './Target.js';
|
|
42
43
|
|
|
43
44
|
/**
|
|
@@ -49,6 +50,7 @@ export interface BidiBrowserOptions {
|
|
|
49
50
|
connection: BidiConnection;
|
|
50
51
|
cdpConnection?: CdpConnection;
|
|
51
52
|
defaultViewport: Viewport | null;
|
|
53
|
+
downloadBehavior?: DownloadBehavior;
|
|
52
54
|
acceptInsecureCerts?: boolean;
|
|
53
55
|
capabilities?: SupportedWebDriverCapabilities;
|
|
54
56
|
networkEnabled: boolean;
|
|
@@ -102,6 +104,18 @@ export class BidiBrowser extends Browser {
|
|
|
102
104
|
},
|
|
103
105
|
});
|
|
104
106
|
|
|
107
|
+
// Console entries replayed from the WebDriver BiDi log event buffer on
|
|
108
|
+
// `session.subscribe`, arrive before any frame can listen to them.
|
|
109
|
+
// Collect them until the browser is initialized, so they can be re-emitted
|
|
110
|
+
// once the caller had a chance to add listeners.
|
|
111
|
+
const pendingConsoleEntries: Bidi.Log.Entry[] = [];
|
|
112
|
+
using sessionEmitter = new EventEmitter(session);
|
|
113
|
+
sessionEmitter.on('log.entryAdded', entry => {
|
|
114
|
+
if (entry.type === 'console') {
|
|
115
|
+
pendingConsoleEntries.push(entry);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
105
119
|
// Subscribe to all WebDriver BiDi events. Also subscribe to CDP events if CDP
|
|
106
120
|
// connection is available.
|
|
107
121
|
await session.subscribe(
|
|
@@ -143,11 +157,33 @@ export class BidiBrowser extends Browser {
|
|
|
143
157
|
|
|
144
158
|
const browser = new BidiBrowser(session.browser, opts, opts.logger);
|
|
145
159
|
browser.#initialize();
|
|
160
|
+
// From here on frames receive console entries directly, so stop
|
|
161
|
+
// collecting them to avoid delivering them twice.
|
|
162
|
+
sessionEmitter.removeAllListeners();
|
|
163
|
+
if (opts.downloadBehavior) {
|
|
164
|
+
await session.browser.setDownloadBehavior(opts.downloadBehavior, [
|
|
165
|
+
UserContext.DEFAULT,
|
|
166
|
+
]);
|
|
167
|
+
}
|
|
168
|
+
if (pendingConsoleEntries.length) {
|
|
169
|
+
// The caller's continuation after `await puppeteer.connect()` runs in
|
|
170
|
+
// microtasks, so listeners it adds synchronously are in place when this
|
|
171
|
+
// macrotask runs. The logs will be replayed at the first async task.
|
|
172
|
+
setTimeout(() => {
|
|
173
|
+
if (!browser.connected) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
for (const entry of pendingConsoleEntries) {
|
|
177
|
+
session.emit('log.entryAdded', entry);
|
|
178
|
+
}
|
|
179
|
+
}, 0);
|
|
180
|
+
}
|
|
146
181
|
return browser;
|
|
147
182
|
}
|
|
148
183
|
|
|
184
|
+
/** @internal */
|
|
149
185
|
@bubble()
|
|
150
|
-
accessor
|
|
186
|
+
accessor trustedEmitter = new EventEmitter<BrowserEvents>();
|
|
151
187
|
|
|
152
188
|
#process?: ChildProcess;
|
|
153
189
|
#closeCallback?: BrowserCloseCallback;
|
|
@@ -185,8 +221,8 @@ export class BidiBrowser extends Browser {
|
|
|
185
221
|
}
|
|
186
222
|
|
|
187
223
|
this.#browserCore.once('disconnected', () => {
|
|
188
|
-
this
|
|
189
|
-
this
|
|
224
|
+
this.trustedEmitter.emit(BrowserEvent.Disconnected, undefined);
|
|
225
|
+
this.trustedEmitter.removeAllListeners();
|
|
190
226
|
});
|
|
191
227
|
this.#process?.once('close', () => {
|
|
192
228
|
this.#browserCore.dispose('Browser process exited.', true);
|
|
@@ -227,19 +263,19 @@ export class BidiBrowser extends Browser {
|
|
|
227
263
|
browserContext.trustedEmitter.on(
|
|
228
264
|
BrowserContextEvent.TargetCreated,
|
|
229
265
|
target => {
|
|
230
|
-
this
|
|
266
|
+
this.trustedEmitter.emit(BrowserEvent.TargetCreated, target);
|
|
231
267
|
},
|
|
232
268
|
);
|
|
233
269
|
browserContext.trustedEmitter.on(
|
|
234
270
|
BrowserContextEvent.TargetChanged,
|
|
235
271
|
target => {
|
|
236
|
-
this
|
|
272
|
+
this.trustedEmitter.emit(BrowserEvent.TargetChanged, target);
|
|
237
273
|
},
|
|
238
274
|
);
|
|
239
275
|
browserContext.trustedEmitter.on(
|
|
240
276
|
BrowserContextEvent.TargetDestroyed,
|
|
241
277
|
target => {
|
|
242
|
-
this
|
|
278
|
+
this.trustedEmitter.emit(BrowserEvent.TargetDestroyed, target);
|
|
243
279
|
},
|
|
244
280
|
);
|
|
245
281
|
|
|
@@ -110,7 +110,11 @@ export class BidiConnection
|
|
|
110
110
|
type: Key,
|
|
111
111
|
event: EventsWithWildcard<BidiEvents>[Key],
|
|
112
112
|
): boolean {
|
|
113
|
-
if (
|
|
113
|
+
if (
|
|
114
|
+
process.env['PUPPETEER_WEBDRIVER_BIDI_ONLY'] === 'true' &&
|
|
115
|
+
typeof event === 'object' &&
|
|
116
|
+
event !== null
|
|
117
|
+
) {
|
|
114
118
|
// Required for WebDriver-only testing.
|
|
115
119
|
this.#toWebDriverOnlyEvent(event);
|
|
116
120
|
}
|