Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(mcp): accept Windows paths in browser_resume location (#43349)

Yury Semikhatsky7dcaa99d7148
diff --git a/packages/playwright-core/src/tools/backend/devtools.ts b/packages/playwright-core/src/tools/backend/devtools.ts
index ee35a90b20..c01d0121ae 100644
--- a/packages/playwright-core/src/tools/backend/devtools.ts
+++ b/packages/playwright-core/src/tools/backend/devtools.ts
@@ -55,7 +55,9 @@ const resume = defineTool({
});
if (params.location) {
- const [file, lineStr] = params.location.split(':');
+ // Split at the last colon, but not at the drive letter of a Windows path like "C:\tests\example.spec.ts".
+ const separator = params.location.lastIndexOf(':');
+ const [file, lineStr] = separator > 1 ? [params.location.slice(0, separator), params.location.slice(separator + 1)] : [params.location, ''];
let location;
if (lineStr) {
const line = Number(lineStr);