@browserless/cli 13.6.7 → 13.6.9

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@browserless/cli",
3
3
  "description": "Command-line interface for headless browser automation. Take screenshots, generate PDFs, and extract content from websites.",
4
4
  "homepage": "https://browserless.js.org",
5
- "version": "13.6.7",
5
+ "version": "13.6.9",
6
6
  "bin": {
7
7
  "browserless": "src/index.js"
8
8
  },
@@ -34,9 +34,9 @@
34
34
  "web-scraping"
35
35
  ],
36
36
  "dependencies": {
37
- "@browserless/capture": "13.6.7",
37
+ "@browserless/capture": "13.6.9",
38
38
  "beauty-error": "~1.2.22",
39
- "browserless": "13.6.7",
39
+ "browserless": "13.6.9",
40
40
  "dark-mode": "~3.0.0",
41
41
  "dset": "~3.1.4",
42
42
  "mri": "~1.2.0",
@@ -59,5 +59,5 @@
59
59
  "test": "exit 0"
60
60
  },
61
61
  "license": "MIT",
62
- "gitHead": "42384bd1c7b69b25341afdfcc987fb70d4fb9460"
62
+ "gitHead": "c625834b3b37e036432a0756d67eccc149861ad0"
63
63
  }
@@ -1,3 +1,6 @@
1
1
  'use strict'
2
2
 
3
- module.exports = async ({ url, browserless, opts }) => [await browserless.pdf(url, opts)]
3
+ module.exports = async ({ url, browserless, opts, isPageReady }) => {
4
+ if (typeof isPageReady === 'function') opts.isPageReady = isPageReady
5
+ return [await browserless.pdf(url, opts)]
6
+ }
package/src/index.js CHANGED
@@ -78,10 +78,16 @@ const run = async () => {
78
78
  launchOpts.ignoreDefaultArgs = ['--disable-extensions']
79
79
  }
80
80
 
81
+ const parsedOpts = nestie(opts)
82
+ if (parsedOpts.timeout != null) {
83
+ launchOpts.timeout = Number(parsedOpts.timeout)
84
+ }
81
85
  const browser = createBrowser(launchOpts)
82
86
  onExit(browser.close)
83
- const browserless = await browser.createContext()
84
- return fn({ url, browserless, opts: nestie(opts), isPageReady })
87
+ const browserless = await browser.createContext(
88
+ launchOpts.timeout != null ? { timeout: launchOpts.timeout } : undefined
89
+ )
90
+ return fn({ url, browserless, opts: parsedOpts, isPageReady })
85
91
  }
86
92
 
87
93
  run()