@browserless/goto 9.6.0 → 9.6.2
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 +4 -4
- package/src/index.js +11 -1
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.6.
|
|
5
|
+
"version": "9.6.2",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "hello@microlink.io",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@browserless/test": "latest",
|
|
48
48
|
"ava": "3",
|
|
49
49
|
"browserless": "latest",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
50
|
+
"fpscanner": "latest",
|
|
51
|
+
"p-wait-for": "3"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">= 12"
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"timeout": "2m",
|
|
70
70
|
"verbose": true
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "e29ac9d5b86e7db27429130abc9689bbf39025dd"
|
|
73
73
|
}
|
package/src/index.js
CHANGED
|
@@ -121,7 +121,7 @@ const inject = async (page, { timeout, mediaType, animations, modules, scripts,
|
|
|
121
121
|
postPromises.push(
|
|
122
122
|
run({
|
|
123
123
|
fn: Promise.all(
|
|
124
|
-
castArray(modules).map(value => injectScript(page, value, { type: '
|
|
124
|
+
castArray(modules).map(value => injectScript(page, value, { type: 'module' }))
|
|
125
125
|
),
|
|
126
126
|
timeout,
|
|
127
127
|
debug: 'modules'
|
|
@@ -222,6 +222,16 @@ module.exports = ({
|
|
|
222
222
|
|
|
223
223
|
const prePromises = []
|
|
224
224
|
|
|
225
|
+
if (modules || scripts || styles) {
|
|
226
|
+
prePromises.push(
|
|
227
|
+
run({
|
|
228
|
+
fn: page.setBypassCSP(true),
|
|
229
|
+
timeout: actionTimeout,
|
|
230
|
+
debug: 'bypassCSP'
|
|
231
|
+
})
|
|
232
|
+
)
|
|
233
|
+
}
|
|
234
|
+
|
|
225
235
|
if (abortTypes.length > 0) {
|
|
226
236
|
await page.setRequestInterception(true)
|
|
227
237
|
page.on('request', req => {
|