Skip to content

[Bug]: Chromium will not use "Local State" #2981

@sam-at-dili

Description

@sam-at-dili

Version

1.55.0

Steps to reproduce

I need to set the --unsafely-treat-insecure-origin-as-secure=http://testurl:port command line parameter in order to test an application inside a docker container (from a second docker container running the tests). Because "testurl" is not "localhost" and "http" is not "https", chromium refuses to permit access to the crypto API unless this flag is set.

This flag is ignored until the experimental labs option is enabled. Once you've done so, "Local State" contains this option:

"browser": {
        "enabled_labs_experiments": [
            "unsafely-treat-insecure-origin-as-secure"
        ]
    }

However, when running headless inside docker via Playwright, it never creates nor touches the "Local State" file, making it impossible to enable the flag.

Expected behavior

After I run chromium with user_data_dir specified, I expect to see a user data dir.

Actual behavior

Instead of a proper user data dir, the kind created by running chromium with --user-data-dir, there is only the profile, which does not store browser settings.

Additional context

If the resolution is "this can't be fixed" then allow this ticket to be documentation for the next person to run into this. If there's no fix, you cannot get around insecure origin issues in docker without committing to implement SSL. You cannot get chromium, orchestrated with playwright, to respect the "--unsafely-treat-insecure-origin-as-secure" command line argument, no matter what you do with the user data dir, as it contains only profiles.

Environment

- Operating System: MacOS, Ubuntu in docker
- CPU: arm64
- Browser: Chromium
- 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