Skip to content

[Bug]:connect_over_cdp fails on QtWebEngine with “Browser context management is not supported” #36961

Description

@amin-hv

Version

1.54

Steps to reproduce

When attaching Playwright to a PyQt5 QWebEngineView (QtWebEngine) via CDP, the initial Browser.setDownloadBehavior RPC always errors out because QtWebEngine’s DevTools server doesn’t implement it. As a result chromium.connect_over_cdp(wsUrl) immediately aborts with:
Protocol error (Browser.setDownloadBehavior): Browser context management is not supported.

Steps to reproduce:

  1. Launch a PyQt5 app with QTWEBENGINE_REMOTE_DEBUGGING=9222 and load one or more pages in QWebEngineView.

  2. From Python, call:

browser = await playwright.chromium.connect_over_cdp("ws://127.0.0.1:9222/devtools/page/<id>")

  1. Observe the above error and no attached Page objects.

Expected behavior

Playwright should skip unsupported CDP methods (like Browser.setDownloadBehavior) on attach when the server doesn’t support them, or expose an option to disable download/context management on connect.

Actual behavior

When calling await playwright.chromium.connect_over_cdp(wsUrl), Playwright immediately sends a Browser.setDownloadBehavior CDP command, which QtWebEngine rejects. The attach call then fails with:

Protocol error (Browser.setDownloadBehavior): Browser context management is not supported.
No Page objects are returned and all subsequent automation is aborted.

Additional context

Environment

▶ Playwright version: Version 1.54.0
▶ Python version: Python 3.10.18
▶ PyQt5 version: Version: 5.15.11
▶ Qt version: QMake version 3.1
▶ OS release: Ubuntu 24.04.2 LTS

Activity

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