2. Chrome binary auto-detection #4

Closed
opened 2026-05-20 15:30:17 -06:00 by ppreeper · 0 comments
Owner

Description

Implement auto-detection of Chrome/Chromium binary on the system.

Tasks

  • Search PATH for Chrome binaries in priority order:
    1. google-chrome
    2. google-chrome-stable
    3. chromium-browser
    4. chromium
  • Support WKHTMLTOPDF_CHROME_PATH env var to override auto-detection
  • Support --chrome-path CLI flag to override per-invocation
  • Priority: CLI flag > env var > auto-detect
  • Exit code 6 with error message if Chrome not found

Acceptance Criteria

  • Auto-detect finds google-chrome when installed
  • WKHTMLTOPDF_CHROME_PATH=/custom/path overrides auto-detect
  • --chrome-path /custom/path overrides both env and auto-detect
  • Missing Chrome exits with code 6 and clear error on stderr

Notes

  • Use shutil.which() from stdlib for PATH lookup
  • Relates to PRD #2
## Description Implement auto-detection of Chrome/Chromium binary on the system. ## Tasks - [ ] Search PATH for Chrome binaries in priority order: 1. `google-chrome` 2. `google-chrome-stable` 3. `chromium-browser` 4. `chromium` - [ ] Support `WKHTMLTOPDF_CHROME_PATH` env var to override auto-detection - [ ] Support `--chrome-path` CLI flag to override per-invocation - [ ] Priority: CLI flag > env var > auto-detect - [ ] Exit code 6 with error message if Chrome not found ## Acceptance Criteria - Auto-detect finds `google-chrome` when installed - `WKHTMLTOPDF_CHROME_PATH=/custom/path` overrides auto-detect - `--chrome-path /custom/path` overrides both env and auto-detect - Missing Chrome exits with code 6 and clear error on stderr ## Notes - Use `shutil.which()` from stdlib for PATH lookup - Relates to PRD #2
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ppreeper/wkhtmltopdf#4
No description provided.