[Feature Request] Ability to skip browser download
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 890
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 11
Description
**Is your feature request related to a problem? Please describe.**
Docfx alwawys download browser even when not needed. I have build environment without internet access where only pre-built docker image and documentation is allowed to enter. I can build documentation only with slow workaround currently.
Default behaviour always tries to download chrome with each run: `Downloading Chromium 125.0.6422.26 (playwright build v1117)[2m from https://playwright-verizon.azureedge.net/builds/chromium/1117/chromium-linux.zip` even when there is `INSTALLATION_COMPLETE` file available in `$PLAYWRIGHT_BROWSERS_PATH` directory. It downloads browser with each pdf built when internet access is allowed. That is wasteful when building many files in my opinion.
Before the build the PLAYWRIGHT_BROWSERS_PATH=/.cache dir looks like this:
```
# /.cache/chromium-1117$ ls
DEPENDENCIES_VALIDATED INSTALLATION_COMPLETE chrome-linux/
```
Download failure would break build. But there is simple workaround. Build works when you set the directory that contains browser installation as readonly. This prevent `__dirlock` directory creation and Docfx proceeds to documentation build without crashing **after some time**.
How it looks: `Error: EACCES: permission denied '' '__dirlock'`
It always takes some time before Docfx give up on browser installation with this workaround and I need to speed this up. I tried `ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1` with no effect.
**Describe the solution you'd like**
The environment variable `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` configured to 1 that would skip any browser download attempt.
**Describe alternatives you've considered**
Adding parameter to docfx pdf build command: `docfx pdf --skip-browser-download`.
**Additional context**
I call `docfx pdf Dummy/docfx.json` build command on dummy project during image build to be sure that all dependencies are in place.
Contributor guide
Assessment
This issue has not been assessed yet.