豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

chore: change puppeteer/devtools connection adapter#602

Merged
szuend merged 1 commit intomainfrom
cdp-connection-puppeteer
Nov 24, 2025
Merged

chore: change puppeteer/devtools connection adapter#602
szuend merged 1 commit intomainfrom
cdp-connection-puppeteer

Conversation

@szuend
Copy link
Copy Markdown
Contributor

@szuend szuend commented Nov 24, 2025

Rather then adapting on the transport layer, we adapt the puppeteer CDPSession/Connection and make them look like a CDPConnection. The class assumes that callers create a dedicated CDPSession to be used.

The PuppeteerDevToolsConnection installs a generic '*' event listener on all child sessions to funnel all CDP events into DevTools via CDPConnectionObservers. As pointed out in the code comment, we don't need to recursively listen to 'sessionattached' events on child sessions: Nested sessionattached events are reported on all parent sessions.

While not strictly necessary, PuppeteerDevToolsConnection also uninstalls the CDP event listener when a session gets detached (modulo the root puppeteer CDPSession).

@szuend szuend force-pushed the cdp-connection-puppeteer branch from 9c74255 to 911344e Compare November 24, 2025 10:06
@szuend szuend requested a review from OrKoN November 24, 2025 10:06
@szuend szuend enabled auto-merge (squash) November 24, 2025 10:25
@szuend szuend force-pushed the cdp-connection-puppeteer branch from 911344e to 88ebcfa Compare November 24, 2025 10:26
@szuend szuend merged commit eea5b80 into main Nov 24, 2025
20 checks passed
@szuend szuend deleted the cdp-connection-puppeteer branch November 24, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants