@browserless/goto 10.10.2 → 10.11.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 +2 -2
- package/src/adblock.js +3 -3
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@browserless/goto",
|
|
3
3
|
"description": "Navigate to web pages with built-in ad blocking, device emulation, and optimized loading for faster automation.",
|
|
4
4
|
"homepage": "https://browserless.js.org/#/?id=gotopage-options",
|
|
5
|
-
"version": "10.
|
|
5
|
+
"version": "10.11.0",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "hello@microlink.io",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"timeout": "2m",
|
|
67
67
|
"workerThreads": false
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "e6bd03bae91b08baaa6f1c0c0c9743f6c7de3d29"
|
|
70
70
|
}
|
package/src/adblock.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const { PuppeteerBlocker } = require('@ghostery/adblocker-puppeteer')
|
|
4
|
+
const fs = require('fs/promises')
|
|
4
5
|
const path = require('path')
|
|
5
|
-
const fs = require('fs')
|
|
6
6
|
|
|
7
7
|
const debug = require('debug-logfmt')('browserless:goto:adblock')
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@ let enginePromise
|
|
|
11
11
|
const getEngine = () => {
|
|
12
12
|
if (enginePromise) return enginePromise
|
|
13
13
|
|
|
14
|
-
enginePromise = fs.
|
|
14
|
+
enginePromise = fs.readFile(path.resolve(__dirname, './engine.bin')).then(buffer => {
|
|
15
15
|
const engine = PuppeteerBlocker.deserialize(new Uint8Array(buffer))
|
|
16
16
|
engine.on('request-blocked', ({ url }) => debug('block', url))
|
|
17
17
|
engine.on('request-redirected', ({ url }) => debug('redirect', url))
|
|
@@ -31,7 +31,7 @@ let autoconsentPlaywrightScriptPromise
|
|
|
31
31
|
const getAutoconsentPlaywrightScript = () => {
|
|
32
32
|
if (autoconsentPlaywrightScriptPromise) return autoconsentPlaywrightScriptPromise
|
|
33
33
|
|
|
34
|
-
autoconsentPlaywrightScriptPromise = fs.
|
|
34
|
+
autoconsentPlaywrightScriptPromise = fs.readFile(
|
|
35
35
|
path.resolve(
|
|
36
36
|
path.dirname(require.resolve('@duckduckgo/autoconsent')),
|
|
37
37
|
'autoconsent.playwright.js'
|