Skip to content

[Bug]: Chrome Beta (139+) does not support loading extensions with browser flags #36459

Closed

Description

Version

1.153.1

Steps to reproduce

Run the current playwright extension tests against the chrome-beta channel and observe that the extension is never loaded into the browser.

Expected behavior

The extension is loaded in the chrome-beta browser.

Actual behavior

The extension is not loaded in the chrome-beta browser.

Additional context

The announcement that deprecates the browser feature flags here:
https://support.google.com/chrome/a/answer/7679408?hl=en&co=CHROME_ENTERPRISE._Product%3DChromeBrowser
Discussed here as well:
https://groups.google.com/a/chromium.org/g/chromium-extensions/c/1-g8EFx2BBY/m/S0ET5wPjCAAJ
https://groups.google.com/a/chromium.org/g/chromium-extensions/c/aEHdhDZ-V0E/m/UWP4-k32AgAJ

Is there another way to load extensions for playwright testing? Will we need to switch over to chrome for testing? It doesn't seem like it is currently supported by playwright and not currently planned: #23694

Environment

System:
    OS: macOS 15.5
    CPU: (12) arm64 Apple M2 Max
    Memory: 86.38 MB / 32.00 GB
  Binaries:
    Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
  Languages:
    Bash: 3.2.57 - /bin/bash

Activity

  1. fungairino commented on Jun 26, 2025

    @fungairino
    Author

    I would also recommend updating the documentation to reflect that extensions cannot be loaded in chrome.

    Extensions only work in Chrome / Chromium launched with a persistent context. Use custom browser args at your own risk, as some of them may break Playwright functionality.

  2. mxschmitt commented on Jun 27, 2025

    @mxschmitt
    Contributor

    Would channel: 'chromium' work for you?

  3. fungairino commented on Jun 27, 2025

    @fungairino
    Author

    We switched over to 'chromium' for now, but it does not give us the same level of confidence. We would like to continue testing against the same browser that our users are using to make sure that we catch any potential regressions in our changes, but also to catch any new ones that might be coming down the line from chrome itself before it starts impacting our users. Browser extensions are still in a pretty volatile space, so we want to be able to catch any browser-specific issues before our users do.

  4. fungairino commented on Jul 7, 2025

    @fungairino
    Author

    I'm not sure the documentation update fixed the issue as described, Max Schmitt (@mxschmitt) ?

    The documentation in the PR still states:

    Extensions only work in Chrome / Chromium launched with a persistent context.

    Loading extensions in Chrome no longer works due to them dropping the feature flag support. Can playwright at least update the documentation to reflect this?

  5. cjlanzo commented on Jul 18, 2025

    @cjlanzo

    Eduardo Fungairino (@fungairino) I am having the same problem as you, where our chrome-dev weekly run is impacted by this. Were you able to figure out how to use chromium to continue to test against upcoming beta releases? Was that supported by Playwright config somehow, or did you have to manage downloading chromium versions yourself?

  6. fungairino commented on Jul 18, 2025

    @fungairino
    Author

    @fungairino I am having the same problem as you, where our chrome-dev weekly run is impacted by this. Were you able to figure out how to use chromium to continue to test against upcoming beta releases? Was that supported by Playwright config somehow, or did you have to manage downloading chromium versions yourself?

    Unfortunately we have had to stop testing against Chrome altogether. Now our e2e CI action only tests against Chromium and Edge.
    There might be a workaround to this by using CDP, but I have not had the time to investigate this.

  7. saishiyuu commented on Jul 22, 2025

    @saishiyuu

    @fungairino I am having the same problem as you, where our chrome-dev weekly run is impacted by this. Were you able to figure out how to use chromium to continue to test against upcoming beta releases? Was that supported by Playwright config somehow, or did you have to manage downloading chromium versions yourself?

    Unfortunately we have had to stop testing against Chrome altogether. Now our e2e CI action only tests against Chromium and Edge. There might be a workaround to this by using CDP, but I have not had the time to investigate this.

    Chris Lanzo (@cjlanzo) Eduardo Fungairino (@fungairino)
    Maybe you can temporarily use Chrome for Testing instead of the branded Chrome? It seems closer to the branded version than Chromium.
    It works well in my projects.

    https://googlechromelabs.github.io/chrome-for-testing/
    Here's how I configured it in my playwright.config.ts:

     {
          name: 'Google Chrome Beta',
          use: {
            launchOptions: {
              executablePath: chromePath,
            },
          },
     },
    
  8. Azedize commented on Aug 8, 2025

    @Azedize

    How to replace --disable-extensions-except and --load-extension in Chrome 139?
    Since Google Chrome version 139, the command-line flags:

    no longer seem to work.
    In Chrome 138 and below, I was able to launch Chrome with a specific unpacked extension for automation/testing purposes using Python:

    command = [
        self.Browser_path,
        f"--user-data-dir={user_profile_path}",
        f"--disable-extensions-except={extension_path}",
        f"--load-extension={extension_path}",
        "--no-first-run",
        "--no-default-browser-check",
        "--disable-sync"
    ]
    
  9. carl-jin commented on Aug 11, 2025

    @carl-jin

    如何在 Chrome 139 中替换 --disable-extensions-except 和 --load-extension? 自 Google Chrome 139 版本起,命令行标志如下:

    似乎不再起作用了。 在 Chrome 138 及更低版本中,我能够使用 Python 启动带有特定解压扩展程序的 Chrome,以进行自动化/测试:

    command = [
    self.Browser_path,
    f"--user-data-dir={user_profile_path}",
    f"--disable-extensions-except={extension_path}",
    f"--load-extension={extension_path}",
    "--no-first-run",
    "--no-default-browser-check",
    "--disable-sync"
    ]

    This appears to be caused by the Chrome 139 update — the "--load-extension=" parameter seems to have stopped working.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions