Skip to content

[Feature]: allow to switch off 'setDownloadBehavior' for chromium #35131

Closed as not planned

Description

🚀 Feature Request

Is there a chance to add env variable PW_CHROMIUM_DISABLE_DOWNLOAD_BEHAVIOR to crBrowser file ? mainly because 'setDownloadBehavior' isn't supported in some electron versions and CEF as well here is previous discussion #10927

Example

if (his._browser.options.name !== 'clank' && this._options.acceptDownloads !== 'internal-browser-default' && !process.env.PW_CHROMIUM_DISABLE_DOWNLOAD_BEHAVIOR) {
      promises.push(this._browser._session.send('Browser.setDownloadBehavior', {
        behavior: this._options.acceptDownloads === 'accept' ? 'allowAndName' : 'deny',
        browserContextId: this._browserContextId,
        downloadPath: this._browser.options.downloadsPath,
        eventsEnabled: true,
      }));
}

Motivation

it'll be supporting CDP connections to some electron versions and CEF versions

Activity

  1. changed the title [-][Feature]:[/-] [+][Feature]: add env variable PW_CHROMIUM_DISABLE_DOWNLOAD_BEHAVIOR to crBrowser file[/+] on Mar 10, 2025
  2. changed the title [-][Feature]: add env variable PW_CHROMIUM_DISABLE_DOWNLOAD_BEHAVIOR to crBrowser file[/-] [+][Feature]: allow to switch off 'setDownloadBehavior' for chromium[/+] on Mar 10, 2025
  3. mxschmitt commented on Mar 10, 2025

    @mxschmitt
    Contributor

    Whats your CEF version? They removed the old alloy mode last year. See chromiumembedded/cef#3684 and chromiumembedded/cef#3685. The new default CEF mode supports Playwright out of the box.

  4. udarrr commented on Mar 16, 2025

    @udarrr
    Author

    The new default CEF mode supports Playwright out of the box.

    confirm with process.env.PW_CHROMIUM_ATTACH_TO_OTHER = '1'; it's working with the latest

    but it's available partly since v125 and fully since v128, and there are some still supporting applications with electron's chrome below v128 on board where cdp connection is being used for testing, i my case it's still v116

  5. mxschmitt commented on Mar 17, 2025

    @mxschmitt
    Contributor

    We support Electron v12+. I don’t think we want to support older CEF versions. Highly recommend updating. This also gives you the latest security and performance updates!

  6. udarrr commented on Mar 17, 2025

    @udarrr
    Author

    We support Electron v12+. I don’t think we want to support older CEF versions. Highly recommend updating. This also gives you the latest security and performance updates!

    Hence it's not true Max Schmitt (@mxschmitt)

    Supported Electron versions are:
    v12.2.0+
    v13.4.0+
    v14+

    but electron with chrome v116 is v26.0.0 and affected all version till to electron v32.0.0

  7. mxschmitt commented on Mar 17, 2025

    @mxschmitt
    Contributor
  8. udarrr commented on Mar 17, 2025

    @udarrr
    Author

    We run our tests on Electron v30 and they are passing: https://github.com/microsoft/playwright/actions/runs/13854611069/job/38768602175 - what are we doing different?

    instead of accessing to electron code directly, i'm using cdp connection with --remote-debugging-port for connection to already being build instance of electron app, cause it's black box testing

  9. mxschmitt commented on Mar 17, 2025

    @mxschmitt
    Contributor

    This is unsupported. We only support controlling Electron launched via Playwright.

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