You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On WSL2, playwright-cli attach --extension=<browser> cannot discover the Playwright Extension running in a Windows Chrome/Edge, and the config that does work relies on undocumented environment variables (there are no CLI flags for it). This is a WSL host/guest split: the CLI runs in the Linux guest, but the only browser with the extension installed is the Windows host browser.
1. Misleading failure with the documented flags
Running exactly what the docs describe (extension installed in Windows Chrome, token from the extension status page):
Error: Playwright Extension not found in "/home/<user>/.config/google-chrome".
Install it from https://chromewebstore.google.com/detail/playwright-extension/mmlmfjhmonkocbjadbfplnigmagldckm
at createExtensionBrowser (.../playwright-core/lib/coreBundle.js)
at async createBrowserWithInfo (...)
Error: Daemon pid=<pid>: Daemon process exited with code 1
The extension is installed — just in the Windows Chrome profile, not the Linux profile ~/.config/google-chrome that the CLI checks. The error message is misleading: it tells the user to install an extension that is already installed, and gives no hint that a Windows profile / host browser is involved.
2. The working configuration requires undocumented env vars
attach only exposes --cdp, --endpoint, --extension, --config, --session (per playwright-cli --help attach). There is no--executable-path and no--user-data-dir flag. The only way to point it at the Windows browser is via env vars that aren't documented for this flow:
PWTEST_EXTENSION_USER_DATA_DIR looks like an internal test variable, yet it is the only knob that makes the extension flow work on WSL. If it is the supported mechanism, it should be documented (and ideally surfaced as a proper --user-data-dir flag on attach). If not, there should be a supported flag.
On WSL2, attach --extension should be able to target a Windows host browser without relying on PWTEST_* env vars — e.g. via documented --executable-path / --user-data-dir flags on attach.
When the extension genuinely can't be found, the error should mention which profile/path was checked and note the WSL host-browser case, rather than unconditionally telling the user to install an already-installed extension.
Environment
OS: Windows 11 + WSL2 (Linux 6.6.87.2-microsoft-standard-WSL2)
Browser with extension: Windows Chrome, Playwright Extension installed
Node: v24.14.1, npx 11.11.0
Note on package naming (separate, minor)
npx playwright-cli (the bare package name) resolves to playwright-cli@0.262.0 / playwright-core@1.59.0-alpha-*, which has no attach command at all (Unknown command: attach) — yet its bundled SKILL.md documents attach --extension. The actively maintained CLI is @playwright/cli@0.1.17. Users following the skills docs with the bare playwright-cli package hit a dead end. Consider deprecating/redirecting the playwright-cli npm package to @playwright/cli.
What's going on
On WSL2,
playwright-cli attach --extension=<browser>cannot discover the Playwright Extension running in a Windows Chrome/Edge, and the config that does work relies on undocumented environment variables (there are no CLI flags for it). This is a WSL host/guest split: the CLI runs in the Linux guest, but the only browser with the extension installed is the Windows host browser.1. Misleading failure with the documented flags
Running exactly what the docs describe (extension installed in Windows Chrome, token from the extension status page):
fails with:
The extension is installed — just in the Windows Chrome profile, not the Linux profile
~/.config/google-chromethat the CLI checks. The error message is misleading: it tells the user to install an extension that is already installed, and gives no hint that a Windows profile / host browser is involved.2. The working configuration requires undocumented env vars
attachonly exposes--cdp,--endpoint,--extension,--config,--session(perplaywright-cli --help attach). There is no--executable-pathand no--user-data-dirflag. The only way to point it at the Windows browser is via env vars that aren't documented for this flow:With these set, it works correctly:
Two problems here:
PWTEST_EXTENSION_USER_DATA_DIRlooks like an internal test variable, yet it is the only knob that makes the extension flow work on WSL. If it is the supported mechanism, it should be documented (and ideally surfaced as a proper--user-data-dirflag onattach). If not, there should be a supported flag.ws://127.0.0.1:...), so the earlier IPv6 issue [Bug]: WSL extension relay emits IPv6 loopback URL unreachable from Windows Edge #41180 appears fixed. This report is about the earlier extension-discovery step, not the relay URL.Expected behavior
attach --extensionshould be able to target a Windows host browser without relying onPWTEST_*env vars — e.g. via documented--executable-path/--user-data-dirflags onattach.Environment
Linux 6.6.87.2-microsoft-standard-WSL2)Note on package naming (separate, minor)
npx playwright-cli(the bare package name) resolves toplaywright-cli@0.262.0/playwright-core@1.59.0-alpha-*, which has noattachcommand at all (Unknown command: attach) — yet its bundledSKILL.mddocumentsattach --extension. The actively maintained CLI is@playwright/cli@0.1.17. Users following the skills docs with the bareplaywright-clipackage hit a dead end. Consider deprecating/redirecting theplaywright-clinpm package to@playwright/cli.