Skip to content

fix: bundle html-to-image, hide full-page capture on complex DOMs#106

Merged
neonwatty merged 2 commits intomainfrom
feat/screenshot-retake
Apr 9, 2026
Merged

fix: bundle html-to-image, hide full-page capture on complex DOMs#106
neonwatty merged 2 commits intomainfrom
feat/screenshot-retake

Conversation

@neonwatty
Copy link
Copy Markdown
Collaborator

Summary

Fixes #101 — screenshot capture fails on complex DOM pages (11k+ nodes) due to main-thread blocking and CDN being blocked by Tracking Prevention.

  • Bundle html-to-image via esbuild instead of CDN loading — eliminates Tracking Prevention blocking. Widget size ~50KB → ~67KB.
  • Hide Full Page and Select Area buttons when DOM exceeds 10k nodes — area capture does a full-page render under the hood, so it hits the same freeze. Only "Select Element" remains. Adds domNodeCount and fullPageDisabled to issue metadata.
  • Rework E2E mocking from CDN route interception (page.route) to page.addInitScript with a window.__bugdropMockToPng test seam.
  • Fix benchmark spec to handle hidden Full Page button gracefully (full_page_disabled outcome).
  • Remove CI paths-ignore that would block merge queue on benchmark-only PRs.

Test plan

  • 66 unit tests pass (including 3 new: getDomNodeCount, isFullPageDisabled boundary x2)
  • 11 screenshot E2E tests pass (6 existing + 2 threshold + 2 metadata + 1 unmocked smoke)
  • Unmocked smoke test verifies real bundled html-to-image captures a screenshot
  • Full E2E suite (99 local tests) passes
  • Widget builds at 66.5KB with html-to-image bundled
  • TypeScript and ESLint clean (0 errors)

Three-part fix for screenshot failures on complex pages (11k+ nodes):

1. Bundle html-to-image via esbuild instead of CDN loading — eliminates
   Tracking Prevention blocking on Edge/Firefox/Brave. Widget size goes
   from ~50KB to ~67KB.

2. Hide Full Page and Select Area buttons when DOM exceeds 10k nodes —
   area capture does a full-page render then crops, so it hits the same
   freeze. Only Select Element remains available. Adds domNodeCount and
   fullPageDisabled to issue metadata for diagnostics.

3. Rework E2E mocking from CDN route interception to addInitScript with
   a window.__bugdropMockToPng test seam. Adds threshold visibility
   tests, metadata payload tests, and one unmocked smoke test that
   exercises the real bundled html-to-image.

Also fixes: benchmark spec handles hidden button gracefully, CI
paths-ignore removed to avoid blocking merge queue, CLAUDE.md updated.
@neonwatty neonwatty added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit 56d7833 Apr 9, 2026
9 checks passed
@neonwatty neonwatty deleted the feat/screenshot-retake branch April 9, 2026 17:35
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

🎉 This PR is included in version 1.27.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: full-page screenshot fails on complex DOM pages (11k+ nodes) even with timeout

1 participant