What are the steps to use a custom-built WebKit browser executable with Playwright?


Using a Custom-Built WebKit Browser with Playwright

You can use a custom-built WebKit browser executable with Playwright by opting for a hermetic install. This mode lets you place binaries in the local folder.

Hermetic Install

To opt-in for hermetic install, set PLAYWRIGHT_BROWSERS_PATH=0 before running the install command:

npx playwright install

This places binaries in the node_modules/playwright-core/.local-browsers directory.

Skipping Browser Downloads

If you manage browser binaries separately and want to skip browser downloads, set PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD before installation.

Custom Download Location

Playwright allows downloading browsers from a custom location using the PLAYWRIGHT_DOWNLOAD_HOST environment variable. You can use per-browser download hosts using PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST, PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST and PLAYWRIGHT_WEBKIT_DOWNLOAD_HOST environment variables. These take precedence over PLAYWRIGHT_DOWNLOAD_HOST.

Specific Location Install

When installing Playwright, you can ask it to download browsers into a specific location by setting the environment variable:

PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npx playwright install

When running Playwright scripts, ask it to search for browsers in a shared location:

PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npx playwright test

In summary, Playwright provides multiple ways to use a custom-built WebKit browser executable. You can learn more about these methods in the Playwright documentation.


Thank you!
Was this helpful?
Still have questions?

If you still have questions, please ask a question and I will try to answer it.

Related Questions

AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.