Skip to content

Allow passing an :env option to set the environment on the Port transport#34

Open
probably-not wants to merge 6 commits intoftes:mainfrom
probably-not:allow-passing-environment
Open

Allow passing an :env option to set the environment on the Port transport#34
probably-not wants to merge 6 commits intoftes:mainfrom
probably-not:allow-passing-environment

Conversation

@probably-not
Copy link
Copy Markdown
Contributor

The port transport currently does not allow setting the environment, meaning that we can't set any environment variables for Playwright to use. For example, if we want to change the downloaded browser cache to scope it to a specific folder, we need to set the PLAYWRIGHT_BROWSERS_PATH to the directory where they are downloaded (docs here).

This allows passing an :env option to the supervisor on startup and ensures that we can pass an explicit environment to the Port transport.

Copy link
Copy Markdown
Owner

@ftes ftes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks wonderful. Some small suggestions.

Comment thread lib/playwright_ex/processes/port_transport.ex Outdated
Comment thread lib/playwright_ex/processes/port_transport.ex Outdated
Comment thread lib/playwright_ex/processes/port_transport.ex Outdated
@probably-not
Copy link
Copy Markdown
Contributor Author

Applied your suggestions and I removed that duplicated init 👍

Just let me know your preference on the charlists/strings thing, other than that should be good to go!

@probably-not probably-not force-pushed the allow-passing-environment branch from 1df73d3 to 8353ca1 Compare April 20, 2026 10:08
@probably-not
Copy link
Copy Markdown
Contributor Author

Huh, strange, my rebase via the GitHub UI lost all of the commit signatures... that's weird... I had it configured to verify web commits. Strange. I'll try and fix that.

@probably-not probably-not force-pushed the allow-passing-environment branch from 8353ca1 to dd3557f Compare April 20, 2026 10:15
@probably-not
Copy link
Copy Markdown
Contributor Author

Alright, there we go! It should be good to go now 😅

@ftes ftes enabled auto-merge (squash) April 20, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants