spatie/browsershot
64.9
Adequate · 19 September 2026
1.2k
lines of production code
PHP
primary language
1
measurement over time
What this system is
This system is a PHP library for generating screenshots and PDFs from web pages using headless Chrome. It provides capabilities for capturing page content, applying image manipulations, and handling complex browser interactions such as waiting for stability and managing redirects. The library enforces strict security measures and offers detailed error reporting and structured output for debugging browser processes.
Features
Added Polling enum for browser waiting strategies
A new Polling enum has been introduced in the Spatie Browsershot library, defining specific constants for browser waiting strategies. This enum exposes 'raf' (RequestAnimationFrame) and 'mutation' options, allowing users to explicitly select how the library waits for page stability during screenshot or PDF generation processes.
spatie/browsershot · high confidence
New structured result object and image manipulation engine
This change introduces the ChromiumResult class to provide structured access to browser outputs such as console messages, request lists, page errors, and redirect history, replacing previous output handling. It also adds the ImageManipulations class, which leverages the spatie/image library (version 3.0.0+) to apply image processing operations to screenshots, ensuring the dependency is present and correctly versioned before execution.
src · high confidence
Removals
Removal of legacy PhantomJS-based Browsershot implementation
The legacy \Browsershot\ class and its associated Laravel service provider have been removed from the codebase. This change eliminates the previous implementation that relied on the PhantomJS binary to capture webpage screenshots, which is no longer supported or maintained.
src/Spatie · high confidence
Behavioural changes
Add specific exception classes for browser and file handling errors
The library now includes dedicated exception classes to provide clearer error reporting for common failure scenarios. Users will see specific exceptions for issues such as empty Chrome output, missing file extensions, non-existent input files, disallowed file:// URLs, remote connection failures, and unsuccessful HTTP responses, replacing generic error messages with context-specific feedback.
src/Exceptions · high confidence
Browser process polyfills ReadableStream and adds output accessors
The browser CLI entry point now polyfills the global \ReadableStream\ from \stream/web\ to ensure compatibility in environments where it is missing. It also introduces new methods to retrieve full output data, including \getOutput\ for accessing request history, console messages, failed requests, redirect history, and page errors, and \pageErrors\ for capturing page-level errors. Additionally, the process now supports reading redirect history and uses base64 encoding for communication between the browser process and the main application.
bin · high confidence
Repository housekeeping and documentation overhaul
This change introduces several non-functional updates to the repository structure and documentation. The CI configuration has been migrated from Travis CI to GitHub Actions, evidenced by the removal of .travis.yml and the addition of GitHub Actions badges in the README. The project's coding standards are now enforced via a new .editorconfig file. Documentation has been significantly expanded in README.md to include installation instructions, code examples for image and PDF generation, and links to the full documentation site. Additionally, the LICENSE file has been renamed to LICENSE.md, copyright holders updated to Spatie bvba, and the phpunit.xml.dist configuration has been added to support the test suite.
(repo-wide) · high confidence
Test coverage
Initial test suite for Browsershot; Removed PhpSpec test suite for Browsershot.
Dependencies
Major dependency overhaul and PHP 8.2+ requirement
The package has been significantly modernized, raising the minimum PHP version to 8.2 and dropping support for older PHP and Laravel versions. It now relies on Symfony Process (6.0–8.0) and Spatie Temporary Directory (2.0) instead of legacy dependencies like Intervention Image and Illuminate Support. The test suite has migrated from PHPSpec to Pest (3.0–4.0), and dev dependencies now include Spatie Image (3.6), Spatie PDF-to-Text, and PHPUnit Snapshot Assertions (5.0). Autoloading has been updated to PSR-4, and the binary distribution for PhantomJS has been removed in favor of headless Chrome via Puppeteer.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 65.
Lenses
- Code Health 92
- Architecture 69
- Maturity 59
- Readiness 69
- Security 68
Changes since last survey
- 300 commits — 236 feature/other, 64 fixes
By area
- (root) — 80 commits
- src/Browsershot.php — 55 commits
- (repo) — 37 commits
- bin/browser.cjs — 36 commits
- .github/workflows — 30 commits
- tests/BrowsershotTest.php — 14 commits
- docs/requirements.md — 13 commits
- docs/miscellaneous-options — 10 commits
- docs/usage — 7 commits
- src/Exceptions — 5 commits
- bin/browser.js — 2 commits
- docs/_index.md — 2 commits
- tests/CommandTest.php — 2 commits
- tests/ScreenshotTest.php — 2 commits
- .github/ISSUE_TEMPLATE — 1 commit
- .github/dependabot.yml — 1 commit
- src/ChromiumResult.php — 1 commit
- src/Helpers.php — 1 commit
- tests/HelpersTest.php — 1 commit
Notable commits
- fix: Fix #970: Block local file read bypasses via UNC paths and protocol-relative URLs
- fix: Fix await browser close
- fix: Fix escapeshellcmd on windows
- fix: Fix false positives in UNC path detection for HTML with backslashes
- fix: Fix for type: module in package.json
- fix: Fix generation of large PDFs
- fix: Fix handling of page errors with value null
- fix: Fix installation command for dependencies in requirements.md
- fix: Fix libasound2t64 package name in requirements
- fix: Fix link to Puppeteer devices in creating-images.md
- fix: Fix node binary path escaping when containing spaces (e.g. Application Support)
- fix: Fix node binary path escaping when containing spaces (e.g. Application Support)
- fix: Fix randomly failing test by blocking favicon
- fix: Fix redirect history test
- fix: Fix save method if no image manipulations
- fix: Fix styling
- fix: Fix styling
- fix: Fix styling
- fix: Fix styling
- fix: Fix styling
- …and 280 more
Architecture
- 0 containers · 1 bounded contexts · 0 dependency edges (baseline)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
spatie/browsershot was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 519bbcd812f48970575dc41730e286595c51acca — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.