@browserless/goto 10.9.8 → 10.9.13
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 +3 -3
- package/src/index.js +14 -7
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.9.
|
|
5
|
+
"version": "10.9.13",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "hello@microlink.io",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"tough-cookie": "~6.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@browserless/test": "^10.9.
|
|
43
|
+
"@browserless/test": "^10.9.11",
|
|
44
44
|
"ava": "5",
|
|
45
45
|
"p-wait-for": "3"
|
|
46
46
|
},
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"timeout": "2m",
|
|
65
65
|
"workerThreads": false
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "e969604e95ff461609d38cabfd0c58adf30102da"
|
|
68
68
|
}
|
package/src/index.js
CHANGED
|
@@ -326,6 +326,8 @@ module.exports = ({ defaultDevice = 'Macbook Pro 13', timeout: globalTimeout, ..
|
|
|
326
326
|
const headersKeys = Object.keys(headers)
|
|
327
327
|
|
|
328
328
|
if (headersKeys.length > 0) {
|
|
329
|
+
const { cookie, ...headersWithoutCookie } = headers
|
|
330
|
+
|
|
329
331
|
if (headers.cookie) {
|
|
330
332
|
const cookies = parseCookies(url, headers.cookie)
|
|
331
333
|
prePromises.push(
|
|
@@ -337,6 +339,9 @@ module.exports = ({ defaultDevice = 'Macbook Pro 13', timeout: globalTimeout, ..
|
|
|
337
339
|
)
|
|
338
340
|
}
|
|
339
341
|
|
|
342
|
+
const extraHTTPHeaders = headers.cookie ? headersWithoutCookie : headers
|
|
343
|
+
const extraHTTPHeadersKeys = Object.keys(extraHTTPHeaders)
|
|
344
|
+
|
|
340
345
|
if (headers['user-agent']) {
|
|
341
346
|
prePromises.push(
|
|
342
347
|
run({
|
|
@@ -347,13 +352,15 @@ module.exports = ({ defaultDevice = 'Macbook Pro 13', timeout: globalTimeout, ..
|
|
|
347
352
|
)
|
|
348
353
|
}
|
|
349
354
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
if (extraHTTPHeadersKeys.length > 0) {
|
|
356
|
+
prePromises.push(
|
|
357
|
+
run({
|
|
358
|
+
fn: page.setExtraHTTPHeaders(extraHTTPHeaders),
|
|
359
|
+
timeout: actionTimeout,
|
|
360
|
+
debug: { headers: extraHTTPHeadersKeys }
|
|
361
|
+
})
|
|
362
|
+
)
|
|
363
|
+
}
|
|
357
364
|
}
|
|
358
365
|
|
|
359
366
|
if (timezone) {
|