@browserless/goto 10.4.0 → 10.5.0-alpha.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 -8
- package/src/engine.bin +0 -0
- package/src/index.js +6 -3
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.5.0-alpha.0",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "hello@microlink.io",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@browserless/devices": "^10.3.0",
|
|
33
|
-
"@cliqz/adblocker-puppeteer": "~1.
|
|
33
|
+
"@cliqz/adblocker-puppeteer": "~1.27.0",
|
|
34
34
|
"@kikobeats/time-span": "~1.0.3",
|
|
35
35
|
"debug-logfmt": "~1.2.1",
|
|
36
36
|
"got": "~11.8.6",
|
|
@@ -53,6 +53,10 @@
|
|
|
53
53
|
"scripts",
|
|
54
54
|
"src"
|
|
55
55
|
],
|
|
56
|
+
"scripts": {
|
|
57
|
+
"postinstall": "node scripts/postinstall",
|
|
58
|
+
"test": "ava"
|
|
59
|
+
},
|
|
56
60
|
"license": "MIT",
|
|
57
61
|
"ava": {
|
|
58
62
|
"serial": true,
|
|
@@ -62,9 +66,5 @@
|
|
|
62
66
|
"timeout": "2m",
|
|
63
67
|
"workerThreads": false
|
|
64
68
|
},
|
|
65
|
-
"gitHead": "
|
|
66
|
-
|
|
67
|
-
"postinstall": "node scripts/postinstall",
|
|
68
|
-
"test": "ava"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
69
|
+
"gitHead": "dd4947168c5267eece21395cb581f687f826647a"
|
|
70
|
+
}
|
package/src/engine.bin
CHANGED
|
Binary file
|
package/src/index.js
CHANGED
|
@@ -197,7 +197,7 @@ module.exports = ({ defaultDevice = 'Macbook Pro 13', timeout: globalTimeout, ..
|
|
|
197
197
|
scripts,
|
|
198
198
|
scroll,
|
|
199
199
|
styles,
|
|
200
|
-
timeout
|
|
200
|
+
timeout,
|
|
201
201
|
timezone,
|
|
202
202
|
url,
|
|
203
203
|
username,
|
|
@@ -210,7 +210,7 @@ module.exports = ({ defaultDevice = 'Macbook Pro 13', timeout: globalTimeout, ..
|
|
|
210
210
|
...args
|
|
211
211
|
}
|
|
212
212
|
) => {
|
|
213
|
-
const baseTimeout = timeouts.base(globalTimeout)
|
|
213
|
+
const baseTimeout = timeouts.base(timeout || globalTimeout)
|
|
214
214
|
const actionTimeout = timeouts.action(baseTimeout)
|
|
215
215
|
const gotoTimeout = timeouts.goto(baseTimeout)
|
|
216
216
|
|
|
@@ -363,7 +363,10 @@ module.exports = ({ defaultDevice = 'Macbook Pro 13', timeout: globalTimeout, ..
|
|
|
363
363
|
const { value: response, reason: error } = await run({
|
|
364
364
|
fn: html
|
|
365
365
|
? page.setContent(html, { waitUntil, ...args })
|
|
366
|
-
:
|
|
366
|
+
: Promise.race([
|
|
367
|
+
page.goto(url, { waitUntil, ...args }),
|
|
368
|
+
setTimeout(gotoTimeout).then(() => page._client().send('Page.stopLoading'))
|
|
369
|
+
]),
|
|
367
370
|
timeout: gotoTimeout,
|
|
368
371
|
debug: { fn: html ? 'html' : 'url', waitUntil }
|
|
369
372
|
})
|