1

I am developing a simple prototype with Java + Playwright + Browserless. I was wondering if is possible avoid downloading the browsers in AWS.

Playwright build of chromium v956323 downloaded to /home/ec2-user/.cache/ms-playwright/chromium-956323
Playwright build of ffmpeg v1007 downloaded to /home/ec2-user/.cache/ms-playwright/ffmpeg-1007
Playwright build of firefox v1313 downloaded to /home/ec2-user/.cache/ms-playwright/firefox-1313
Playwright build of webkit v1596 downloaded to /home/ec2-user/.cache/ms-playwright/webkit-1596

Sometimes it will run in browserless and i think if so i wont need the browser but i dont really know is this possible? or even running in browserless i would need the browsers?

If so how can i do that in Java.

I want to do it programmatically because depending of the parameters sometime i need them sometimes dont is this possible?

chiperortiz
  • 4,573
  • 7
  • 42
  • 74

1 Answers1

1

You can skip the browser download by setting an environment variable PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1

See the docs here: https://playwright.dev/java/docs/browsers#skip-browser-downloads

Christian Baumann
  • 2,583
  • 3
  • 17
  • 32
  • But i want to do it programmatically i mean depending of the configuration sometimes it will run in the browsers in the same machine and sometimes in different providers. – chiperortiz Mar 15 '22 at 19:15
  • 1
    Sorry, missed that bit. How to set an env var programmatically in Java depends on your OS, lots of possibilities covered here: https://stackoverflow.com/questions/318239/how-do-i-set-environment-variables-from-java – Christian Baumann Mar 15 '22 at 19:36