question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Regarding CDP Session.

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Niekcommented, Jul 2, 2020

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 the newCDPSession() method is not available in e.g FFBrowserContext.

Edit: I stand corrected, this is not true. See https://github.com/microsoft/playwright/issues/2484#issuecomment-652828709

0reactions
Niekcommented, Jul 2, 2020
  • Juggler

Since all 3 supported browsers use CDP

@Niek this is not actually the case.

  • In Chromium we rely on CDP
  • In WebKit we rely on “Web Inspector Remote Debugging Protocol”
  • In Firefox we rely on “Juggler” protocol

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found