Skip to content

[Bug]: connect_over_cdp() hangs after <ws connected> with Microsoft Edge 148 on Windows #41093

Closed as not planned

Description

Version

1.60.0

Steps to reproduce

Steps to Reproduce

import asyncio
from playwright.async_api import async_playwright

async def main():
    async with async_playwright() as p:
        browser = await p.chromium.connect_over_cdp("http://127.0.0.1:9222")
        print("connected")  # never reached
        await browser.close()

asyncio.run(main())

Expected behavior

connect_over_cdp() should connect successfully to Edge 148,
as it did with Edge 147.

Actual behavior

Description

After Microsoft Edge was updated to 148.0.3967.54 via Windows Update,
connect_over_cdp() hangs indefinitely and never returns.

Edge is launched with remote debugging enabled:

"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --remote-debugging-port=9222

Observed Behavior

The call log shows the WebSocket connection succeeds, but the call hangs
after <ws connected> and never resolves:

<ws preparing> retrieving websocket url from http://127.0.0.1:9222
<ws connecting> ws://127.0.0.1:9222/devtools/browser/xxxxxxxx-...
<ws connected>  ws://127.0.0.1:9222/devtools/browser/xxxxxxxx-...
(hangs here indefinitely)

Additional context

Investigation

To confirm that Edge's CDP endpoint itself is reachable, I verified:

  • http://127.0.0.1:9222/json returns valid JSON ✅
  • Connecting via raw websockets library and sending Browser.getVersion
    returns a valid response ✅

This suggests that Edge 148 may have changed its CDP initialization
sequence or response format in a way that is incompatible with
Playwright 1.60.0's handshake implementation. The connection succeeds
at the WebSocket level, but Playwright appears to hang waiting for
a response that does not arrive in the expected format.

The root cause — whether it lies in Edge's changed behavior or in
Playwright's handling of it — would need further investigation on the
Playwright side.

Additional Notes

  • Playwright 1.60.0 lists Edge 147 as its tested browser version.
    The Windows Update bumped Edge to 148, causing this version mismatch.
  • Downgrading Edge is not practical in a managed corporate environment.
  • A workaround using the raw websockets library with
    Target.attachToTarget confirms that CDP communication itself works
    correctly after the connection is established manually.

Environment

| | Version |
|---|---|
| Playwright Python | 1.60.0 |
| Node.js | v24.14.1 |
| Python | 3.12.13 (conda) |
| OS | Windows 11 22H2(Build 22631.7079) |
| Microsoft Edge | 148.0.3967.54 |

Activity

  1. Huaian666 commented on Jun 2, 2026

    @Huaian666
  2. yury-s commented on Jun 2, 2026

    @yury-s
    Member

    I reproduced this hang (on both 1.60.0 and main). It happens when any open tab has a navigation that started but never committed — connectOverCDP waits for every existing page to finish its first navigation, and a page stuck "waiting for response headers" blocks it forever.

    Edge 148 changed the new-tab page to load online content (edge://new-tab-page-online, from ntp.msn.com/assets.msn.com). A blocked load that errors is fine (it commits to an error page), but one that stalls — e.g. behind a corporate authenticating proxy that never returns headers — leaves the page uncommitted and hangs the connect.

    To confirm: when it hangs, what tabs/pages are open in Edge? Specifically, is there a new-tab page or any tab stuck loading (spinner)? Output of http://127.0.0.1:9222/json at that moment would help.

  3. yasuyukitera commented on Jun 3, 2026

    @yasuyukitera
    Author

    Yury Semikhatsky (@yury-s) Thank you for your reply!!
    Your reply gave me a clue to the solution.

    Actually, I had a lot of tabs open in Edge, and some of them were stuck due to loading errors or had gone into sleep mode. Once I reloaded all of them, the sample code I showed worked as well!!

    This gives us a temporary workaround for now. However, we’ll need to make sure the script users are aware that if the browser hangs, they should reload all Edge tabs.I don't think that can really be called a fundamental solution.But I don’t know if this might be resolved by an update to Playwright.😢😢😢

  4. yury-s commented on Jun 4, 2026

    @yury-s
    Member

    Actually, I had a lot of tabs open in Edge, and some of them were stuck due to loading errors or had gone into sleep mode. Once I reloaded all of them, the sample code I showed worked as well!!

    Thanks for the information. Would you be able to pin point which exact tab is causing the problem? Our theory was that it's a page that got stuck (i.e. no error, no success yet) on the initial navigation, but from what you describe it may well be something different.

  5. yury-s commented on Jun 16, 2026

    @yury-s
    Member

    Decided not to proceed with the fix for now. Since the bug disappeared after reloads and there is no reliable repro, let's see if there are more reports to justify the risky change.

  6. yasuyukitera commented on Jun 19, 2026

    @yasuyukitera
    Author

    Thank you for your assistance. We have decided to handle this manually (such as by closing tabs with loading errors).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions