@browserless/goto 10.1.18 → 10.2.1

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": "10.1.18",
5
+ "version": "10.2.1",
6
6
  "main": "src/index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -42,7 +42,7 @@
42
42
  "tough-cookie": "~4.1.3"
43
43
  },
44
44
  "devDependencies": {
45
- "@browserless/test": "^10.1.17",
45
+ "@browserless/test": "^10.2.1",
46
46
  "ava": "latest",
47
47
  "p-wait-for": "3"
48
48
  },
@@ -55,13 +55,14 @@
55
55
  ],
56
56
  "license": "MIT",
57
57
  "ava": {
58
+ "serial": true,
58
59
  "files": [
59
60
  "!test/fixtures"
60
61
  ],
61
62
  "timeout": "2m",
62
63
  "workerThreads": false
63
64
  },
64
- "gitHead": "f8e21e951876d99efcecf7415959aa13488e9c7e",
65
+ "gitHead": "0b578051040d09db17d9f03d49dc713ab70dc886",
65
66
  "scripts": {
66
67
  "postinstall": "node scripts/postinstall",
67
68
  "test": "ava"
package/src/engine.bin CHANGED
Binary file
package/src/index.js CHANGED
@@ -11,6 +11,8 @@ const isUrl = require('is-url-http')
11
11
  const path = require('path')
12
12
  const fs = require('fs')
13
13
 
14
+ const { DEFAULT_INTERCEPT_RESOLUTION_PRIORITY } = require('puppeteer')
15
+
14
16
  const debug = require('debug-logfmt')('browserless:goto')
15
17
  debug.continue = require('debug-logfmt')('browserless:goto:continue')
16
18
  debug.abort = require('debug-logfmt')('browserless:goto:abort')
@@ -253,10 +255,13 @@ module.exports = ({ defaultDevice = 'Macbook Pro 13', timeout: globalTimeout, ..
253
255
 
254
256
  if (!abortTypes.includes(resourceType)) {
255
257
  debug.continue({ url, resourceType })
256
- return req.continue(req.continueRequestOverrides(), 0)
258
+ return req.continue(
259
+ req.continueRequestOverrides(),
260
+ DEFAULT_INTERCEPT_RESOLUTION_PRIORITY
261
+ )
257
262
  }
258
263
  debug.abort({ url, resourceType })
259
- return req.abort('blockedbyclient', 0)
264
+ return req.abort('blockedbyclient', DEFAULT_INTERCEPT_RESOLUTION_PRIORITY)
260
265
  })
261
266
  })
262
267
  }
@@ -352,6 +357,8 @@ module.exports = ({ defaultDevice = 'Macbook Pro 13', timeout: globalTimeout, ..
352
357
  )
353
358
  }
354
359
 
360
+ await Promise.all(prePromises)
361
+
355
362
  const { value: response, reason: error } = await run({
356
363
  fn: html
357
364
  ? page.setContent(html, { waitUntil, ...args })