chrome-devtools-frontend 1.0.1538523 → 1.0.1539728
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/eslint.config.mjs +1 -1
- package/front_end/core/protocol_client/CDPConnection.ts +12 -10
- package/front_end/core/protocol_client/InspectorBackend.ts +74 -101
- package/front_end/core/protocol_client/NodeURL.ts +1 -3
- package/front_end/core/sdk/ChildTargetManager.ts +5 -41
- package/front_end/core/sdk/Connections.ts +9 -58
- package/front_end/core/sdk/DOMModel.ts +1 -0
- package/front_end/core/sdk/RehydratingConnection.ts +1 -1
- package/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts +15 -26
- package/front_end/entrypoints/node_app/{NodeConnectionsPanel.ts → app/NodeConnectionsPanel.ts} +8 -8
- package/front_end/entrypoints/node_app/{NodeMain.ts → app/NodeMain.ts} +11 -11
- package/front_end/entrypoints/node_app/app/app.ts +6 -0
- package/front_end/entrypoints/node_app/node_app.ts +4 -2
- package/front_end/generated/{InspectorBackendCommands.js → InspectorBackendCommands.ts} +16 -34
- package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +18 -3
- package/front_end/models/trace/types/TraceEvents.ts +19 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +49 -26
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -1
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +1 -134
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +170 -0
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +4 -4
- package/front_end/panels/ai_assistance/components/chatView.css +0 -31
- package/front_end/panels/ai_assistance/components/disabledWidget.css +45 -0
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/application/components/FrameDetailsView.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +123 -95
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
- package/front_end/panels/elements/NodeStackTraceWidget.ts +8 -2
- package/front_end/panels/explain/components/ConsoleInsight.ts +0 -1
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +57 -33
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +12 -5
- package/front_end/panels/network/RequestInitiatorView.ts +1 -1
- package/front_end/panels/network/components/EditableSpan.ts +1 -1
- package/front_end/panels/recorder/components/StepView.ts +1 -1
- package/front_end/panels/recorder/models/RecordingPlayer.ts +8 -7
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +4 -4
- package/front_end/panels/timeline/TimelineFlameChartView.ts +10 -10
- package/front_end/panels/timeline/TimelinePanel.ts +3 -3
- package/front_end/panels/timeline/TimelineUIUtils.ts +21 -24
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +3 -2
- package/front_end/panels/utils/utils.ts +4 -2
- package/front_end/services/puppeteer/PuppeteerConnection.ts +56 -53
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +26 -9
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +11 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +9 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.js +11 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +10 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +9 -3
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +37 -18
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +26 -9
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +11 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +9 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.js +11 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +10 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +9 -3
- package/front_end/third_party/puppeteer/package/package.json +3 -3
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +4 -2
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserConnector.ts +8 -1
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +34 -10
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +13 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +8 -2
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/CdpSession.ts +2 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Connection.ts +15 -1
- package/front_end/third_party/puppeteer/package/src/common/CallbackRegistry.ts +7 -5
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +8 -0
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +22 -1
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/switch/Switch.docs.ts +38 -0
- package/front_end/ui/components/tooltips/Tooltip.ts +69 -45
- package/front_end/ui/legacy/Slider.docs.ts +49 -0
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +77 -5
- package/front_end/ui/legacy/components/utils/Linkifier.ts +62 -3
- package/front_end/ui/visual_logging/KnownContextValues.ts +8 -0
- package/package.json +1 -1
- package/front_end/third_party/puppeteer/package/src/templates/version.ts.tmpl +0 -4
- package/front_end/ui/components/docs/color_swatch/basic.html +0 -32
- package/front_end/ui/components/docs/color_swatch/basic.ts +0 -38
- package/front_end/ui/components/docs/color_swatch/change-color.html +0 -24
- package/front_end/ui/components/docs/color_swatch/change-color.ts +0 -28
- package/front_end/ui/components/docs/computed_style_property/basic.html +0 -25
- package/front_end/ui/components/docs/computed_style_property/basic.ts +0 -19
- package/front_end/ui/components/docs/computed_style_property/traceable.html +0 -25
- package/front_end/ui/components/docs/computed_style_property/traceable.ts +0 -16
- package/front_end/ui/components/docs/computed_style_trace/basic.html +0 -25
- package/front_end/ui/components/docs/computed_style_trace/basic.ts +0 -24
- package/front_end/ui/components/docs/console_insight/basic.html +0 -28
- package/front_end/ui/components/docs/console_insight/basic.ts +0 -103
- package/front_end/ui/components/docs/console_insight/error.html +0 -28
- package/front_end/ui/components/docs/console_insight/error.ts +0 -33
- package/front_end/ui/components/docs/console_insight/loading.html +0 -28
- package/front_end/ui/components/docs/console_insight/loading.ts +0 -47
- package/front_end/ui/components/docs/elements_breadcrumbs/basic.html +0 -43
- package/front_end/ui/components/docs/elements_breadcrumbs/basic.ts +0 -54
- package/front_end/ui/components/docs/elements_breadcrumbs/helpers.ts +0 -29
- package/front_end/ui/components/docs/elements_breadcrumbs/scroll-to-active-element.html +0 -38
- package/front_end/ui/components/docs/elements_breadcrumbs/scroll-to-active-element.ts +0 -90
- package/front_end/ui/components/docs/elements_breadcrumbs/scroll.html +0 -29
- package/front_end/ui/components/docs/elements_breadcrumbs/scroll.ts +0 -62
- package/front_end/ui/components/docs/icon_button/basic.html +0 -34
- package/front_end/ui/components/docs/icon_button/basic.ts +0 -67
- package/front_end/ui/components/docs/issue_counter/basic.html +0 -35
- package/front_end/ui/components/docs/issue_counter/basic.ts +0 -34
- package/front_end/ui/components/docs/issue_link_icon/basic.html +0 -31
- package/front_end/ui/components/docs/issue_link_icon/basic.ts +0 -26
- package/front_end/ui/components/docs/linear_memory_inspector/basic.html +0 -26
- package/front_end/ui/components/docs/linear_memory_inspector/basic.ts +0 -44
- package/front_end/ui/components/docs/menu/basic.html +0 -28
- package/front_end/ui/components/docs/menu/basic.ts +0 -66
- package/front_end/ui/components/docs/recorder_control_button/basic.html +0 -20
- package/front_end/ui/components/docs/recorder_control_button/basic.ts +0 -15
- package/front_end/ui/components/docs/recorder_recording_list_view/basic.html +0 -20
- package/front_end/ui/components/docs/recorder_recording_list_view/basic.ts +0 -26
- package/front_end/ui/components/docs/recorder_select_button/basic.html +0 -20
- package/front_end/ui/components/docs/recorder_select_button/basic.ts +0 -81
- package/front_end/ui/components/docs/recorder_split_view/basic.html +0 -17
- package/front_end/ui/components/docs/recorder_split_view/basic.ts +0 -22
- package/front_end/ui/components/docs/request_link_icon/basic.html +0 -31
- package/front_end/ui/components/docs/request_link_icon/basic.ts +0 -21
- package/front_end/ui/components/docs/slider/basic.ts +0 -62
- package/front_end/ui/components/docs/style_property_editor/flex.html +0 -21
- package/front_end/ui/components/docs/style_property_editor/flex.ts +0 -52
- package/front_end/ui/components/docs/style_property_editor/grid.html +0 -22
- package/front_end/ui/components/docs/style_property_editor/grid.ts +0 -50
- package/front_end/ui/components/docs/style_property_editor/masonry.html +0 -21
- package/front_end/ui/components/docs/style_property_editor/masonry.ts +0 -50
- package/front_end/ui/components/docs/switch/basic.ts +0 -51
- /package/front_end/entrypoints/node_app/{nodeConnectionsPanel.css → app/nodeConnectionsPanel.css} +0 -0
|
@@ -12,6 +12,7 @@ import { CdpBrowser } from '../cdp/Browser.js';
|
|
|
12
12
|
import { Connection } from '../cdp/Connection.js';
|
|
13
13
|
import { TimeoutError } from '../common/Errors.js';
|
|
14
14
|
import { debugError, DEFAULT_VIEWPORT } from '../common/util.js';
|
|
15
|
+
import { createIncrementalIdGenerator, } from '../util/incremental-id-generator.js';
|
|
15
16
|
import { NodeWebSocketTransport as WebSocketTransport } from './NodeWebSocketTransport.js';
|
|
16
17
|
import { PipeTransport } from './PipeTransport.js';
|
|
17
18
|
/**
|
|
@@ -36,7 +37,7 @@ export class BrowserLauncher {
|
|
|
36
37
|
return this.#browser;
|
|
37
38
|
}
|
|
38
39
|
async launch(options = {}) {
|
|
39
|
-
const { dumpio = false, enableExtensions = false, env = process.env, handleSIGINT = true, handleSIGTERM = true, handleSIGHUP = true, acceptInsecureCerts = false, networkEnabled = true, defaultViewport = DEFAULT_VIEWPORT, downloadBehavior, slowMo = 0, timeout = 30000, waitForInitialPage = true, protocolTimeout, handleDevToolsAsPage, } = options;
|
|
40
|
+
const { dumpio = false, enableExtensions = false, env = process.env, handleSIGINT = true, handleSIGTERM = true, handleSIGHUP = true, acceptInsecureCerts = false, networkEnabled = true, defaultViewport = DEFAULT_VIEWPORT, downloadBehavior, slowMo = 0, timeout = 30000, waitForInitialPage = true, protocolTimeout, handleDevToolsAsPage, idGenerator = createIncrementalIdGenerator(), } = options;
|
|
40
41
|
let { protocol } = options;
|
|
41
42
|
// Default to 'webDriverBiDi' for Firefox.
|
|
42
43
|
if (this.#browser === 'firefox' && protocol === undefined) {
|
|
@@ -93,6 +94,7 @@ export class BrowserLauncher {
|
|
|
93
94
|
defaultViewport,
|
|
94
95
|
acceptInsecureCerts,
|
|
95
96
|
networkEnabled,
|
|
97
|
+
idGenerator,
|
|
96
98
|
});
|
|
97
99
|
}
|
|
98
100
|
else {
|
|
@@ -101,6 +103,7 @@ export class BrowserLauncher {
|
|
|
101
103
|
timeout,
|
|
102
104
|
protocolTimeout,
|
|
103
105
|
slowMo,
|
|
106
|
+
idGenerator,
|
|
104
107
|
});
|
|
105
108
|
}
|
|
106
109
|
else {
|
|
@@ -108,6 +111,7 @@ export class BrowserLauncher {
|
|
|
108
111
|
timeout,
|
|
109
112
|
protocolTimeout,
|
|
110
113
|
slowMo,
|
|
114
|
+
idGenerator,
|
|
111
115
|
});
|
|
112
116
|
}
|
|
113
117
|
if (protocol === 'webDriverBiDi') {
|
|
@@ -198,7 +202,8 @@ export class BrowserLauncher {
|
|
|
198
202
|
async createCdpSocketConnection(browserProcess, opts) {
|
|
199
203
|
const browserWSEndpoint = await browserProcess.waitForLineOutput(CDP_WEBSOCKET_ENDPOINT_REGEX, opts.timeout);
|
|
200
204
|
const transport = await WebSocketTransport.create(browserWSEndpoint);
|
|
201
|
-
return new Connection(browserWSEndpoint, transport, opts.slowMo, opts.protocolTimeout
|
|
205
|
+
return new Connection(browserWSEndpoint, transport, opts.slowMo, opts.protocolTimeout,
|
|
206
|
+
/* rawErrors */ false, opts.idGenerator);
|
|
202
207
|
}
|
|
203
208
|
/**
|
|
204
209
|
* @internal
|
|
@@ -208,7 +213,8 @@ export class BrowserLauncher {
|
|
|
208
213
|
// 4th and 5th items to stdio array
|
|
209
214
|
const { 3: pipeWrite, 4: pipeRead } = browserProcess.nodeProcess.stdio;
|
|
210
215
|
const transport = new PipeTransport(pipeWrite, pipeRead);
|
|
211
|
-
return new Connection('', transport, opts.slowMo, opts.protocolTimeout
|
|
216
|
+
return new Connection('', transport, opts.slowMo, opts.protocolTimeout,
|
|
217
|
+
/* rawErrors */ false, opts.idGenerator);
|
|
212
218
|
}
|
|
213
219
|
/**
|
|
214
220
|
* @internal
|
|
@@ -236,7 +242,7 @@ export class BrowserLauncher {
|
|
|
236
242
|
const browserWSEndpoint = (await browserProcess.waitForLineOutput(WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX, opts.timeout)) + '/session';
|
|
237
243
|
const transport = await WebSocketTransport.create(browserWSEndpoint);
|
|
238
244
|
const BiDi = await import(/* webpackIgnore: true */ '../bidi/bidi.js');
|
|
239
|
-
const bidiConnection = new BiDi.BidiConnection(browserWSEndpoint, transport, opts.slowMo, opts.protocolTimeout);
|
|
245
|
+
const bidiConnection = new BiDi.BidiConnection(browserWSEndpoint, transport, opts.idGenerator, opts.slowMo, opts.protocolTimeout);
|
|
240
246
|
return await BiDi.BidiBrowser.create({
|
|
241
247
|
connection: bidiConnection,
|
|
242
248
|
closeCallback,
|
package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserLauncher.js","sourceRoot":"","sources":["../../../../src/node/BrowserLauncher.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,EAAC,MAAM,EAAC,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B,OAAO,EACL,OAAO,IAAI,gBAAgB,EAC3B,4BAA4B,EAC5B,MAAM,EACN,YAAY,IAAI,oBAAoB,EACpC,uCAAuC,EACvC,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,cAAc,EACd,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,GACN,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EA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B,CAAC,MAAM,CAAC;QACjC,CAAC;QAED,MAAM,WAAW,GAAG,kCAAkC,CACpD,IAAI,CAAC,OAAO,EACZ,QAAQ,CACT,CAAC;QAEF,cAAc,GAAG,qBAAqB,CAAC;YACrC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,mBAAoB;YAC7C,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc;SACvC,CAAC,CAAC;QAEH,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;YAChD,MAAM,aAAa,GACjB,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;YACxD,IAAI,aAAa,EAAE,CAAC;gBAClB,MAAM,IAAI,KAAK,CACb,qDAAqD,cAAc,iBAAiB,aAAa,gCAAgC,CAClI,CAAC;YACJ,CAAC;YACD,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;gBACrB,KAAK,QAAQ;oBACX,MAAM,IAAI,KAAK,CACb,+BAA+B,IAAI,CAAC,SAAS,CAAC,cAAc,+BAA+B;wBACzF,4GAA4G,WAAW,UAAU;wBACjI,4DAA4D,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,MAAM;wBAC7G,iGAAiG,CACpG,CAAC;gBACJ,KAAK,SAAS;oBACZ,MAAM,IAAI,KAAK,CACb,gCAAgC,IAAI,CAAC,SAAS,CAAC,cAAc,+BAA+B;wBAC1F,oIAAoI;wBACpI,4DAA4D,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,MAAM;wBAC7G,iGAAiG,CACpG,CAAC;YACN,CAAC;QACH,CAAC;QACD,OAAO,cAAc,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -291,10 +291,12 @@ export declare abstract class Browser extends EventEmitter<BrowserEvents> {
|
|
|
291
291
|
* returns all {@link Page | pages} in all
|
|
292
292
|
* {@link BrowserContext | browser contexts}.
|
|
293
293
|
*
|
|
294
|
+
* @param includeAll - experimental, setting to true includes all kinds of pages.
|
|
295
|
+
*
|
|
294
296
|
* @remarks Non-visible {@link Page | pages}, such as `"background_page"`,
|
|
295
297
|
* will not be listed here. You can find them using {@link Target.page}.
|
|
296
298
|
*/
|
|
297
|
-
pages(): Promise<Page[]>;
|
|
299
|
+
pages(includeAll?: boolean): Promise<Page[]>;
|
|
298
300
|
/**
|
|
299
301
|
* Gets a string representing this {@link Browser | browser's} name and
|
|
300
302
|
* version.
|
|
@@ -470,10 +472,12 @@ export declare abstract class BrowserContext extends EventEmitter<BrowserContext
|
|
|
470
472
|
* Gets a list of all open {@link Page | pages} inside this
|
|
471
473
|
* {@link BrowserContext | browser context}.
|
|
472
474
|
*
|
|
475
|
+
* @param includeAll - experimental, setting to true includes all kinds of pages.
|
|
476
|
+
*
|
|
473
477
|
* @remarks Non-visible {@link Page | pages}, such as `"background_page"`,
|
|
474
478
|
* will not be listed here. You can find them using {@link Target.page}.
|
|
475
479
|
*/
|
|
476
|
-
abstract pages(): Promise<Page[]>;
|
|
480
|
+
abstract pages(includeAll?: boolean): Promise<Page[]>;
|
|
477
481
|
/**
|
|
478
482
|
* Grants this {@link BrowserContext | browser context} the given
|
|
479
483
|
* `permissions` within the given `origin`.
|
|
@@ -984,13 +988,14 @@ connect: (options: Puppeteer_2.ConnectOptions) => Promise<Puppeteer_2.Browser>;
|
|
|
984
988
|
*/
|
|
985
989
|
export declare class Connection extends EventEmitter<CDPSessionEvents> {
|
|
986
990
|
#private;
|
|
987
|
-
constructor(url: string, transport: ConnectionTransport, delay?: number, timeout?: number, rawErrors?: boolean);
|
|
991
|
+
constructor(url: string, transport: ConnectionTransport, delay?: number, timeout?: number, rawErrors?: boolean, idGenerator?: () => number);
|
|
988
992
|
static fromSession(session: CDPSession): Connection | undefined;
|
|
989
993
|
|
|
990
994
|
get timeout(): number;
|
|
991
995
|
|
|
992
996
|
|
|
993
997
|
|
|
998
|
+
|
|
994
999
|
/**
|
|
995
1000
|
* @param sessionId - The session id
|
|
996
1001
|
* @returns The current CDP session if it exists
|
|
@@ -1103,6 +1108,7 @@ export declare interface ConnectOptions {
|
|
|
1103
1108
|
browserWSEndpoint?: string;
|
|
1104
1109
|
browserURL?: string;
|
|
1105
1110
|
transport?: ConnectionTransport;
|
|
1111
|
+
|
|
1106
1112
|
/**
|
|
1107
1113
|
* Headers to use for the web socket connection.
|
|
1108
1114
|
* @remarks
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "puppeteer-core",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.28.0",
|
|
4
4
|
"description": "A high-level API to control headless Chrome over the DevTools Protocol",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"puppeteer",
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"author": "The Chromium Authors",
|
|
150
150
|
"license": "Apache-2.0",
|
|
151
151
|
"dependencies": {
|
|
152
|
-
"@puppeteer/browsers": "2.10.
|
|
152
|
+
"@puppeteer/browsers": "2.10.13",
|
|
153
153
|
"chromium-bidi": "10.5.1",
|
|
154
154
|
"debug": "^4.4.3",
|
|
155
155
|
"devtools-protocol": "0.0.1521046",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"ws": "^8.18.3"
|
|
159
159
|
},
|
|
160
160
|
"devDependencies": {
|
|
161
|
-
"@types/chrome": "0.1.
|
|
161
|
+
"@types/chrome": "0.1.27",
|
|
162
162
|
"@types/debug": "4.1.12",
|
|
163
163
|
"@types/node": "^18.17.15",
|
|
164
164
|
"@types/ws": "8.18.1",
|
|
@@ -392,13 +392,15 @@ export abstract class Browser extends EventEmitter<BrowserEvents> {
|
|
|
392
392
|
* returns all {@link Page | pages} in all
|
|
393
393
|
* {@link BrowserContext | browser contexts}.
|
|
394
394
|
*
|
|
395
|
+
* @param includeAll - experimental, setting to true includes all kinds of pages.
|
|
396
|
+
*
|
|
395
397
|
* @remarks Non-visible {@link Page | pages}, such as `"background_page"`,
|
|
396
398
|
* will not be listed here. You can find them using {@link Target.page}.
|
|
397
399
|
*/
|
|
398
|
-
async pages(): Promise<Page[]> {
|
|
400
|
+
async pages(includeAll = false): Promise<Page[]> {
|
|
399
401
|
const contextPages = await Promise.all(
|
|
400
402
|
this.browserContexts().map(context => {
|
|
401
|
-
return context.pages();
|
|
403
|
+
return context.pages(includeAll);
|
|
402
404
|
}),
|
|
403
405
|
);
|
|
404
406
|
// Flatten array.
|
|
@@ -186,10 +186,12 @@ export abstract class BrowserContext extends EventEmitter<BrowserContextEvents>
|
|
|
186
186
|
* Gets a list of all open {@link Page | pages} inside this
|
|
187
187
|
* {@link BrowserContext | browser context}.
|
|
188
188
|
*
|
|
189
|
+
* @param includeAll - experimental, setting to true includes all kinds of pages.
|
|
190
|
+
*
|
|
189
191
|
* @remarks Non-visible {@link Page | pages}, such as `"background_page"`,
|
|
190
192
|
* will not be listed here. You can find them using {@link Target.page}.
|
|
191
193
|
*/
|
|
192
|
-
abstract pages(): Promise<Page[]>;
|
|
194
|
+
abstract pages(includeAll?: boolean): Promise<Page[]>;
|
|
193
195
|
|
|
194
196
|
/**
|
|
195
197
|
* Grants this {@link BrowserContext | browser context} the given
|
|
@@ -10,6 +10,7 @@ import type {ConnectionTransport} from '../common/ConnectionTransport.js';
|
|
|
10
10
|
import type {ConnectOptions} from '../common/ConnectOptions.js';
|
|
11
11
|
import {ProtocolError, UnsupportedOperation} from '../common/Errors.js';
|
|
12
12
|
import {debugError, DEFAULT_VIEWPORT} from '../common/util.js';
|
|
13
|
+
import {createIncrementalIdGenerator} from '../util/incremental-id-generator.js';
|
|
13
14
|
|
|
14
15
|
import type {BidiBrowser} from './Browser.js';
|
|
15
16
|
import type {BidiConnection} from './Connection.js';
|
|
@@ -66,12 +67,17 @@ async function getBiDiConnection(
|
|
|
66
67
|
closeCallback: BrowserCloseCallback;
|
|
67
68
|
}> {
|
|
68
69
|
const BiDi = await import(/* webpackIgnore: true */ './bidi.js');
|
|
69
|
-
const {
|
|
70
|
+
const {
|
|
71
|
+
slowMo = 0,
|
|
72
|
+
protocolTimeout,
|
|
73
|
+
idGenerator = createIncrementalIdGenerator(),
|
|
74
|
+
} = options;
|
|
70
75
|
|
|
71
76
|
// Try pure BiDi first.
|
|
72
77
|
const pureBidiConnection = new BiDi.BidiConnection(
|
|
73
78
|
url,
|
|
74
79
|
connectionTransport,
|
|
80
|
+
idGenerator,
|
|
75
81
|
slowMo,
|
|
76
82
|
protocolTimeout,
|
|
77
83
|
);
|
|
@@ -102,6 +108,7 @@ async function getBiDiConnection(
|
|
|
102
108
|
slowMo,
|
|
103
109
|
protocolTimeout,
|
|
104
110
|
/* rawErrors= */ true,
|
|
111
|
+
idGenerator,
|
|
105
112
|
);
|
|
106
113
|
|
|
107
114
|
const version = await cdpConnection.send('Browser.getVersion');
|
|
@@ -224,7 +224,7 @@ export class BidiBrowserContext extends BrowserContext {
|
|
|
224
224
|
return this.#browser;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
override async pages(): Promise<BidiPage[]> {
|
|
227
|
+
override async pages(_includeAll = false): Promise<BidiPage[]> {
|
|
228
228
|
return [...this.userContext.browsingContexts].map(context => {
|
|
229
229
|
return this.#pages.get(context)!;
|
|
230
230
|
});
|
|
@@ -14,6 +14,7 @@ import {ConnectionClosedError} from '../common/Errors.js';
|
|
|
14
14
|
import type {EventsWithWildcard} from '../common/EventEmitter.js';
|
|
15
15
|
import {EventEmitter} from '../common/EventEmitter.js';
|
|
16
16
|
import {debugError} from '../common/util.js';
|
|
17
|
+
import type {GetIdFn} from '../util/incremental-id-generator.js';
|
|
17
18
|
|
|
18
19
|
import {BidiCdpSession} from './CDPSession.js';
|
|
19
20
|
import type {
|
|
@@ -57,12 +58,13 @@ export class BidiConnection
|
|
|
57
58
|
#delay: number;
|
|
58
59
|
#timeout = 0;
|
|
59
60
|
#closed = false;
|
|
60
|
-
#callbacks
|
|
61
|
+
#callbacks: CallbackRegistry;
|
|
61
62
|
#emitters: Array<EventEmitter<any>> = [];
|
|
62
63
|
|
|
63
64
|
constructor(
|
|
64
65
|
url: string,
|
|
65
66
|
transport: ConnectionTransport,
|
|
67
|
+
idGenerator: GetIdFn,
|
|
66
68
|
delay = 0,
|
|
67
69
|
timeout?: number,
|
|
68
70
|
) {
|
|
@@ -70,6 +72,7 @@ export class BidiConnection
|
|
|
70
72
|
this.#url = url;
|
|
71
73
|
this.#delay = delay;
|
|
72
74
|
this.#timeout = timeout ?? 180_000;
|
|
75
|
+
this.#callbacks = new CallbackRegistry(idGenerator);
|
|
73
76
|
|
|
74
77
|
this.#transport = transport;
|
|
75
78
|
this.#transport.onmessage = this.onMessage.bind(this);
|
|
@@ -432,18 +432,42 @@ export class BidiPage extends Page {
|
|
|
432
432
|
|
|
433
433
|
override async setViewport(viewport: Viewport | null): Promise<void> {
|
|
434
434
|
if (!this.browser().cdpSupported) {
|
|
435
|
-
|
|
436
|
-
viewport
|
|
437
|
-
|
|
435
|
+
const viewportSize =
|
|
436
|
+
viewport?.width && viewport?.height
|
|
437
|
+
? {
|
|
438
|
+
width: viewport.width,
|
|
439
|
+
height: viewport.height,
|
|
440
|
+
}
|
|
441
|
+
: null;
|
|
442
|
+
|
|
443
|
+
const devicePixelRatio = viewport?.deviceScaleFactor
|
|
444
|
+
? viewport.deviceScaleFactor
|
|
445
|
+
: null;
|
|
446
|
+
|
|
447
|
+
// If `viewport` is not set, remove screen orientation override.
|
|
448
|
+
const screenOrientation: Bidi.Emulation.ScreenOrientation | null =
|
|
449
|
+
viewport
|
|
450
|
+
? viewport.isLandscape
|
|
438
451
|
? {
|
|
439
|
-
|
|
440
|
-
|
|
452
|
+
natural: Bidi.Emulation.ScreenOrientationNatural.Landscape,
|
|
453
|
+
type: 'landscape-primary',
|
|
441
454
|
}
|
|
442
|
-
:
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
455
|
+
: {
|
|
456
|
+
natural: Bidi.Emulation.ScreenOrientationNatural.Portrait,
|
|
457
|
+
type: 'portrait-primary',
|
|
458
|
+
}
|
|
459
|
+
: null;
|
|
460
|
+
|
|
461
|
+
await Promise.all([
|
|
462
|
+
this.#frame.browsingContext.setViewport({
|
|
463
|
+
viewport: viewportSize,
|
|
464
|
+
devicePixelRatio,
|
|
465
|
+
}),
|
|
466
|
+
this.#frame.browsingContext.setScreenOrientationOverride(
|
|
467
|
+
screenOrientation,
|
|
468
|
+
),
|
|
469
|
+
]);
|
|
470
|
+
|
|
447
471
|
this.#viewport = viewport;
|
|
448
472
|
return;
|
|
449
473
|
}
|
|
@@ -601,6 +601,19 @@ export class BrowsingContext extends EventEmitter<{
|
|
|
601
601
|
);
|
|
602
602
|
}
|
|
603
603
|
|
|
604
|
+
@throwIfDisposed<BrowsingContext>(context => {
|
|
605
|
+
// SAFETY: Disposal implies this exists.
|
|
606
|
+
return context.#reason!;
|
|
607
|
+
})
|
|
608
|
+
async setScreenOrientationOverride(
|
|
609
|
+
screenOrientation: Bidi.Emulation.ScreenOrientation | null,
|
|
610
|
+
): Promise<void> {
|
|
611
|
+
await this.#session.send('emulation.setScreenOrientationOverride', {
|
|
612
|
+
screenOrientation,
|
|
613
|
+
contexts: [this.id],
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
|
|
604
617
|
@throwIfDisposed<BrowsingContext>(context => {
|
|
605
618
|
// SAFETY: Disposal implies this exists.
|
|
606
619
|
return context.#reason!;
|
|
@@ -8,6 +8,7 @@ import type {Protocol} from 'devtools-protocol';
|
|
|
8
8
|
|
|
9
9
|
import type {ElementHandle} from '../api/ElementHandle.js';
|
|
10
10
|
import type {Realm} from '../api/Realm.js';
|
|
11
|
+
import {debugError} from '../common/util.js';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Represents a Node and the properties of it that are relevant to Accessibility.
|
|
@@ -238,8 +239,13 @@ export class Accessibility {
|
|
|
238
239
|
if (!frame) {
|
|
239
240
|
return;
|
|
240
241
|
}
|
|
241
|
-
|
|
242
|
-
|
|
242
|
+
try {
|
|
243
|
+
const iframeSnapshot = await frame.accessibility.snapshot(options);
|
|
244
|
+
root.iframeSnapshot = iframeSnapshot ?? undefined;
|
|
245
|
+
} catch (error) {
|
|
246
|
+
// Frames can get detached at any time resulting in errors.
|
|
247
|
+
debugError(error);
|
|
248
|
+
}
|
|
243
249
|
}
|
|
244
250
|
for (const child of root.children) {
|
|
245
251
|
await populateIframes(child);
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import type {ConnectionTransport} from '../common/ConnectionTransport.js';
|
|
8
8
|
import type {ConnectOptions} from '../common/ConnectOptions.js';
|
|
9
9
|
import {debugError, DEFAULT_VIEWPORT} from '../common/util.js';
|
|
10
|
+
import {createIncrementalIdGenerator} from '../util/incremental-id-generator.js';
|
|
10
11
|
|
|
11
12
|
import {CdpBrowser} from './Browser.js';
|
|
12
13
|
import {Connection} from './Connection.js';
|
|
@@ -32,6 +33,7 @@ export async function _connectToCdpBrowser(
|
|
|
32
33
|
slowMo = 0,
|
|
33
34
|
protocolTimeout,
|
|
34
35
|
handleDevToolsAsPage,
|
|
36
|
+
idGenerator = createIncrementalIdGenerator(),
|
|
35
37
|
} = options;
|
|
36
38
|
|
|
37
39
|
const connection = new Connection(
|
|
@@ -39,6 +41,8 @@ export async function _connectToCdpBrowser(
|
|
|
39
41
|
connectionTransport,
|
|
40
42
|
slowMo,
|
|
41
43
|
protocolTimeout,
|
|
44
|
+
/* rawErrors */ false,
|
|
45
|
+
idGenerator,
|
|
42
46
|
);
|
|
43
47
|
|
|
44
48
|
const {browserContextIds} = await connection.send(
|
|
@@ -45,13 +45,13 @@ export class CdpBrowserContext extends BrowserContext {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
override async pages(): Promise<Page[]> {
|
|
48
|
+
override async pages(includeAll = false): Promise<Page[]> {
|
|
49
49
|
const pages = await Promise.all(
|
|
50
50
|
this.targets()
|
|
51
51
|
.filter(target => {
|
|
52
52
|
return (
|
|
53
53
|
target.type() === 'page' ||
|
|
54
|
-
(target.type() === 'other' &&
|
|
54
|
+
((target.type() === 'other' || includeAll) &&
|
|
55
55
|
this.#browser._getIsPageTargetCallback()?.(target))
|
|
56
56
|
);
|
|
57
57
|
})
|
|
@@ -27,7 +27,7 @@ import type {CdpTarget} from './Target.js';
|
|
|
27
27
|
export class CdpCDPSession extends CDPSession {
|
|
28
28
|
#sessionId: string;
|
|
29
29
|
#targetType: string;
|
|
30
|
-
#callbacks
|
|
30
|
+
#callbacks: CallbackRegistry;
|
|
31
31
|
#connection: Connection;
|
|
32
32
|
#parentSessionId?: string;
|
|
33
33
|
#target?: CdpTarget;
|
|
@@ -46,6 +46,7 @@ export class CdpCDPSession extends CDPSession {
|
|
|
46
46
|
super();
|
|
47
47
|
this.#connection = connection;
|
|
48
48
|
this.#targetType = targetType;
|
|
49
|
+
this.#callbacks = new CallbackRegistry(connection._idGenerator);
|
|
49
50
|
this.#sessionId = sessionId;
|
|
50
51
|
this.#parentSessionId = parentSessionId;
|
|
51
52
|
this.#rawErrors = rawErrors;
|
|
@@ -19,6 +19,10 @@ import {debug} from '../common/Debug.js';
|
|
|
19
19
|
import {ConnectionClosedError, TargetCloseError} from '../common/Errors.js';
|
|
20
20
|
import {EventEmitter} from '../common/EventEmitter.js';
|
|
21
21
|
import {createProtocolErrorMessage} from '../util/ErrorLike.js';
|
|
22
|
+
import {
|
|
23
|
+
createIncrementalIdGenerator,
|
|
24
|
+
type GetIdFn,
|
|
25
|
+
} from '../util/incremental-id-generator.js';
|
|
22
26
|
|
|
23
27
|
import {CdpCDPSession} from './CdpSession.js';
|
|
24
28
|
|
|
@@ -38,6 +42,7 @@ export class Connection extends EventEmitter<CDPSessionEvents> {
|
|
|
38
42
|
#manuallyAttached = new Set<string>();
|
|
39
43
|
#callbacks: CallbackRegistry;
|
|
40
44
|
#rawErrors = false;
|
|
45
|
+
#idGenerator: GetIdFn;
|
|
41
46
|
|
|
42
47
|
constructor(
|
|
43
48
|
url: string,
|
|
@@ -45,10 +50,12 @@ export class Connection extends EventEmitter<CDPSessionEvents> {
|
|
|
45
50
|
delay = 0,
|
|
46
51
|
timeout?: number,
|
|
47
52
|
rawErrors = false,
|
|
53
|
+
idGenerator: () => number = createIncrementalIdGenerator(),
|
|
48
54
|
) {
|
|
49
55
|
super();
|
|
50
56
|
this.#rawErrors = rawErrors;
|
|
51
|
-
this.#
|
|
57
|
+
this.#idGenerator = idGenerator;
|
|
58
|
+
this.#callbacks = new CallbackRegistry(idGenerator);
|
|
52
59
|
this.#url = url;
|
|
53
60
|
this.#delay = delay;
|
|
54
61
|
this.#timeout = timeout ?? 180_000;
|
|
@@ -80,6 +87,13 @@ export class Connection extends EventEmitter<CDPSessionEvents> {
|
|
|
80
87
|
return this.#closed;
|
|
81
88
|
}
|
|
82
89
|
|
|
90
|
+
/**
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
get _idGenerator(): GetIdFn {
|
|
94
|
+
return this.#idGenerator;
|
|
95
|
+
}
|
|
96
|
+
|
|
83
97
|
/**
|
|
84
98
|
* @internal
|
|
85
99
|
*/
|
|
@@ -6,21 +6,23 @@
|
|
|
6
6
|
|
|
7
7
|
import {Deferred} from '../util/Deferred.js';
|
|
8
8
|
import {rewriteError} from '../util/ErrorLike.js';
|
|
9
|
-
import {
|
|
9
|
+
import type {GetIdFn} from '../util/incremental-id-generator.js';
|
|
10
10
|
|
|
11
11
|
import {ProtocolError, TargetCloseError} from './Errors.js';
|
|
12
12
|
import {debugError} from './util.js';
|
|
13
13
|
|
|
14
|
-
const idGenerator = createIncrementalIdGenerator();
|
|
15
|
-
|
|
16
14
|
/**
|
|
17
15
|
* Manages callbacks and their IDs for the protocol request/response communication.
|
|
18
16
|
*
|
|
19
17
|
* @internal
|
|
20
18
|
*/
|
|
21
19
|
export class CallbackRegistry {
|
|
22
|
-
#callbacks = new Map<number, Callback>();
|
|
23
|
-
#idGenerator
|
|
20
|
+
readonly #callbacks = new Map<number, Callback>();
|
|
21
|
+
readonly #idGenerator: GetIdFn;
|
|
22
|
+
|
|
23
|
+
constructor(idGenerator: GetIdFn) {
|
|
24
|
+
this.#idGenerator = idGenerator;
|
|
25
|
+
}
|
|
24
26
|
|
|
25
27
|
create(
|
|
26
28
|
label: string,
|
|
@@ -112,6 +112,14 @@ export interface ConnectOptions {
|
|
|
112
112
|
browserWSEndpoint?: string;
|
|
113
113
|
browserURL?: string;
|
|
114
114
|
transport?: ConnectionTransport;
|
|
115
|
+
/**
|
|
116
|
+
* @internal
|
|
117
|
+
*
|
|
118
|
+
* Custom ID generator for CDP / BiDi messages. Useful if the same transport
|
|
119
|
+
* is shared for multiple connections.
|
|
120
|
+
*/
|
|
121
|
+
idGenerator?: () => number;
|
|
122
|
+
|
|
115
123
|
/**
|
|
116
124
|
* Headers to use for the web socket connection.
|
|
117
125
|
* @remarks
|