fix(smartpdf): lazily initialize SmartPdf, stop it only when present, and make evaluateOnPage reliably close pages

This commit is contained in:
2026-03-09 16:16:15 +00:00
parent efda7c7b01
commit 654cd2619c
3 changed files with 34 additions and 10 deletions

View File

@@ -1,5 +1,13 @@
# Changelog
## 2026-03-09 - 2.0.9 - fix(smartpdf)
lazily initialize SmartPdf, stop it only when present, and make evaluateOnPage reliably close pages
- Add private ensureSmartPdf() to lazily initialize and start SmartPdf only when PDF methods are called
- Call ensureSmartPdf() in pdfFromPage() before using smartpdf
- Stop SmartPdf in stop() only if it was initialized and clear the reference
- Wrap evaluateOnPage() page operations in try/finally and safely ignore errors from page.close() to avoid resource leaks or uncaught exceptions
## 2025-01-03 - 2.0.8 - fix(core)
Ensure consistent browser automation functionality