Skip to content

[Feature] Allow passing environment variables into Playwright.create() #471

@dubinsky

Description

@dubinsky

I am embedding Playwright in my Scala code, and need to control browser downloading in code, so I need to set environment variables (PLAYWRIGHT_BROWSERS_PATH, PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD) on the ProcessBuilder used to run the driver.

Since PipeTransport and Connection constructors, Playwright.driverProcess and Playwright.initSharedSelectors() are not public, this results - in addition to duplicating the code of the PlaywrightImpl.create() - in the use of reflection.

It would be cleaner if a flavor of Playwright.create() was added that takes an environment Map<String, String> and delegates
to a similar flavor of PlaywrightImpl.create(), which in turn calls pb.environment().putAll() on the ProcessBuilder...

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