Skip to content

[Bug]: Cannot load extension with latest chrome executable version #2963

@viethoang261

Description

@viethoang261

Version

1.55.0

Steps to reproduce

I have updated Chrome to the latest version, and when running Playwright with the latest binary path, I can not load extensions, and without the executable_path arg for using the Chromium bundle, it works normally

with sync_playwright() as p:
    # Persistent context requires launching the browser with user_data_dir
    # Extensions only work with Chromium

    user_data_dir = Path(USER_DATA_DIR).absolute()
    extension_path = Path(EXTENSION_PATH).absolute()

    browser_context = p.chromium.launch_persistent_context(
        user_data_dir,
        headless=False,  # Extensions won't load in headless mode
        args=[
            f"--disable-extensions-except={extension_path}",
            f"--load-extension={extension_path}",
        ],
        executable_path="/usr/bin/google-chrome-stable"
    )

    page = browser_context.new_page()
    page.goto("https://example.com")

    print("Browser opened with extension loaded and persistent profile.")

    input("Press Enter to close...")

    browser_context.close()

Expected behavior

.

Actual behavior

.

Additional context

No response

Environment

- Operating System: [Ubuntu 22.04]
- Browser: [Chromium] Version 140.0.7339.80 (Official Build) (64-bit)
- Python Version: [3.12]
- Other info:

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