Puppeteer (BiDi)
Use Lightpanda with Puppeteer over WebDriver BiDi instead of the Chrome DevTools Protocol (CDP). Puppeteer’s public API is the same either way; only the connection changes.
More examples in demo/puppeteer/bidi .
⚠️
BiDi support is new and covers less than CDP: only browsingContext and a subset of script are implemented. page.waitForSelector, page.waitForFunction, and page.click(selector) don’t work as a result. See the demo above for the polling and coordinate-click workarounds.
Start Lightpanda with the webdriver protocol enabled (find all options in the serve command reference):
lightpanda serve --host 127.0.0.1 --port 9222 --protocol webdriverConnect Puppeteer to the /session path with protocol: 'webDriverBiDi':
'use strict'
import puppeteer from 'puppeteer-core'
const browser = await puppeteer.connect({
browserWSEndpoint: 'ws://127.0.0.1:9222/session',
protocol: 'webDriverBiDi',
})
const context = await browser.createBrowserContext()
const page = await context.newPage()
await page.goto('https://wikipedia.com/', { waitUntil: 'load' })
const title = await page.title()
console.log(title)
await page.close()
await context.close()
await browser.disconnect()