@browserless.io/browserless 2.22.0 → 2.24.0-beta-1
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/CHANGELOG.md +7 -1
- package/build/browsers/browsers.cdp.js +12 -2
- package/build/routes/chrome/http/content.post.body.json +8 -8
- package/build/routes/chrome/http/pdf.post.body.json +8 -8
- package/build/routes/chrome/http/scrape.post.body.json +8 -8
- package/build/routes/chrome/http/screenshot.post.body.json +8 -8
- package/build/routes/chromium/http/content.post.body.json +8 -8
- package/build/routes/chromium/http/pdf.post.body.json +8 -8
- package/build/routes/chromium/http/scrape.post.body.json +8 -8
- package/build/routes/chromium/http/screenshot.post.body.json +8 -8
- package/docker/chrome/Dockerfile +2 -1
- package/docker/chromium/Dockerfile +2 -1
- package/docker/firefox/Dockerfile +2 -1
- package/docker/multi/Dockerfile +3 -1
- package/docker/webkit/Dockerfile +2 -1
- package/extensions/ublock/_locales/ar/messages.json +5 -1
- package/extensions/ublock/_locales/az/messages.json +4 -0
- package/extensions/ublock/_locales/be/messages.json +5 -1
- package/extensions/ublock/_locales/bg/messages.json +4 -0
- package/extensions/ublock/_locales/bn/messages.json +4 -0
- package/extensions/ublock/_locales/br_FR/messages.json +4 -0
- package/extensions/ublock/_locales/bs/messages.json +4 -0
- package/extensions/ublock/_locales/ca/messages.json +4 -0
- package/extensions/ublock/_locales/cs/messages.json +6 -2
- package/extensions/ublock/_locales/cv/messages.json +4 -0
- package/extensions/ublock/_locales/cy/messages.json +15 -11
- package/extensions/ublock/_locales/da/messages.json +4 -0
- package/extensions/ublock/_locales/de/messages.json +8 -4
- package/extensions/ublock/_locales/el/messages.json +4 -0
- package/extensions/ublock/_locales/en/messages.json +4 -0
- package/extensions/ublock/_locales/en_GB/messages.json +4 -0
- package/extensions/ublock/_locales/eo/messages.json +4 -0
- package/extensions/ublock/_locales/es/messages.json +5 -1
- package/extensions/ublock/_locales/et/messages.json +4 -0
- package/extensions/ublock/_locales/eu/messages.json +4 -0
- package/extensions/ublock/_locales/fa/messages.json +14 -10
- package/extensions/ublock/_locales/fi/messages.json +7 -3
- package/extensions/ublock/_locales/fil/messages.json +4 -0
- package/extensions/ublock/_locales/fr/messages.json +5 -1
- package/extensions/ublock/_locales/fy/messages.json +4 -0
- package/extensions/ublock/_locales/gl/messages.json +4 -0
- package/extensions/ublock/_locales/gu/messages.json +4 -0
- package/extensions/ublock/_locales/he/messages.json +4 -0
- package/extensions/ublock/_locales/hi/messages.json +4 -0
- package/extensions/ublock/_locales/hr/messages.json +4 -0
- package/extensions/ublock/_locales/hu/messages.json +4 -0
- package/extensions/ublock/_locales/hy/messages.json +4 -0
- package/extensions/ublock/_locales/id/messages.json +4 -0
- package/extensions/ublock/_locales/it/messages.json +4 -0
- package/extensions/ublock/_locales/ja/messages.json +6 -2
- package/extensions/ublock/_locales/ka/messages.json +5 -1
- package/extensions/ublock/_locales/kk/messages.json +4 -0
- package/extensions/ublock/_locales/kn/messages.json +4 -0
- package/extensions/ublock/_locales/ko/messages.json +5 -1
- package/extensions/ublock/_locales/lt/messages.json +4 -0
- package/extensions/ublock/_locales/lv/messages.json +4 -0
- package/extensions/ublock/_locales/mk/messages.json +4 -0
- package/extensions/ublock/_locales/ml/messages.json +4 -0
- package/extensions/ublock/_locales/mr/messages.json +4 -0
- package/extensions/ublock/_locales/ms/messages.json +4 -0
- package/extensions/ublock/_locales/nb/messages.json +4 -0
- package/extensions/ublock/_locales/nl/messages.json +4 -0
- package/extensions/ublock/_locales/no/messages.json +4 -0
- package/extensions/ublock/_locales/oc/messages.json +4 -0
- package/extensions/ublock/_locales/pa/messages.json +5 -1
- package/extensions/ublock/_locales/pl/messages.json +4 -0
- package/extensions/ublock/_locales/pt_BR/messages.json +4 -0
- package/extensions/ublock/_locales/pt_PT/messages.json +4 -0
- package/extensions/ublock/_locales/ro/messages.json +4 -0
- package/extensions/ublock/_locales/ru/messages.json +5 -1
- package/extensions/ublock/_locales/si/messages.json +4 -0
- package/extensions/ublock/_locales/sk/messages.json +4 -0
- package/extensions/ublock/_locales/sl/messages.json +4 -0
- package/extensions/ublock/_locales/so/messages.json +4 -0
- package/extensions/ublock/_locales/sq/messages.json +4 -0
- package/extensions/ublock/_locales/sr/messages.json +4 -0
- package/extensions/ublock/_locales/sv/messages.json +5 -1
- package/extensions/ublock/_locales/sw/messages.json +4 -0
- package/extensions/ublock/_locales/ta/messages.json +4 -0
- package/extensions/ublock/_locales/te/messages.json +4 -0
- package/extensions/ublock/_locales/th/messages.json +4 -0
- package/extensions/ublock/_locales/tr/messages.json +4 -0
- package/extensions/ublock/_locales/uk/messages.json +7 -3
- package/extensions/ublock/_locales/ur/messages.json +4 -0
- package/extensions/ublock/_locales/vi/messages.json +4 -0
- package/extensions/ublock/_locales/zh_CN/messages.json +4 -0
- package/extensions/ublock/_locales/zh_TW/messages.json +4 -0
- package/extensions/ublock/assets/assets.json +14 -14
- package/extensions/ublock/assets/resources/run-at.js +80 -0
- package/extensions/ublock/assets/resources/safe-self.js +218 -0
- package/extensions/ublock/assets/resources/scriptlets.js +461 -538
- package/extensions/ublock/assets/resources/set-attr.js +201 -0
- package/extensions/ublock/assets/thirdparties/easylist/easylist.txt +4002 -11582
- package/extensions/ublock/assets/thirdparties/easylist/easyprivacy.txt +257 -83
- package/extensions/ublock/assets/thirdparties/pgl.yoyo.org/as/serverlist +22 -38
- package/extensions/ublock/assets/thirdparties/publicsuffix.org/list/effective_tld_names.dat +102 -110
- package/extensions/ublock/assets/thirdparties/urlhaus-filter/urlhaus-filter-online.txt +2776 -3613
- package/extensions/ublock/assets/ublock/badware.min.txt +581 -382
- package/extensions/ublock/assets/ublock/filters.min.txt +997 -990
- package/extensions/ublock/assets/ublock/privacy.min.txt +145 -26
- package/extensions/ublock/assets/ublock/quick-fixes.min.txt +134 -83
- package/extensions/ublock/assets/ublock/unbreak.min.txt +69 -46
- package/extensions/ublock/css/document-blocked.css +28 -1
- package/extensions/ublock/document-blocked.html +9 -7
- package/extensions/ublock/js/assets.js +15 -11
- package/extensions/ublock/js/benchmarks.js +13 -9
- package/extensions/ublock/js/biditrie.js +1 -1
- package/extensions/ublock/js/document-blocked.js +41 -5
- package/extensions/ublock/js/hntrie.js +1 -1
- package/extensions/ublock/js/i18n.js +2 -4
- package/extensions/ublock/js/pagestore.js +61 -43
- package/extensions/ublock/js/s14e-serializer.js +47 -22
- package/extensions/ublock/js/scriptlet-filtering.js +21 -18
- package/extensions/ublock/js/scriptlets/load-large-media-interactive.js +61 -48
- package/extensions/ublock/js/scriptlets/should-inject-contentscript.js +1 -3
- package/extensions/ublock/js/static-dnr-filtering.js +9 -7
- package/extensions/ublock/js/static-filtering-parser.js +87 -54
- package/extensions/ublock/js/static-net-filtering.js +118 -42
- package/extensions/ublock/js/traffic.js +37 -18
- package/extensions/ublock/js/vapi-background-ext.js +21 -49
- package/extensions/ublock/js/vapi-background.js +8 -0
- package/extensions/ublock/manifest.json +1 -1
- package/extensions/ublock/web_accessible_resources/googlesyndication_adsbygoogle.js +3 -1
- package/package.json +18 -18
- package/src/browsers/browsers.cdp.ts +13 -2
- package/static/docs/swagger.json +10 -10
- package/static/docs/swagger.min.json +9 -9
- package/static/function/client.js +175 -129
- package/static/function/index.html +175 -129
|
@@ -19,10 +19,6 @@
|
|
|
19
19
|
Home: https://github.com/gorhill/uBlock
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
/* globals browser */
|
|
23
|
-
|
|
24
|
-
'use strict';
|
|
25
|
-
|
|
26
22
|
/******************************************************************************/
|
|
27
23
|
|
|
28
24
|
// https://github.com/uBlockOrigin/uBlock-issues/issues/1659
|
|
@@ -90,71 +86,47 @@ vAPI.Tabs = class extends vAPI.Tabs {
|
|
|
90
86
|
['gif','image'],['ico','image'],['jpeg','image'],['jpg','image'],['png','image'],['webp','image']
|
|
91
87
|
]);
|
|
92
88
|
|
|
93
|
-
const headerValue = (headers, name) => {
|
|
94
|
-
let i = headers.length;
|
|
95
|
-
while ( i-- ) {
|
|
96
|
-
if ( headers[i].name.toLowerCase() === name ) {
|
|
97
|
-
return headers[i].value.trim();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return '';
|
|
101
|
-
};
|
|
102
|
-
|
|
103
89
|
const parsedURL = new URL('https://www.example.org/');
|
|
104
90
|
|
|
105
|
-
// Extend base class to normalize as per platform
|
|
91
|
+
// Extend base class to normalize as per platform
|
|
106
92
|
|
|
107
93
|
vAPI.Net = class extends vAPI.Net {
|
|
108
94
|
normalizeDetails(details) {
|
|
109
95
|
// Chromium 63+ supports the `initiator` property, which contains
|
|
110
|
-
// the URL of the origin from which the network request was made
|
|
111
|
-
if (
|
|
112
|
-
typeof details.initiator === 'string' &&
|
|
113
|
-
details.initiator !== 'null'
|
|
114
|
-
) {
|
|
96
|
+
// the URL of the origin from which the network request was made
|
|
97
|
+
if ( details.initiator && details.initiator !== 'null' ) {
|
|
115
98
|
details.documentUrl = details.initiator;
|
|
116
99
|
}
|
|
117
|
-
|
|
118
|
-
let type = details.type;
|
|
119
|
-
|
|
100
|
+
const type = details.type;
|
|
120
101
|
if ( type === 'imageset' ) {
|
|
121
102
|
details.type = 'image';
|
|
122
103
|
return;
|
|
123
104
|
}
|
|
124
|
-
|
|
125
|
-
// The rest of the function code is to normalize type
|
|
126
105
|
if ( type !== 'other' ) { return; }
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
106
|
+
// Try to map known "extension" part of URL to request type
|
|
107
|
+
if ( details.responseHeaders === undefined ) {
|
|
108
|
+
parsedURL.href = details.url;
|
|
109
|
+
const path = parsedURL.pathname;
|
|
110
|
+
const pos = path.indexOf('.', path.length - 6);
|
|
111
|
+
if ( pos !== -1 ) {
|
|
112
|
+
details.type = extToTypeMap.get(path.slice(pos + 1)) || type;
|
|
113
|
+
}
|
|
134
114
|
return;
|
|
135
115
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (
|
|
139
|
-
type =
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
if ( type.startsWith('image/') ) {
|
|
145
|
-
details.type = 'image';
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
if ( type.startsWith('audio/') || type.startsWith('video/') ) {
|
|
149
|
-
details.type = 'media';
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
116
|
+
// Try to extract type from response headers
|
|
117
|
+
const ctype = this.headerValue(details.responseHeaders, 'content-type');
|
|
118
|
+
if ( ctype.startsWith('font/') ) {
|
|
119
|
+
details.type = 'font';
|
|
120
|
+
} else if ( ctype.startsWith('image/') ) {
|
|
121
|
+
details.type = 'image';
|
|
122
|
+
} else if ( ctype.startsWith('audio/') || ctype.startsWith('video/') ) {
|
|
123
|
+
details.type = 'media';
|
|
152
124
|
}
|
|
153
125
|
}
|
|
154
126
|
|
|
155
127
|
// https://www.reddit.com/r/uBlockOrigin/comments/9vcrk3/
|
|
156
128
|
// Some types can be mapped from 'other', thus include 'other' if and
|
|
157
|
-
// only if the caller is interested in at least one of those types
|
|
129
|
+
// only if the caller is interested in at least one of those types
|
|
158
130
|
denormalizeTypes(types) {
|
|
159
131
|
if ( types.length === 0 ) {
|
|
160
132
|
return Array.from(this.validTypes);
|
|
@@ -1382,6 +1382,14 @@ vAPI.Net = class {
|
|
|
1382
1382
|
if ( this.suspendDepth !== 0 ) { return; }
|
|
1383
1383
|
this.unsuspendAllRequests(discard);
|
|
1384
1384
|
}
|
|
1385
|
+
headerValue(headers, name) {
|
|
1386
|
+
for ( const header of headers ) {
|
|
1387
|
+
if ( header.name.toLowerCase() === name ) {
|
|
1388
|
+
return header.value.trim();
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
return '';
|
|
1392
|
+
}
|
|
1385
1393
|
static canSuspend() {
|
|
1386
1394
|
return false;
|
|
1387
1395
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@browserless.io/browserless",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.24.0-beta-1",
|
|
4
4
|
"license": "SSPL",
|
|
5
5
|
"description": "The browserless platform",
|
|
6
6
|
"author": "browserless.io",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dev": "npm run build:dev && env-cmd -f .env node build",
|
|
26
26
|
"install:adblock": "node scripts/install-adblock.js",
|
|
27
27
|
"install:debugger": "node scripts/install-debugger.js",
|
|
28
|
-
"install:browsers": "
|
|
28
|
+
"install:browsers": "node node_modules/playwright-core/cli.js install chromium firefox webkit",
|
|
29
29
|
"install:dev": "npm run install:browsers && npm run install:debugger",
|
|
30
30
|
"lint": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint . --ext .ts --fix",
|
|
31
31
|
"prepack": "npm run build:dev",
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"get-port": "^7.1.0",
|
|
56
56
|
"gradient-string": "^3.0.0",
|
|
57
57
|
"http-proxy": "^1.18.1",
|
|
58
|
-
"lighthouse": "^12.2.
|
|
58
|
+
"lighthouse": "^12.2.2",
|
|
59
59
|
"micromatch": "^4.0.8",
|
|
60
|
-
"playwright-1.44": "npm:playwright-core@1.44.1",
|
|
61
60
|
"playwright-1.45": "npm:playwright-core@1.45.3",
|
|
62
61
|
"playwright-1.46": "npm:playwright-core@1.46.1",
|
|
63
62
|
"playwright-1.47": "npm:playwright-core@1.47.2",
|
|
64
|
-
"playwright-
|
|
65
|
-
"
|
|
63
|
+
"playwright-1.48": "npm:playwright-core@1.48.2",
|
|
64
|
+
"playwright-core": "^1.49.0",
|
|
65
|
+
"puppeteer-core": "^23.9.0",
|
|
66
66
|
"puppeteer-extra": "^3.3.6",
|
|
67
67
|
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
|
68
68
|
"queue": "^7.0.0",
|
|
@@ -70,27 +70,27 @@
|
|
|
70
70
|
"tar-fs": "^3.0.6"
|
|
71
71
|
},
|
|
72
72
|
"optionalDependencies": {
|
|
73
|
-
"@types/chai": "^5.0.
|
|
73
|
+
"@types/chai": "^5.0.1",
|
|
74
74
|
"@types/debug": "^4.1.12",
|
|
75
75
|
"@types/gradient-string": "^1.1.6",
|
|
76
76
|
"@types/http-proxy": "^1.17.15",
|
|
77
77
|
"@types/micromatch": "^4.0.9",
|
|
78
|
-
"@types/mocha": "^10.0.
|
|
79
|
-
"@types/node": "^22.
|
|
78
|
+
"@types/mocha": "^10.0.10",
|
|
79
|
+
"@types/node": "^22.9.1",
|
|
80
80
|
"@types/sinon": "^17.0.3",
|
|
81
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
82
|
-
"@typescript-eslint/parser": "^8.
|
|
81
|
+
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
|
82
|
+
"@typescript-eslint/parser": "^8.15.0",
|
|
83
83
|
"assert": "^2.0.0",
|
|
84
|
-
"chai": "^5.1.
|
|
84
|
+
"chai": "^5.1.2",
|
|
85
85
|
"cross-env": "^7.0.3",
|
|
86
86
|
"env-cmd": "^10.1.0",
|
|
87
87
|
"esbuild": "^0.24.0",
|
|
88
88
|
"esbuild-plugin-polyfill-node": "^0.3.0",
|
|
89
|
-
"eslint": "^9.
|
|
89
|
+
"eslint": "^9.14.0",
|
|
90
90
|
"extract-zip": "^2.0.1",
|
|
91
91
|
"gunzip-maybe": "^1.4.2",
|
|
92
|
-
"marked": "^
|
|
93
|
-
"mocha": "^10.
|
|
92
|
+
"marked": "^15.0.2",
|
|
93
|
+
"mocha": "^10.8.2",
|
|
94
94
|
"move-file": "^3.1.0",
|
|
95
95
|
"prettier": "^3.3.3",
|
|
96
96
|
"sinon": "^19.0.2",
|
|
@@ -100,11 +100,11 @@
|
|
|
100
100
|
},
|
|
101
101
|
"playwrightVersions": {
|
|
102
102
|
"default": "playwright-core",
|
|
103
|
-
"1.
|
|
103
|
+
"1.49": "playwright-core",
|
|
104
|
+
"1.48": "playwright-1.48",
|
|
104
105
|
"1.47": "playwright-1.47",
|
|
105
106
|
"1.46": "playwright-1.46",
|
|
106
|
-
"1.45": "playwright-1.45"
|
|
107
|
-
"1.44": "playwright-1.44"
|
|
107
|
+
"1.45": "playwright-1.45"
|
|
108
108
|
},
|
|
109
109
|
"eslintConfig": {
|
|
110
110
|
"root": true,
|
|
@@ -195,11 +195,22 @@ export class ChromiumCDP extends EventEmitter {
|
|
|
195
195
|
|
|
196
196
|
// Bypass the host we bind to so things like /function can work with proxies
|
|
197
197
|
if (options.args?.some((arg) => arg.includes('--proxy-server'))) {
|
|
198
|
-
const
|
|
198
|
+
const defaultBypassList = [
|
|
199
199
|
this.config.getHost(),
|
|
200
200
|
new URL(this.config.getExternalAddress()).hostname,
|
|
201
201
|
];
|
|
202
|
-
options.args
|
|
202
|
+
const bypassProxyListIdx = options.args?.findIndex((arg) =>
|
|
203
|
+
arg.includes('--proxy-bypass-list'),
|
|
204
|
+
);
|
|
205
|
+
if (bypassProxyListIdx !== -1) {
|
|
206
|
+
options.args[bypassProxyListIdx] =
|
|
207
|
+
`--proxy-bypass-list=` +
|
|
208
|
+
[options.args[bypassProxyListIdx].split('=')[1], ...defaultBypassList]
|
|
209
|
+
.filter((_) => !!_)
|
|
210
|
+
.join(';');
|
|
211
|
+
} else {
|
|
212
|
+
options.args.push(`--proxy-bypass-list=${defaultBypassList.join(';')}`);
|
|
213
|
+
}
|
|
203
214
|
}
|
|
204
215
|
|
|
205
216
|
const finalOptions = {
|