[Question] Regarding CDP Session.
See original GitHub issueI am converting all my puppeteer code which used to look like this.
https://github.com/shirshak55/scrapper-tools/blob/master/src/fastPage/index.ts#L113
const session = await page.target().createCDPSession()
await session.send("Page.enable")
await session.send("Page.setWebLifecycleState", {
state: "active",
})
So we went to docs and saw this
const client = await page.context().newCDPSession(page);
But now i am seeing error on typescript like this
Property newCDPSession doesn't exists on type BrowserContext
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
The Comprehensive Guide to CDP Vendor Questioning
Short answer: Follow-up question for next meeting: Best contact person for more information: Ask about vendor staffing.
Read more >CDP workshops and webinars
Session #4: CDP Live: Top Tips for Submitting Your Questionnaire. To prepare companies ahead of their 2022 response to CDP, this session will...
Read more >CDP Session Type / Stauts documentation?
As to the explanation, feel free to ask specific question regarding the CDP session, we will be glad to clarify your queries.
Read more >Question about CDP showing different ports?
I've seen a couple of questions on the web in which there's two switches connected ... I have seen ports show up in...
Read more >CDP Live: 2022 CDP questionnaire changes on Vimeo
If you have any questions regarding the content of this session, please reach out to your CDP point of contact.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The page parameter is strange indeed, as is the requirement to cast to
ChromiumBrowserContext
. Since all 3 supported browsers use CDP, it’s unclear to me why thenewCDPSession()
method is not available in e.gFFBrowserContext
.Edit: I stand corrected, this is not true. See https://github.com/microsoft/playwright/issues/2484#issuecomment-652828709
Apologies @aslushnikov, I assumed Playwright (just like Puppeteer) used CDP for FF now that it’s built-in (and enabled in at least the nightly builds). But reading https://github.com/microsoft/playwright/issues/1765#issuecomment-613178363 that’s not the case until the CDP support in FF is more mature.