ulixee / hero

The web browser built for scraping
MIT License
742 stars 39 forks source link

Set custom Display (or any .env) variable for Chrome #285

Open NN-Binary opened 1 month ago

NN-Binary commented 1 month ago

Hi!

I would like to attach individually, for each chrome instance, a different Display. Using puppeteer is easy: https://github.com/puppeteer/puppeteer/blob/84712cbc28e3993668aa57e7bb639c8e2e6d821e/src/node/LaunchOptions.ts#L114

puppeteer.launch(
    ...,
    env: {
        ...,
        DISPLAY: ":10.0"
    }
)

How can I do something similar? I want to have a different set of .env per "profile"

Thank you!

blakebyrnes commented 1 month ago

Thanks for the request! We don't have this feature at the moment. I would think this is a plugin and we will likely need to add a simple hook that allows supplying env vars through to Browser.ts and BrowserProcess.ts in unblocked/agent. Happy to take a PR if you want to take the lead on this one