@browserless/goto 10.8.0 → 10.9.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 +0 -0
- package/package.json +8 -9
- package/src/engine.bin +0 -0
- package/src/index.js +3 -6
package/LICENSE.md
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@browserless/goto",
|
|
3
3
|
"description": "Go to a page aborting unnecessary requests",
|
|
4
4
|
"homepage": "https://browserless.js.org/#/?id=gotopage-options",
|
|
5
|
-
"version": "10.
|
|
5
|
+
"version": "10.9.0",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "hello@microlink.io",
|
|
@@ -31,18 +31,16 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@browserless/devices": "^10.7.13",
|
|
33
33
|
"@ghostery/adblocker-puppeteer": "~2.11.3",
|
|
34
|
-
"@kikobeats/time-span": "~1.0.8",
|
|
35
34
|
"debug-logfmt": "~1.4.0",
|
|
36
35
|
"got": "~11.8.6",
|
|
37
36
|
"is-url-http": "~2.3.10",
|
|
38
37
|
"p-reflect": "~2.1.0",
|
|
39
38
|
"p-timeout": "~4.1.0",
|
|
40
|
-
"pretty-ms": "~7.0.1",
|
|
41
39
|
"shallow-equal": "~3.1.0",
|
|
42
40
|
"tough-cookie": "~6.0.0"
|
|
43
41
|
},
|
|
44
42
|
"devDependencies": {
|
|
45
|
-
"@browserless/test": "^10.
|
|
43
|
+
"@browserless/test": "^10.9.0",
|
|
46
44
|
"ava": "5",
|
|
47
45
|
"p-wait-for": "3"
|
|
48
46
|
},
|
|
@@ -53,6 +51,10 @@
|
|
|
53
51
|
"scripts",
|
|
54
52
|
"src"
|
|
55
53
|
],
|
|
54
|
+
"scripts": {
|
|
55
|
+
"postinstall": "node scripts/postinstall",
|
|
56
|
+
"test": "ava"
|
|
57
|
+
},
|
|
56
58
|
"license": "MIT",
|
|
57
59
|
"ava": {
|
|
58
60
|
"serial": true,
|
|
@@ -62,8 +64,5 @@
|
|
|
62
64
|
"timeout": "2m",
|
|
63
65
|
"workerThreads": false
|
|
64
66
|
},
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
"test": "ava"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
67
|
+
"gitHead": "d3843b489f96c2b52af786a8740ab2a47d7e7125"
|
|
68
|
+
}
|
package/src/engine.bin
CHANGED
|
Binary file
|
package/src/index.js
CHANGED
|
@@ -11,8 +11,6 @@ const isUrl = require('is-url-http')
|
|
|
11
11
|
const path = require('path')
|
|
12
12
|
const fs = require('fs')
|
|
13
13
|
|
|
14
|
-
const timeSpan = require('@kikobeats/time-span')({ format: require('pretty-ms') })
|
|
15
|
-
|
|
16
14
|
const { DEFAULT_INTERCEPT_RESOLUTION_PRIORITY } = require('puppeteer')
|
|
17
15
|
|
|
18
16
|
const debug = require('debug-logfmt')('browserless:goto')
|
|
@@ -34,11 +32,10 @@ const isEmpty = val => val == null || !(Object.keys(val) || val).length
|
|
|
34
32
|
const castArray = value => [].concat(value).filter(Boolean)
|
|
35
33
|
|
|
36
34
|
const run = async ({ fn, timeout, debug: props }) => {
|
|
37
|
-
const
|
|
35
|
+
const duration = debug.duration()
|
|
38
36
|
const result = await pReflect(timeout ? pTimeout(fn, timeout) : fn)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
debug(props, debugProps)
|
|
37
|
+
const errorProps = result.isRejected ? { error: result.reason.message || result.reason } : {}
|
|
38
|
+
duration(props, errorProps)
|
|
42
39
|
return result
|
|
43
40
|
}
|
|
44
41
|
|