WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX matches a browser output line that begins exactly WebDriver BiDi listening on and captures the remaining text only if it starts with ws://. Puppeteer’s launcher uses capture group 1 as the base endpoint, then appends /session before opening the BiDi WebSocket connection. The regex is an internal implementation detail; for a release-specific issue, check the source shipped with that Puppeteer version.
What does WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX match?
The current Puppeteer main source defines it as:
export const WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX =
/^WebDriver BiDi listening on (ws://.*)$/;
Read the expression as a full-line pattern. The start anchor requires the label at the beginning; the end anchor requires the match to continue through the end of the line. The parenthesized part is capture group 1, which Puppeteer consumes as the endpoint value.
| # | Preview | Product | Price | |
|---|---|---|---|---|
| 1 |
|
Ultimate Selenium WebDriver for Test Automation: Build and Implement Automated Web Testing... | $37.95 | Buy on Amazon |
| 2 |
|
The C Programming Language | $9.80 | Buy on Amazon |
| 3 |
|
The SQL Programming Language: . | $4.23 | Buy on Amazon |
As an Amazon Associate I earn from qualifying purchases.
| Part | Meaning |
|---|---|
^ |
Start of the output line. |
WebDriver BiDi listening on |
Exact literal label, including its trailing space. |
(ws://.*) |
Capture group 1: text beginning with ws://, followed by the rest of the line. |
$ |
End of the output line. |
There are no flags. The pattern requires the lowercase ws:// prefix, so a line containing wss:// does not match this expression. Because .* is greedy, it accepts the remaining characters through the end of the line, including trailing text. This regex extracts text; it is not a URL parser or a complete URL validator, and its behavior should not be generalized to every browser’s endpoint output.
Recommended Free Tools
Why is Puppeteer waiting for “WebDriver BiDi listening on”?
The launch path uses the @puppeteer/browsers process helper to observe output lines, test them against a supplied regular expression, and resolve with match[1]. That makes the precise label and the first capture group significant: Puppeteer is looking for a particular browser log line, then extracting the endpoint portion rather than the whole line. See the current @puppeteer/browsers launch implementation.
#1 Best Overall
When the line never appears
If Puppeteer keeps waiting or times out, the browser process may not have emitted a line matching the expected prefix and scheme. Check the actual browser output, the selected protocol, and whether the Puppeteer and browser versions in use follow this launch path. A different label, scheme, or line format will not satisfy this exact pattern.
Why does Puppeteer append /session?
The regex captures the base endpoint from the process output; it does not add or interpret a session path. In the launcher, Puppeteer appends /session to the captured value and uses the resulting URL for its WebSocket transport and BiDi connection. The WebDriver BiDi specification describes constructing the WebSocket URI from the listener’s host, port, secure flag, and resource name; for a null session, that resource name is /session. Puppeteer’s corresponding launch behavior is visible in BrowserLauncher.ts.
Rank #2
How does this regex relate to Puppeteer’s BiDi support?
Puppeteer documents WebDriver BiDi automation with Chrome and Firefox. Its documented defaults differ: Firefox uses BiDi when launched, while Chrome uses CDP by default because not all CDP features are supported over BiDi. Chrome can explicitly select BiDi with protocol: 'webDriverBiDi'. The support documentation also lists APIs and capabilities that are unsupported over BiDi, including Page.createCDPSession(), selected emulations, coverage, tracing, accessibility, and some page and network methods. Check the BiDi support table for the version you use before switching protocols; an unsupported operation can raise UnsupportedOperation.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →This endpoint regex belongs to launch-time process-output discovery. It should not be treated as the universal rule for every Puppeteer WebSocket connection. The ConnectOptions reference documents browserWSEndpoint; BiDi capabilities are passed to session.new for protocol="webDriverBiDi" and Puppeteer.connect(). That explicit-connection configuration is distinct from discovering an endpoint from a browser process log.
Rank #3
- Used Book in Good Condition
How to troubleshoot a mismatch
- Inspect the exact output line. It must begin with the exact label and space shown in the regex, followed by a value starting
ws://. - Check the capture separately from the final URL. Group 1 is the base text after the label. The launcher, not the regex, appends
/session. - Confirm which connection path is running. This expression is used in a launcher output-waiting path; do not assume it handles an explicit
browserWSEndpointconnection. - Verify protocol and API support. Firefox and Chrome have different documented launch defaults, and not every CDP operation is available over BiDi. Consult the support table for your installed version.
- Compare versions rather than relying on
main. The cited repository links target the mutablemainbranch. For a release-specific failure, inspect that release’s source alongside the browser build and output format.
Or skip the browser setup
If your goal is capturing a webpage rather than debugging Puppeteer’s BiDi endpoint discovery, ScreenshotNeo offers a one-request screenshot API:
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. It removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo’s free plan.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




