@browserless/goto 9.3.0-beta.4 → 9.3.0-beta.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/goto",
3
3
  "description": "Go to a page aborting unnecessary requests",
4
4
  "homepage": "https://browserless.js.org/#/?id=gotopage-options",
5
- "version": "9.3.0-beta.4",
5
+ "version": "9.3.0-beta.9",
6
6
  "main": "src/index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -32,14 +32,14 @@
32
32
  "@browserless/devices": "^9.2.22",
33
33
  "@cliqz/adblocker-puppeteer": "~1.23.0",
34
34
  "debug-logfmt": "~1.0.4",
35
- "got": "~11.8.2",
36
- "is-url-http": "~2.2.4",
35
+ "got": "~11.8.3",
36
+ "is-url-http": "~2.2.5",
37
37
  "p-reflect": "~2.1.0",
38
38
  "p-timeout": "~4.1.0",
39
39
  "pretty-ms": "~7.0.1",
40
40
  "shallow-equal": "~1.2.1",
41
41
  "time-span": "~4.0.0",
42
- "top-user-agents": "~1.0.38",
42
+ "top-user-agents": "~1.0.39",
43
43
  "tough-cookie": "~4.0.0",
44
44
  "unique-random-array": "~2.0.0"
45
45
  },
@@ -68,5 +68,5 @@
68
68
  "timeout": "2m",
69
69
  "verbose": true
70
70
  },
71
- "gitHead": "bd4e6bc95ae88f0c99c7eccfd3061509b2ac9bb8"
71
+ "gitHead": "5917cbb975fba39b208fe7820d16a5655fa75420"
72
72
  }
package/src/engine.bin CHANGED
Binary file
package/src/index.js CHANGED
@@ -117,6 +117,7 @@ module.exports = ({
117
117
  ...deviceOpts
118
118
  }) => {
119
119
  const baseTimeout = globalTimeout * (1 / 2)
120
+ const gotoTimeout = timeout * 0.8
120
121
  const actionTimeout = baseTimeout * (1 / 8)
121
122
 
122
123
  const getDevice = createDevices(deviceOpts)
@@ -165,7 +166,7 @@ module.exports = ({
165
166
  const resourceType = req.resourceType()
166
167
  if (!abortTypes.includes(resourceType)) {
167
168
  debug('continue', { url: req.url(), resourceType })
168
- return req.continue(req.continueRequestOverrides(), 2)
169
+ return req.continue(req.continueRequestOverrides(), 0)
169
170
  }
170
171
  debug('abort', { url: req.url(), resourceType })
171
172
  return req.abort('blockedbyclient', 2)
@@ -277,7 +278,7 @@ module.exports = ({
277
278
 
278
279
  const { value } = await run({
279
280
  fn: html ? page.setContent(html, args) : page.goto(url, args),
280
- timeout: timeout * 0.9,
281
+ timeout: gotoTimeout,
281
282
  debug: html ? 'html' : 'url'
282
283
  })
283
284
 
@@ -288,7 +289,7 @@ module.exports = ({
288
289
  waitForTimeout
289
290
  })) {
290
291
  if (value) {
291
- await run({ fn: page[key](value), timeout: actionTimeout, debug: { [key]: value } })
292
+ await run({ fn: page[key](value), timeout: gotoTimeout, debug: { [key]: value } })
292
293
  }
293
294
  }
294
295