@browserless.io/browserless 2.32.0 → 2.32.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/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/build/routes/edge/http/content.post.body.json +8 -8
- package/build/routes/edge/http/pdf.post.body.json +8 -8
- package/build/routes/edge/http/scrape.post.body.json +8 -8
- package/build/routes/edge/http/screenshot.post.body.json +8 -8
- package/build/routes/edge/tests/websocket.spec.js +1 -1
- package/build/shim.js +1 -1
- package/build/shim.spec.js +14 -0
- package/package.json +4 -4
- package/scripts/build-schemas.js +1 -1
- package/src/routes/edge/tests/websocket.spec.ts +1 -1
- package/src/shim.spec.ts +18 -0
- package/src/shim.ts +1 -1
- package/static/docs/swagger.json +10 -10
- package/static/docs/swagger.min.json +9 -9
|
@@ -566,14 +566,14 @@
|
|
|
566
566
|
"length": {
|
|
567
567
|
"type": "number"
|
|
568
568
|
},
|
|
569
|
-
"__@toStringTag@
|
|
569
|
+
"__@toStringTag@526652": {
|
|
570
570
|
"type": "string",
|
|
571
571
|
"const": "Uint8Array"
|
|
572
572
|
}
|
|
573
573
|
},
|
|
574
574
|
"required": [
|
|
575
575
|
"BYTES_PER_ELEMENT",
|
|
576
|
-
"__@toStringTag@
|
|
576
|
+
"__@toStringTag@526652",
|
|
577
577
|
"buffer",
|
|
578
578
|
"byteLength",
|
|
579
579
|
"byteOffset",
|
|
@@ -608,13 +608,13 @@
|
|
|
608
608
|
"byteLength": {
|
|
609
609
|
"type": "number"
|
|
610
610
|
},
|
|
611
|
-
"__@toStringTag@
|
|
611
|
+
"__@toStringTag@526652": {
|
|
612
612
|
"type": "string"
|
|
613
613
|
}
|
|
614
614
|
},
|
|
615
615
|
"additionalProperties": false,
|
|
616
616
|
"required": [
|
|
617
|
-
"__@toStringTag@
|
|
617
|
+
"__@toStringTag@526652",
|
|
618
618
|
"byteLength"
|
|
619
619
|
]
|
|
620
620
|
},
|
|
@@ -624,18 +624,18 @@
|
|
|
624
624
|
"byteLength": {
|
|
625
625
|
"type": "number"
|
|
626
626
|
},
|
|
627
|
-
"__@species@
|
|
627
|
+
"__@species@535555": {
|
|
628
628
|
"$ref": "#/definitions/SharedArrayBuffer"
|
|
629
629
|
},
|
|
630
|
-
"__@toStringTag@
|
|
630
|
+
"__@toStringTag@526652": {
|
|
631
631
|
"type": "string",
|
|
632
632
|
"const": "SharedArrayBuffer"
|
|
633
633
|
}
|
|
634
634
|
},
|
|
635
635
|
"additionalProperties": false,
|
|
636
636
|
"required": [
|
|
637
|
-
"__@species@
|
|
638
|
-
"__@toStringTag@
|
|
637
|
+
"__@species@535555",
|
|
638
|
+
"__@toStringTag@526652",
|
|
639
639
|
"byteLength"
|
|
640
640
|
]
|
|
641
641
|
},
|
|
@@ -160,7 +160,7 @@ describe('Edge WebSocket API', function () {
|
|
|
160
160
|
await sleep(1000);
|
|
161
161
|
expect(await exists(userDataDir)).to.be.false;
|
|
162
162
|
});
|
|
163
|
-
it('allows specified user-data-dirs', async () => {
|
|
163
|
+
it.skip('allows specified user-data-dirs', async () => {
|
|
164
164
|
const dataDir = '/tmp/data-dir';
|
|
165
165
|
const config = new Config();
|
|
166
166
|
config.setToken('browserless');
|
package/build/shim.js
CHANGED
|
@@ -13,7 +13,7 @@ export function shimLegacyRequests(url) {
|
|
|
13
13
|
const params = [...searchParams];
|
|
14
14
|
const names = params.map(([k]) => k);
|
|
15
15
|
const cliSwitches = params.filter(([name]) => name.startsWith('--'));
|
|
16
|
-
const hasLegacyParams = cliSwitches || shimParam.some((name) => names.includes(name));
|
|
16
|
+
const hasLegacyParams = cliSwitches.length || shimParam.some((name) => names.includes(name));
|
|
17
17
|
if (hasLegacyParams) {
|
|
18
18
|
const launchParams = safeParse(convertIfBase64(searchParams.get('launch') || '{}')) || {};
|
|
19
19
|
const ignoreDefaultArgs = searchParams.get('ignoreDefaultArgs') ?? launchParams.ignoreDefaultArgs;
|
package/build/shim.spec.js
CHANGED
|
@@ -111,4 +111,18 @@ describe('Request Shimming', () => {
|
|
|
111
111
|
expect(decodeURIComponent(shimmed.href)).to.equal(final);
|
|
112
112
|
});
|
|
113
113
|
});
|
|
114
|
+
describe('no params', () => {
|
|
115
|
+
it('does not alter URLS when no params are set', () => {
|
|
116
|
+
const url = 'wss://localhost';
|
|
117
|
+
const final = 'wss://localhost/';
|
|
118
|
+
const shimmed = shimLegacyRequests(new URL(url));
|
|
119
|
+
expect(decodeURIComponent(shimmed.href)).to.equal(final);
|
|
120
|
+
});
|
|
121
|
+
it('does not alter URLS when unknown params are set', () => {
|
|
122
|
+
const url = 'wss://localhost?silly=banana';
|
|
123
|
+
const final = 'wss://localhost/?silly=banana';
|
|
124
|
+
const shimmed = shimLegacyRequests(new URL(url));
|
|
125
|
+
expect(decodeURIComponent(shimmed.href)).to.equal(final);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
114
128
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@browserless.io/browserless",
|
|
3
|
-
"version": "2.32.
|
|
3
|
+
"version": "2.32.1",
|
|
4
4
|
"license": "SSPL",
|
|
5
5
|
"description": "The browserless platform",
|
|
6
6
|
"author": "browserless.io",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@types/http-proxy": "^1.17.16",
|
|
79
79
|
"@types/micromatch": "^4.0.9",
|
|
80
80
|
"@types/mocha": "^10.0.10",
|
|
81
|
-
"@types/node": "^24.0.
|
|
81
|
+
"@types/node": "^24.0.4",
|
|
82
82
|
"@types/sinon": "^17.0.4",
|
|
83
83
|
"@typescript-eslint/eslint-plugin": "^8.35.0",
|
|
84
84
|
"@typescript-eslint/parser": "^8.34.1",
|
|
@@ -92,9 +92,9 @@
|
|
|
92
92
|
"extract-zip": "^2.0.1",
|
|
93
93
|
"gunzip-maybe": "^1.4.2",
|
|
94
94
|
"marked": "^15.0.12",
|
|
95
|
-
"mocha": "^11.7.
|
|
95
|
+
"mocha": "^11.7.1",
|
|
96
96
|
"move-file": "^3.1.0",
|
|
97
|
-
"prettier": "^3.6.
|
|
97
|
+
"prettier": "^3.6.1",
|
|
98
98
|
"sinon": "^21.0.0",
|
|
99
99
|
"ts-node": "^10.9.2",
|
|
100
100
|
"typescript": "^5.8.3",
|
package/scripts/build-schemas.js
CHANGED
|
@@ -98,7 +98,7 @@ const buildSchemas = async (
|
|
|
98
98
|
schemas.map((schemaName) => {
|
|
99
99
|
if (findExportedInterface(sourceFile, schemaName)) {
|
|
100
100
|
const routePath = path.parse(route);
|
|
101
|
-
const routeName = routePath.name.
|
|
101
|
+
const routeName = routePath.name.slice(0, -2); // drop the ending .d
|
|
102
102
|
const schemaSuffix = schemaName
|
|
103
103
|
.replace('Schema', '')
|
|
104
104
|
.toLocaleLowerCase();
|
|
@@ -221,7 +221,7 @@ describe('Edge WebSocket API', function () {
|
|
|
221
221
|
expect(await exists(userDataDir)).to.be.false;
|
|
222
222
|
});
|
|
223
223
|
|
|
224
|
-
it('allows specified user-data-dirs', async () => {
|
|
224
|
+
it.skip('allows specified user-data-dirs', async () => {
|
|
225
225
|
const dataDir = '/tmp/data-dir';
|
|
226
226
|
const config = new Config();
|
|
227
227
|
config.setToken('browserless');
|
package/src/shim.spec.ts
CHANGED
|
@@ -151,4 +151,22 @@ describe('Request Shimming', () => {
|
|
|
151
151
|
expect(decodeURIComponent(shimmed.href)).to.equal(final);
|
|
152
152
|
});
|
|
153
153
|
});
|
|
154
|
+
|
|
155
|
+
describe('no params', () => {
|
|
156
|
+
it('does not alter URLS when no params are set', () => {
|
|
157
|
+
const url = 'wss://localhost';
|
|
158
|
+
const final = 'wss://localhost/';
|
|
159
|
+
const shimmed = shimLegacyRequests(new URL(url));
|
|
160
|
+
|
|
161
|
+
expect(decodeURIComponent(shimmed.href)).to.equal(final);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it('does not alter URLS when unknown params are set', () => {
|
|
165
|
+
const url = 'wss://localhost?silly=banana';
|
|
166
|
+
const final = 'wss://localhost/?silly=banana';
|
|
167
|
+
const shimmed = shimLegacyRequests(new URL(url));
|
|
168
|
+
|
|
169
|
+
expect(decodeURIComponent(shimmed.href)).to.equal(final);
|
|
170
|
+
});
|
|
171
|
+
});
|
|
154
172
|
});
|
package/src/shim.ts
CHANGED
|
@@ -21,7 +21,7 @@ export function shimLegacyRequests(url: URL): URL {
|
|
|
21
21
|
|
|
22
22
|
const cliSwitches = params.filter(([name]) => name.startsWith('--'));
|
|
23
23
|
const hasLegacyParams =
|
|
24
|
-
cliSwitches || shimParam.some((name) => names.includes(name));
|
|
24
|
+
cliSwitches.length || shimParam.some((name) => names.includes(name));
|
|
25
25
|
|
|
26
26
|
if (hasLegacyParams) {
|
|
27
27
|
const launchParams: CDPLaunchOptions =
|