@browserless/pdf 10.10.2 → 10.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md CHANGED
File without changes
package/README.md CHANGED
@@ -73,7 +73,7 @@ The package applies these optimized defaults:
73
73
  | `scale` | `number` | `0.65` | Scale of the webpage rendering (0.1 - 2) |
74
74
  | `printBackground` | `boolean` | `true` | Print background graphics |
75
75
  | `waitUntil` | `string` | `'auto'` | When to consider navigation done |
76
- | `waitForDom` | `number` | `1000` | DOM stability window in ms (idle is `waitForDom / 10`) |
76
+ | `waitForDom` | `number` | `0` | DOM stability window in ms (idle is `waitForDom / 10`, `0` disables DOM wait) |
77
77
  | `format` | `string` | `'Letter'` | Paper format (A4, Letter, etc.) |
78
78
  | `landscape` | `boolean` | `false` | Paper orientation |
79
79
  | `width` | `string \| number` | — | Paper width (overrides format) |
@@ -112,7 +112,7 @@ Supported units: `px`, `in`, `cm`, `mm`
112
112
  When `waitUntil: 'auto'` (the default), the package:
113
113
 
114
114
  1. Navigates to the page
115
- 2. Waits for DOM stability (`waitForDom`, default `1000ms`)
115
+ 2. Optionally waits for DOM stability (`waitForDom`, default `0` = disabled)
116
116
  3. Takes a low-quality screenshot to check for white/blank content
117
117
  4. If the page appears blank, retries until content is detected
118
118
  5. Generates the PDF once content is confirmed
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@browserless/pdf",
3
3
  "description": "Convert websites to high-quality PDFs with customizable margins, background printing, and optimized scaling.",
4
4
  "homepage": "https://browserless.js.org/#/?id=pdfurl-options",
5
- "version": "10.10.2",
5
+ "version": "10.11.0",
6
6
  "main": "src",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -30,8 +30,8 @@
30
30
  "conversion"
31
31
  ],
32
32
  "dependencies": {
33
- "@browserless/goto": "^10.10.2",
34
- "@browserless/screenshot": "^10.10.2",
33
+ "@browserless/goto": "^10.11.0",
34
+ "@browserless/screenshot": "^10.11.0",
35
35
  "@kikobeats/time-span": "~1.0.11",
36
36
  "debug-logfmt": "~1.4.7",
37
37
  "pretty-ms": "~7.0.1"
@@ -42,10 +42,9 @@
42
42
  "files": [
43
43
  "src"
44
44
  ],
45
+ "license": "MIT",
45
46
  "scripts": {
46
47
  "coverage": "exit 0",
47
48
  "test": "exit 0"
48
- },
49
- "license": "MIT",
50
- "gitHead": "ec6a614923a1a692bd717ecc8e6f1b09417801d9"
51
- }
49
+ }
50
+ }
package/src/index.js CHANGED
@@ -49,6 +49,8 @@ module.exports = ({ goto, ...gotoOpts } = {}) => {
49
49
  })
50
50
 
51
51
  const waitForDomStabilityResult = async page => {
52
+ if (!waitForDomOpts) return
53
+
52
54
  const result = await pReflect(page.evaluate(waitForDomStability, waitForDomOpts))
53
55
  debug(
54
56
  'waitForDomStability',