Recommended Free Tools
Use BrowserType.ConnectAsync() when the browser was started by Playwright and you have its Playwright WebSocket endpoint. Use Chromium.ConnectOverCDPAsync() to attach to an already-running Chromium-based browser that exposes Chrome DevTools Protocol (CDP), such as Chrome or Edge with remote debugging enabled. After connecting, inspect the existing contexts and pages; do not assume the browser has a tab ready or create a new one without checking.
Choose the connection method that matches the browser
These methods connect over different protocols and are not interchangeable. The key question is how the browser was started and which endpoint it exposes.
| Method | Use it when | Endpoint | Browser coverage and trade-off |
|---|---|---|---|
BrowserType.ConnectAsync() |
The browser was started by Playwright’s launchServer or is exposed by a Playwright Server. |
The Playwright WebSocket endpoint, such as the value returned by BrowserServer.wsEndpoint. |
Uses the Playwright protocol and has higher fidelity. The connecting and launching Playwright versions must match in major and minor version. |
Chromium.ConnectOverCDPAsync() |
An existing Chromium-based browser exposes Chrome DevTools Protocol. | A CDP HTTP endpoint, such as http://localhost:9222, or a browser WebSocket endpoint. |
Chromium-based browsers only. Playwright documents this connection as significantly lower fidelity than its Playwright protocol connection. |
Playwright’s .NET API reference says CDP attachment is supported only for Chromium-based browsers and has significantly lower fidelity than BrowserType.ConnectAsync() (Microsoft Playwright API reference). If you control the browser launch and need the fullest Playwright behavior, use the Playwright protocol route. If the browser is already running independently—for example, a desktop Chrome session—CDP may be the practical route, with those limitations in mind.
Connect to a Playwright browser server
This path requires a Playwright WebSocket endpoint. A .NET client cannot discover an arbitrary browser or turn a CDP URL into a Playwright endpoint. The endpoint may come from a Node.js BrowserServer.wsEndpoint value or a Playwright Server deployment. For example, Playwright’s Docker guide shows a server WebSocket endpoint used by a .NET client (Playwright Docker guide).
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Connect and inspect existing pages
using Microsoft.Playwright;
using var playwright = await Playwright.CreateAsync();
await using var browser = await playwright.Chromium.ConnectAsync("ws://127.0.0.1:3000/");
foreach (var context in browser.Contexts)
{
foreach (var page in context.Pages)
{
Console.WriteLine(page.Url);
}
}
Replace the example endpoint with the actual Playwright WebSocket URL for your server. The loop is deliberate: the server may expose more than one context or page. If your workflow expects a single page, choose it only after checking the available contexts and pages.
Version compatibility
The Playwright instance that connects and the instance that launched the browser must have matching major and minor versions. For example, Playwright 1.2.3 is compatible with 1.2.x under the documented rule; do not treat that example as a recommendation to use an old release. Check the installed .NET package version and the launcher/server version when connection fails with a protocol or compatibility error. See the API reference.
Attach to an existing Chrome, Edge, or other Chromium browser with CDP
Launch the browser with remote debugging enabled, then pass its CDP endpoint to ConnectOverCDPAsync(). The endpoint can be an HTTP URL such as http://localhost:9222 or a CDP browser WebSocket URL such as ws://127.0.0.1:9222/devtools/browser/<id>.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
using Microsoft.Playwright;
using var playwright = await Playwright.CreateAsync();
await using var browser = await playwright.Chromium.ConnectOverCDPAsync("http://localhost:9222");
if (browser.Contexts.Count == 0)
{
throw new InvalidOperationException("The connected browser has no contexts.");
}
var context = browser.Contexts[0];
if (context.Pages.Count == 0)
{
throw new InvalidOperationException("The selected context has no open pages.");
}
var page = context.Pages[0];
Console.WriteLine(page.Url);
Use browser.Contexts and context.Pages to inspect the attached session. The first context and first page are just a simple example; they may not be the right tab for your task. A connected browser can have no page in the context you select. Create a page only when your workflow calls for a new tab, rather than assuming attachment created one.
CDP is an interoperability path, not a full Playwright session
A browser started outside Playwright may use different launch arguments from Playwright’s curated defaults. The API documentation warns that this can leave some Playwright functionality broken after CDP attachment. Prefer a Playwright server connection when you need Playwright protocol fidelity; choose CDP when attachment to an existing Chromium session matters more than that guarantee. Firefox and WebKit cannot be attached through ConnectOverCDPAsync().
Connect Playwright .NET to WebView2
WebView2 needs to expose CDP before Playwright can attach. Configure a remote debugging port through WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS or through CoreWebView2EnvironmentOptions, wait until WebView2 initialization completes successfully, and then connect with Chromium.ConnectOverCDPAsync().
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
using Microsoft.Playwright;
// Run this after WebView2 has initialized successfully.
using var playwright = await Playwright.CreateAsync();
await using var browser = await playwright.Chromium.ConnectOverCDPAsync("http://localhost:9222");
var context = browser.Contexts[0];
foreach (var page in context.Pages)
{
Console.WriteLine(page.Url);
}
The code assumes the remote debugging endpoint is available and that at least one context exists; inspect the collections before indexing them in production. The WebView2 guide describes setting the debugging argument and using CoreWebView2InitializationCompleted as the readiness signal (Playwright WebView2 guide).
Keep parallel WebView2 processes separate
For parallel test processes, use a distinct WEBVIEW2_USER_DATA_FOLDER for each process so separate instances do not share profile data. Sharing profile data can interfere with concurrent runs; the WebView2 guide describes this setup along with the remote debugging configuration.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteUse the connected browser safely
Choose the right context and tab
- Inspect every available context if the target page is not in
browser.Contexts[0]. - Inspect page URLs before acting so automation does not operate on the wrong tab.
- If no page exists, create one only if your task calls for a new page and the attached browser permits it.
Understand disconnect and close behavior
Calling Browser.CloseAsync() on a connected browser disconnects from the browser server and clears contexts created by that connection. If you created contexts explicitly and need graceful page-close events, close those contexts first. Do not assume that closing a connected Playwright object is equivalent to shutting down an independently running browser. See the Browser API reference.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Troubleshoot connection failures
| Symptom | Likely cause | What to check or change |
|---|---|---|
ConnectAsync() cannot connect |
The URL is not a Playwright WebSocket endpoint, the server is not running, or the endpoint is unreachable. | Obtain the endpoint from the Playwright server or BrowserServer.wsEndpoint; check that the server is listening and reachable from the .NET process. |
ConnectOverCDPAsync() cannot connect |
Remote debugging is not enabled, the port is wrong, or the CDP endpoint is not reachable. | Start the Chromium browser with remote debugging enabled and use the corresponding HTTP or browser WebSocket endpoint. |
| Protocol or version error on Playwright connection | The client and browser-server Playwright versions do not match in major and minor version. | Align the launcher/server and .NET Playwright package versions, then reconnect. |
| CDP connection rejected or unsupported | The target is Firefox or WebKit, not Chromium-based. | Use a Chromium-based browser for CDP, or use a supported Playwright launch/server workflow for Firefox or WebKit. |
| No pages found after connecting | The selected context has no open tab, or the relevant page is in another context. | Inspect browser.Contexts and each context’s Pages; create a page only if appropriate. |
| WebView2 endpoint is unavailable | Attachment began before initialization completed or the debugging port was not configured. | Enable the remote debugging argument and wait for successful CoreWebView2InitializationCompleted before connecting. |
| Unexpected CDP behavior | CDP attachment has lower fidelity, and the browser may not have been launched with Playwright’s expected arguments. | Use a Playwright server endpoint with matching versions when the workflow depends on full Playwright protocol behavior. |
Or skip the browser setup
If your goal is to capture a website rather than automate an already-running browser session, ScreenshotNeo offers a one-request screenshot API and an MCP server for AI agents. Its cleanup can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers.
For example, save a screenshot of Stripe as WebP with cURL:
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, including full-page capture, element selection, device and viewport settings, PDF output, custom CSS and JavaScript, waits, request blocking, headers and cookies, caching, signed image links, async jobs, and bulk capture. ScreenshotNeo also provides take_screenshot, get_page_info, and capture_pdf through an MCP server for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Visit ScreenshotNeo to see the service, or sign up for 1,000 free screenshots a month with no card.
Frequently Asked Questions
Can Playwright for .NET attach to a browser that is already open?
Yes, when it exposes a compatible endpoint: use the Playwright WebSocket protocol for a Playwright-launched browser, or CDP for an existing Chromium-based browser.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Can I use ConnectOverCDPAsync with Firefox or WebKit?
No. CDP attachment is supported only for Chromium-based browsers.
Does connecting automatically open a new tab?
No. Inspect the connected contexts and their pages, then create a page only if your task requires one.
Quick Recap
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.

