aerokube/images

Support custom browser profile dir for Chrome via environment variable

matthewlowry opened this issue · 1 comments

Following from aerokube/selenoid#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.

Fixed in #628.