pub const DEFAULT_WAIT_SECS: u64 = 5;Expand description
Default wait time for JavaScript execution in seconds.
After page navigation completes, the service waits for JavaScript to finish rendering dynamic content. This constant defines the default wait time when not specified in the request.
§Behavior
During the wait period, the service polls every 200ms for window.isPageDone === true.
If the page sets this flag, PDF generation proceeds immediately. Otherwise,
the full wait duration elapses before generating the PDF.
§Default Value
5 seconds - balances between allowing time for JavaScript execution
and not waiting unnecessarily for simple pages.
§Recommendations
| Page Type | Recommended Wait |
|---|---|
| Static HTML | 1-2 seconds |
| Light JavaScript (vanilla JS, jQuery) | 3-5 seconds |
| Heavy SPA (React, Vue, Angular) | 5-10 seconds |
| Complex visualizations (D3, charts) | 10-15 seconds |
| Real-time data loading | 10-20 seconds |