Skip to content

Add Firefox ESR support to e2e browser-helpers (Chrome fallback kept) - #275

Merged
guysoft merged 1 commit into
develfrom
feature/firefox-screenshot
Aug 3, 2026
Merged

Add Firefox ESR support to e2e browser-helpers (Chrome fallback kept)#275
guysoft merged 1 commit into
develfrom
feature/firefox-screenshot

Conversation

@guysoft

@guysoft guysoft commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Chrome 147+ has a Page.captureScreenshot regression: full google-chrome-stable --headless --screenshot produces no image in CI containers. This made OctoPi's e2e-test exhaust its 30-min polling window and fail (the OctoPrint wizard test itself passed).
  • Migrate the shared browser-helpers.sh to prefer firefox-esr/firefox (stable --screenshot CLI; ESR pins a major version for ~12 months), keeping google-chrome-stable/chromium/chromium-browser as fallback so other distros (e.g. FullPageOS) keep working unchanged.
  • headless_screenshot now branches on the resolved browser family. Firefox uses --headless --no-remote --screenshot <file> --window-size=W,H (path as a separate arg); Chrome keeps its existing flag set. Size check, OCR validation, and retry logic are unchanged.

Why Firefox ESR, not Camoufox

Camoufox is an anti-detect Firefox fork (irrelevant here), explicitly flagged "not production-stable", with a heavy pip + ~1.2 GB binary supply chain. Firefox ESR is stock, stable, and in the Mozilla Team PPA.

Test plan

  • CustomPiOS unit tests pass (no unit test exists for this helper; change is additive).
  • After merge to devel, docker-build.yml rebuilds ghcr.io/guysoft/custompios:devel.
  • Follow-up OctoPi PR switches testing/Dockerfile to firefox-esr and validates end-to-end (wizard screenshot captured, no timeout).
  • FullPageOS (still installs google-chrome-stable) unaffected: find_headless_browser finds no firefox, falls back to Chrome path.

Context

OctoPi failing run: https://github.com/guysoft/OctoPi/actions/runs/30759697193/job/91545664616

Chrome 147+ has a Page.captureScreenshot regression where full
google-chrome-stable --headless --screenshot produces no image in CI
containers, which made OctoPi's e2e-test exhaust its 30-min polling
window and fail (the OctoPrint wizard test itself passed). Firefox's
--screenshot CLI is stable across releases and ESR pins a major version
for ~12 months, so prefer firefox-esr/firefox when present and keep
google-chrome-stable/chromium/chromium-browser as fallback so other
distros (e.g. FullPageOS) keep working unchanged.

headless_screenshot now branches on the resolved browser family:
Firefox uses --headless --no-remote --screenshot <file> --window-size=W,H
(path as a separate arg), Chrome keeps its existing flag set. The size
check, OCR validation, and retry logic are unchanged and work for both.
@guysoft
guysoft force-pushed the feature/firefox-screenshot branch from 72ae693 to 1d33246 Compare August 3, 2026 20:02
@guysoft
guysoft merged commit 971d339 into devel Aug 3, 2026
@guysoft
guysoft deleted the feature/firefox-screenshot branch August 3, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant