@browserless/goto 10.2.6 → 10.3.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 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.2.6",
5
+ "version": "10.3.0",
6
6
  "main": "src/index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -29,7 +29,7 @@
29
29
  "puppeteer"
30
30
  ],
31
31
  "dependencies": {
32
- "@browserless/devices": "^10.2.5",
32
+ "@browserless/devices": "^10.3.0",
33
33
  "@cliqz/adblocker-puppeteer": "~1.26.15",
34
34
  "@kikobeats/time-span": "~1.0.3",
35
35
  "debug-logfmt": "~1.2.1",
@@ -42,8 +42,8 @@
42
42
  "tough-cookie": "~4.1.3"
43
43
  },
44
44
  "devDependencies": {
45
- "@browserless/test": "^10.2.4",
46
- "ava": "latest",
45
+ "@browserless/test": "^10.3.0",
46
+ "ava": "5",
47
47
  "p-wait-for": "3"
48
48
  },
49
49
  "engines": {
@@ -62,7 +62,7 @@
62
62
  "timeout": "2m",
63
63
  "workerThreads": false
64
64
  },
65
- "gitHead": "316b9d9d779ef5082310c0bbe8626f0ebcccaac0",
65
+ "gitHead": "6de02ac566c97aa7f31a3faaca0a02668884cd9c",
66
66
  "scripts": {
67
67
  "postinstall": "node scripts/postinstall",
68
68
  "test": "ava"
package/src/engine.bin CHANGED
Binary file
package/src/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  const { PuppeteerBlocker } = require('@cliqz/adblocker-puppeteer')
4
4
  const { shallowEqualObjects } = require('shallow-equal')
5
+ const { setTimeout } = require('node:timers/promises')
5
6
  const createDevices = require('@browserless/devices')
6
7
  const toughCookie = require('tough-cookie')
7
8
  const pReflect = require('p-reflect')
@@ -203,7 +204,6 @@ module.exports = ({ defaultDevice = 'Macbook Pro 13', timeout: globalTimeout, ..
203
204
  waitForFunction,
204
205
  waitForSelector,
205
206
  waitForTimeout,
206
- waitForXPath,
207
207
  waitUntil = 'auto',
208
208
  waitUntilAuto = _waitUntilAuto,
209
209
  onPageRequest,
@@ -370,15 +370,17 @@ module.exports = ({ defaultDevice = 'Macbook Pro 13', timeout: globalTimeout, ..
370
370
 
371
371
  for (const [key, value] of Object.entries({
372
372
  waitForSelector,
373
- waitForXPath,
374
- waitForFunction,
375
- waitForTimeout
373
+ waitForFunction
376
374
  })) {
377
375
  if (value) {
378
376
  await run({ fn: page[key](value), timeout: gotoTimeout, debug: { [key]: value } })
379
377
  }
380
378
  }
381
379
 
380
+ if (waitForTimeout) {
381
+ await setTimeout(waitForTimeout)
382
+ }
383
+
382
384
  await inject(page, {
383
385
  timeout: actionTimeout,
384
386
  mediaType,