Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

Puppeteer WebDriver BiDi WebSocket Endpoint Regex Explained

Puppeteer’s BiDi endpoint regex matches a specific browser log prefix and captures its ws:// suffix. Here is what that means, why /session is appended, and how to debug mismatches.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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
The SQL Programming Language: .
  • Used Book in Good Condition
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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 browserWSEndpoint connection.
  • 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 mutable main branch. 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:

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.