External Playwright driver management for native-image builds.
Instead of bundling Playwright's large Node.js driver in the native binary, this module materializes it into a local cache on first use.
Playwright shut down its prebuilt driver CDN (cdn.playwright.dev/builds/driver)
in mid-2026. For Playwright Java 1.61.0+, the official upstream layout changed:
driver.jar now contains playwright-core (driver/package/...) and
driver-bundle.jar contains only the per-platform Node runtimes
(driver/<platform>/node). This module mirrors that official layout by
sourcing those same Maven artifacts, extracting only the current platform,
and assembling the exact directory Playwright Java expects:
<driver-dir>/node # the Node.js runtime (node.exe on Windows) <driver-dir>/package/cli.js # the driver entry point
Source order:
Cache: ~/.cache/spel/<version>/<platform>/
The undetected variant (spel --undetected) replaces only the JS package
with com.blockether/spel-patchright-driver, a Maven repack of the npm
patchright-core package. The Node runtime still comes from driver-bundle.
Its cache is <cache-root>/patchright-<patchright-version>/<platform>/.
Configuration (checked in order):
External Playwright driver management for native-image builds. Instead of bundling Playwright's large Node.js driver in the native binary, this module materializes it into a local cache on first use. Playwright shut down its prebuilt driver CDN (cdn.playwright.dev/builds/driver) in mid-2026. For Playwright Java 1.61.0+, the official upstream layout changed: `driver.jar` now contains `playwright-core` (`driver/package/...`) and `driver-bundle.jar` contains only the per-platform Node runtimes (`driver/<platform>/node`). This module mirrors that official layout by sourcing those same Maven artifacts, extracting only the current platform, and assembling the exact directory Playwright Java expects: <driver-dir>/node # the Node.js runtime (node.exe on Windows) <driver-dir>/package/cli.js # the driver entry point Source order: 1. Clojure tools.deps resolver (local Maven cache first) 2. Configured Maven repositories / mirrors / ~/.m2/settings.xml Cache: ~/.cache/spel/<version>/<platform>/ The undetected variant (`spel --undetected`) replaces only the JS package with com.blockether/spel-patchright-driver, a Maven repack of the npm `patchright-core` package. The Node runtime still comes from driver-bundle. Its cache is <cache-root>/patchright-<patchright-version>/<platform>/. Configuration (checked in order): 1. playwright.cli.dir system property — points to pre-installed driver dir 2. SPEL_DRIVER_DIR env var — overrides cache location 3. Default: ~/.cache/spel/<version>/<platform>/
(driver-ready?)(driver-ready? variant)Checks if the driver of a variant (:playwright by default) is ready to use.
Checks if the driver of a variant (:playwright by default) is ready to use.
(ensure-driver!)(ensure-driver! {:keys [undetected?]})Ensures the Playwright Java Node.js driver is available locally.
Materializes it from Maven artifacts on first use and sets the playwright.cli.dir system property so Playwright Java uses the external driver instead of trying to extract from bundled resources.
With {:undetected? true}, uses the Patchright package. Playwright Java
starts one driver per process, so call this before the first
Playwright/create of the process.
No-op if playwright.cli.dir is already set (for custom installations).
Ensures the Playwright Java Node.js driver is available locally.
Materializes it from Maven artifacts on first use and sets the
playwright.cli.dir system property so Playwright Java uses the external
driver instead of trying to extract from bundled resources.
With `{:undetected? true}`, uses the Patchright package. Playwright Java
starts one driver per process, so call this before the first
`Playwright/create` of the process.
No-op if playwright.cli.dir is already set (for custom installations).Environment overrides for Spel's Node processes. Keep inherited Node options out of the bundled runtime.
Environment overrides for Spel's Node processes. Keep inherited Node options out of the bundled runtime.
(node-process-builder args)Creates a process builder with inherited Node options cleared. Keeps all other environment variables.
Creates a process builder with inherited Node options cleared. Keeps all other environment variables.
Maven coordinate of the Patchright driver package for --undetected.
Maven coordinate of the Patchright driver package for `--undetected`.
(patchright-version)Returns the pinned Patchright driver version from the spel resources.
Returns the pinned Patchright driver version from the spel resources.
(run-cli! args)Runs the Playwright CLI without inherited Node options. The CLI exits the current process.
Runs the Playwright CLI without inherited Node options. The CLI exits the current process.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |