@browserless/cli 9.7.0-beta.0 → 9.7.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/package.json +3 -3
- package/src/index.js +4 -4
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@browserless/cli",
|
|
3
3
|
"description": "CLI to interact with Browserless capabilities",
|
|
4
4
|
"homepage": "https://browserless.js.org",
|
|
5
|
-
"version": "9.7.0
|
|
5
|
+
"version": "9.7.0",
|
|
6
6
|
"bin": {
|
|
7
7
|
"browserless": "src/index.js"
|
|
8
8
|
},
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"beauty-error": "~1.2.15",
|
|
35
|
-
"browserless": "^9.7.0
|
|
35
|
+
"browserless": "^9.7.0",
|
|
36
36
|
"dark-mode": "~3.0.0",
|
|
37
37
|
"exit-hook": "~2.2.1",
|
|
38
38
|
"lodash": "~4.17.21",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"test": "exit 0"
|
|
56
56
|
},
|
|
57
57
|
"license": "MIT",
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "4da0a992dd779d5b7a6cc8a0bb8f9e918808f6e1"
|
|
59
59
|
}
|
package/src/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
'use strict'
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const createBrowser = require('browserless')
|
|
6
6
|
const beautyError = require('beauty-error')
|
|
7
7
|
const exitHook = require('exit-hook')
|
|
8
8
|
const path = require('path')
|
|
@@ -42,10 +42,10 @@ const run = async () => {
|
|
|
42
42
|
const url = new URL(rawUrl).toString()
|
|
43
43
|
const fn = require(`./commands/${command}`)
|
|
44
44
|
|
|
45
|
-
const
|
|
46
|
-
const browserless = await
|
|
45
|
+
const browser = createBrowser({ headless })
|
|
46
|
+
const browserless = await browser.createContext()
|
|
47
47
|
|
|
48
|
-
exitHook(() =>
|
|
48
|
+
exitHook(() => browser.close())
|
|
49
49
|
|
|
50
50
|
const result = await fn({ url, browserless, opts: cli.flags })
|
|
51
51
|
|