Skip to content

feat(chromium): attach to a running browser with a remote-debugging:// or extension:// URL - #44247

Merged
Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:extension-url
Nov 20, 2026
Merged

Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:extension-url

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • connectOverCDP('extension://chrome/Profile 1') starts the CDP relay in the server and connects to the tabs that the user shares through the Playwright Extension in that profile. The other options of the connection are x-playwright-extension-* headers.
  • connectOverCDP('remote-debugging://msedge?userDataDir=...') connects to a browser with remote debugging enabled. A bare channel name such as chrome still works.
  • The MCP server (--cdp-endpoint) and the CLI (attach --cdp) take the same URLs, and list --all prints the URL of each browser and profile.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

…/ or extension:// URL

- `connectOverCDP('extension://chrome/Profile 1')` starts the CDP relay in the
  server and connects to the tabs that the user shares through the Playwright
  Extension in that profile. The other options of the connection are
  `x-playwright-extension-*` headers.
- `connectOverCDP('remote-debugging://msedge?userDataDir=...')` connects to a
  browser with remote debugging enabled.
- The MCP server (`--cdp-endpoint`) and the CLI (`attach --cdp`) take the same
  URLs, and `list --all` prints the URL of each browser and profile.
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

5250 passed, 644 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

Warning

The triggering workflow run ended with status cancelled. Results below may be incomplete — blob reports from cancelled or timed-out shards are missing, so passing/failing counts do not reflect the full test suite.

1 flaky ⚠️ [firefox-page] › page/page-event-pageerror.spec.ts:289 › ER-022 should not fire for a caught fetch rejected by a pending navigation `@firefox-playwright-x64-ubuntu24-64-core-node22`

23604 passed, 708 skipped


Merge workflow run.

lines.push(` - profile-dir: ${path.join(session.userDataDir, profile.dirName)}`);
if (profile.extensionInstalled)
lines.push(` - attach (extension): \`playwright-cli attach --extension=${session.channel} --profile-dir-name="${profile.dirName}"\``);
lines.push(` - attach (extension): \`playwright-cli attach --cdp="extension://${session.channel}/${profile.dirName}"\``);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attach --cdp="extension:// - why not just attach <url> ?

@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 99d4c41 into microsoft:main Nov 20, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants