aerokube / images

Browser images for Selenoid and Moon 1.x
https://aerokube.com/images/latest/
Apache License 2.0
168 stars 126 forks source link

Support custom browser profile dir for Chrome via environment variable #627

Closed matthewlowry closed 1 year ago

matthewlowry commented 1 year ago

Following from https://github.com/aerokube/selenoid/issues/1355.

I would like to be able to pass a custom profile directory to Chrome. The use case is mounting a directory from the host into the Chrome container so a prepared custom profile directory can be passed between a series of sessions in a test suite.

Currently if I do this:

{
    "capabilities": {
        "alwaysMatch": {
            "browserName": "chrome",
            "browserVersion": "114.0",
            "goog:chromeOptions": {
                "args": [
                    "user-data-dir=/profiles/custom.XYZ"
                ]
            }
        }
    }
}

then Devtools cannot be used because the /devtools/devtools proxy process inside the container can no longer find the browser profile directory. It is hard coded to look for the temporary location provided by chromedriver.

It would be nice if there was some mechanism, such as an environment variable, to pass the required information to the devtools proxy process in the container. I will raise a PR shortly offering a solution.

vania-pooh commented 1 year ago

Fixed in #628.