Summary
When I attach to an already-open Edge tab via playwright-cli open --extension and select that tab in Edge, the session partially works:
tab-list, snapshot, console, and network work
eval hangs
- input-style commands like
hover hang
If I immediately run goto <current-url> after attach, eval and hover start working on that same session.
This looks like the selected existing tab is attached with a usable utility world, but not a usable main world, until the first Playwright-driven navigation.
Environment
@playwright/cli: 1.59.0-alpha-1771104257000
- Node:
v25.8.1
- OS: Arch Linux on WSL2
- Browser: Microsoft Edge on Windows, launched from WSL with:
PLAYWRIGHT_MCP_EXECUTABLE_PATH="/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
CLI repro
- Run:
export PLAYWRIGHT_MCP_EXECUTABLE_PATH="/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
playwright-cli open --extension --browser=msedge
- In Edge, choose an already-open regular web page tab to attach to.
- Run:
playwright-cli tab-list
playwright-cli snapshot
playwright-cli eval "() => document.title"
playwright-cli hover <some-ref-from-snapshot>
Actual behavior
tab-list works
snapshot works
eval hangs / times out
hover hangs
Expected behavior
After selecting an existing tab, eval and DOM interaction commands should work without needing a forced navigation first.
Workaround
If I run:
playwright-cli goto <the-current-tab-url>
then both of these start working:
playwright-cli eval "() => document.title"
playwright-cli hover <some-ref-from-snapshot>
This reloads the page, so it is only a partial workaround.
Lower-level repro
Using Playwright's internal extension attach path directly, I can reproduce the same split:
page.title() works immediately after attach
page.evaluate(() => document.title) times out immediately after attach
- after
await page.goto(page.url()), page.evaluate(() => document.title) works
I also found that direct Playwright locator.hover() can succeed before the navigation, which suggests there may be two related problems:
- The attached existing tab does not have a usable main-world execution context until first Playwright navigation.
playwright-cli input-style commands appear to hang because their post-action completion path depends on page.evaluate(...).
Notes
Related but not exact matches:
Summary
When I attach to an already-open Edge tab via
playwright-cli open --extensionand select that tab in Edge, the session partially works:tab-list,snapshot,console, andnetworkworkevalhangshoverhangIf I immediately run
goto <current-url>after attach,evalandhoverstart working on that same session.This looks like the selected existing tab is attached with a usable utility world, but not a usable main world, until the first Playwright-driven navigation.
Environment
@playwright/cli:1.59.0-alpha-1771104257000v25.8.1PLAYWRIGHT_MCP_EXECUTABLE_PATH="/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"CLI repro
Actual behavior
tab-listworkssnapshotworksevalhangs / times outhoverhangsExpected behavior
After selecting an existing tab,
evaland DOM interaction commands should work without needing a forced navigation first.Workaround
If I run:
then both of these start working:
This reloads the page, so it is only a partial workaround.
Lower-level repro
Using Playwright's internal extension attach path directly, I can reproduce the same split:
page.title()works immediately after attachpage.evaluate(() => document.title)times out immediately after attachawait page.goto(page.url()),page.evaluate(() => document.title)worksI also found that direct Playwright
locator.hover()can succeed before the navigation, which suggests there may be two related problems:playwright-cliinput-style commands appear to hang because their post-action completion path depends onpage.evaluate(...).Notes
Related but not exact matches: