@browserless/goto 9.3.0-beta.10 → 9.3.0-beta.11

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/index.js +7 -6
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.10",
5
+ "version": "9.3.0-beta.11",
6
6
  "main": "src/index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -68,5 +68,5 @@
68
68
  "timeout": "2m",
69
69
  "verbose": true
70
70
  },
71
- "gitHead": "195f7c7c39a4f04e74c2e4cd1b4c45bb4dec6166"
71
+ "gitHead": "5a93704c7fdb292fdf3a867299b3bfa4b095e701"
72
72
  }
package/src/index.js CHANGED
@@ -102,9 +102,9 @@ module.exports = ({
102
102
  const { viewport: defaultViewport } = getDevice.findDevice(defaultDevice)
103
103
 
104
104
  const timeouts = {
105
- base: (milliseconds = globalTimeout) => milliseconds * (1 / 2),
106
- action: (milliseconds = globalTimeout) => milliseconds * (1 / 8),
107
- goto: (milliseconds = globalTimeout) => milliseconds * 0.8
105
+ base: (milliseconds = globalTimeout) => milliseconds * (2 / 3),
106
+ action: (milliseconds = globalTimeout) => milliseconds * (1 / 11),
107
+ goto: (milliseconds = globalTimeout) => milliseconds * (7 / 8)
108
108
  }
109
109
 
110
110
  // related https://github.com/puppeteer/puppeteer/issues/1353
@@ -143,7 +143,7 @@ module.exports = ({
143
143
  scripts,
144
144
  scroll,
145
145
  styles,
146
- timeout = timeouts.base(globalTimeout),
146
+ timeout = globalTimeout,
147
147
  timezone,
148
148
  url,
149
149
  waitForFunction,
@@ -155,8 +155,9 @@ module.exports = ({
155
155
  ...args
156
156
  }
157
157
  ) => {
158
- const actionTimeout = timeouts.action(timeout)
159
- const gotoTimeout = timeouts.goto(timeout)
158
+ const baseTimeout = timeouts.base(globalTimeout)
159
+ const actionTimeout = timeouts.action(baseTimeout)
160
+ const gotoTimeout = timeouts.goto(baseTimeout)
160
161
 
161
162
  const isWaitUntilAuto = waitUntil === 'auto'
162
163
  if (isWaitUntilAuto) waitUntil = 'load'