@browserless.io/browserless 2.6.0 → 2.6.1-beta-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/build/browsers/chromium.cdp.js +7 -6
- package/build/browsers/chromium.playwright.js +7 -6
- package/build/browsers/firefox.playwright.js +7 -6
- package/build/browsers/webkit.playwright.js +7 -6
- 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/shared/utils/function/handler.js +3 -2
- package/package.json +1 -1
- package/scripts/build-function.js +42 -12
- package/src/browsers/chromium.cdp.ts +7 -6
- package/src/browsers/chromium.playwright.ts +7 -6
- package/src/browsers/firefox.playwright.ts +7 -6
- package/src/browsers/webkit.playwright.ts +7 -6
- package/src/server.ts +3 -1
- package/src/shared/utils/function/handler.ts +5 -2
- package/static/docs/swagger.json +1 -1
- package/static/docs/swagger.min.json +1 -1
- package/static/function/index.html +33094 -1
|
@@ -121,14 +121,15 @@ export class ChromiumCDP extends EventEmitter {
|
|
|
121
121
|
if (!this.browserWSEndpoint) {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
124
|
-
const
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
const externalURL = new URL(this.config.getExternalWebSocketAddress());
|
|
125
|
+
const internalURL = new URL(this.browserWSEndpoint);
|
|
126
|
+
internalURL.host = externalURL.host;
|
|
127
|
+
internalURL.port = externalURL.port;
|
|
128
|
+
internalURL.protocol = externalURL.protocol;
|
|
128
129
|
if (token) {
|
|
129
|
-
|
|
130
|
+
internalURL.searchParams.set('token', token);
|
|
130
131
|
}
|
|
131
|
-
return
|
|
132
|
+
return internalURL.href;
|
|
132
133
|
};
|
|
133
134
|
proxyPageWebSocket = async (req, socket, head) => new Promise(async (resolve, reject) => {
|
|
134
135
|
if (!this.browserWSEndpoint || !this.browser) {
|
|
@@ -68,14 +68,15 @@ export class ChromiumPlaywright extends EventEmitter {
|
|
|
68
68
|
if (!this.browserWSEndpoint) {
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
const externalURL = new URL(this.config.getExternalWebSocketAddress());
|
|
72
|
+
const internalURL = new URL(this.browserWSEndpoint);
|
|
73
|
+
internalURL.host = externalURL.host;
|
|
74
|
+
internalURL.port = externalURL.port;
|
|
75
|
+
internalURL.protocol = externalURL.protocol;
|
|
75
76
|
if (token) {
|
|
76
|
-
|
|
77
|
+
internalURL.searchParams.set('token', token);
|
|
77
78
|
}
|
|
78
|
-
return
|
|
79
|
+
return internalURL.href;
|
|
79
80
|
};
|
|
80
81
|
proxyPageWebSocket = async () => {
|
|
81
82
|
console.warn(`Not yet implemented`);
|
|
@@ -62,14 +62,15 @@ export class FirefoxPlaywright extends EventEmitter {
|
|
|
62
62
|
if (!this.browserWSEndpoint) {
|
|
63
63
|
return null;
|
|
64
64
|
}
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
const externalURL = new URL(this.config.getExternalWebSocketAddress());
|
|
66
|
+
const internalURL = new URL(this.browserWSEndpoint);
|
|
67
|
+
internalURL.host = externalURL.host;
|
|
68
|
+
internalURL.port = externalURL.port;
|
|
69
|
+
internalURL.protocol = externalURL.protocol;
|
|
69
70
|
if (token) {
|
|
70
|
-
|
|
71
|
+
internalURL.searchParams.set('token', token);
|
|
71
72
|
}
|
|
72
|
-
return
|
|
73
|
+
return internalURL.href;
|
|
73
74
|
};
|
|
74
75
|
proxyPageWebSocket = async () => {
|
|
75
76
|
console.warn(`Not yet implemented`);
|
|
@@ -62,14 +62,15 @@ export class WebkitPlaywright extends EventEmitter {
|
|
|
62
62
|
if (!this.browserWSEndpoint) {
|
|
63
63
|
return null;
|
|
64
64
|
}
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
const externalURL = new URL(this.config.getExternalWebSocketAddress());
|
|
66
|
+
const internalURL = new URL(this.browserWSEndpoint);
|
|
67
|
+
internalURL.host = externalURL.host;
|
|
68
|
+
internalURL.port = externalURL.port;
|
|
69
|
+
internalURL.protocol = externalURL.protocol;
|
|
69
70
|
if (token) {
|
|
70
|
-
|
|
71
|
+
internalURL.searchParams.set('token', token);
|
|
71
72
|
}
|
|
72
|
-
return
|
|
73
|
+
return internalURL.href;
|
|
73
74
|
};
|
|
74
75
|
proxyPageWebSocket = async () => {
|
|
75
76
|
console.warn(`Not yet implemented`);
|
|
@@ -535,14 +535,14 @@
|
|
|
535
535
|
"length": {
|
|
536
536
|
"type": "number"
|
|
537
537
|
},
|
|
538
|
-
"__@toStringTag@
|
|
538
|
+
"__@toStringTag@97790": {
|
|
539
539
|
"type": "string",
|
|
540
540
|
"const": "Uint8Array"
|
|
541
541
|
}
|
|
542
542
|
},
|
|
543
543
|
"required": [
|
|
544
544
|
"BYTES_PER_ELEMENT",
|
|
545
|
-
"__@toStringTag@
|
|
545
|
+
"__@toStringTag@97790",
|
|
546
546
|
"buffer",
|
|
547
547
|
"byteLength",
|
|
548
548
|
"byteOffset",
|
|
@@ -577,13 +577,13 @@
|
|
|
577
577
|
"byteLength": {
|
|
578
578
|
"type": "number"
|
|
579
579
|
},
|
|
580
|
-
"__@toStringTag@
|
|
580
|
+
"__@toStringTag@97790": {
|
|
581
581
|
"type": "string"
|
|
582
582
|
}
|
|
583
583
|
},
|
|
584
584
|
"additionalProperties": false,
|
|
585
585
|
"required": [
|
|
586
|
-
"__@toStringTag@
|
|
586
|
+
"__@toStringTag@97790",
|
|
587
587
|
"byteLength"
|
|
588
588
|
]
|
|
589
589
|
},
|
|
@@ -593,18 +593,18 @@
|
|
|
593
593
|
"byteLength": {
|
|
594
594
|
"type": "number"
|
|
595
595
|
},
|
|
596
|
-
"__@species@
|
|
596
|
+
"__@species@97891": {
|
|
597
597
|
"$ref": "#/definitions/SharedArrayBuffer"
|
|
598
598
|
},
|
|
599
|
-
"__@toStringTag@
|
|
599
|
+
"__@toStringTag@97790": {
|
|
600
600
|
"type": "string",
|
|
601
601
|
"const": "SharedArrayBuffer"
|
|
602
602
|
}
|
|
603
603
|
},
|
|
604
604
|
"additionalProperties": false,
|
|
605
605
|
"required": [
|
|
606
|
-
"__@species@
|
|
607
|
-
"__@toStringTag@
|
|
606
|
+
"__@species@97891",
|
|
607
|
+
"__@toStringTag@97790",
|
|
608
608
|
"byteLength"
|
|
609
609
|
]
|
|
610
610
|
},
|
|
@@ -441,14 +441,14 @@
|
|
|
441
441
|
"length": {
|
|
442
442
|
"type": "number"
|
|
443
443
|
},
|
|
444
|
-
"__@toStringTag@
|
|
444
|
+
"__@toStringTag@108884": {
|
|
445
445
|
"type": "string",
|
|
446
446
|
"const": "Uint8Array"
|
|
447
447
|
}
|
|
448
448
|
},
|
|
449
449
|
"required": [
|
|
450
450
|
"BYTES_PER_ELEMENT",
|
|
451
|
-
"__@toStringTag@
|
|
451
|
+
"__@toStringTag@108884",
|
|
452
452
|
"buffer",
|
|
453
453
|
"byteLength",
|
|
454
454
|
"byteOffset",
|
|
@@ -483,13 +483,13 @@
|
|
|
483
483
|
"byteLength": {
|
|
484
484
|
"type": "number"
|
|
485
485
|
},
|
|
486
|
-
"__@toStringTag@
|
|
486
|
+
"__@toStringTag@108884": {
|
|
487
487
|
"type": "string"
|
|
488
488
|
}
|
|
489
489
|
},
|
|
490
490
|
"additionalProperties": false,
|
|
491
491
|
"required": [
|
|
492
|
-
"__@toStringTag@
|
|
492
|
+
"__@toStringTag@108884",
|
|
493
493
|
"byteLength"
|
|
494
494
|
]
|
|
495
495
|
},
|
|
@@ -499,18 +499,18 @@
|
|
|
499
499
|
"byteLength": {
|
|
500
500
|
"type": "number"
|
|
501
501
|
},
|
|
502
|
-
"__@species@
|
|
502
|
+
"__@species@108985": {
|
|
503
503
|
"$ref": "#/definitions/SharedArrayBuffer"
|
|
504
504
|
},
|
|
505
|
-
"__@toStringTag@
|
|
505
|
+
"__@toStringTag@108884": {
|
|
506
506
|
"type": "string",
|
|
507
507
|
"const": "SharedArrayBuffer"
|
|
508
508
|
}
|
|
509
509
|
},
|
|
510
510
|
"additionalProperties": false,
|
|
511
511
|
"required": [
|
|
512
|
-
"__@species@
|
|
513
|
-
"__@toStringTag@
|
|
512
|
+
"__@species@108985",
|
|
513
|
+
"__@toStringTag@108884",
|
|
514
514
|
"byteLength"
|
|
515
515
|
]
|
|
516
516
|
},
|
|
@@ -484,14 +484,14 @@
|
|
|
484
484
|
"length": {
|
|
485
485
|
"type": "number"
|
|
486
486
|
},
|
|
487
|
-
"__@toStringTag@
|
|
487
|
+
"__@toStringTag@130881": {
|
|
488
488
|
"type": "string",
|
|
489
489
|
"const": "Uint8Array"
|
|
490
490
|
}
|
|
491
491
|
},
|
|
492
492
|
"required": [
|
|
493
493
|
"BYTES_PER_ELEMENT",
|
|
494
|
-
"__@toStringTag@
|
|
494
|
+
"__@toStringTag@130881",
|
|
495
495
|
"buffer",
|
|
496
496
|
"byteLength",
|
|
497
497
|
"byteOffset",
|
|
@@ -526,13 +526,13 @@
|
|
|
526
526
|
"byteLength": {
|
|
527
527
|
"type": "number"
|
|
528
528
|
},
|
|
529
|
-
"__@toStringTag@
|
|
529
|
+
"__@toStringTag@130881": {
|
|
530
530
|
"type": "string"
|
|
531
531
|
}
|
|
532
532
|
},
|
|
533
533
|
"additionalProperties": false,
|
|
534
534
|
"required": [
|
|
535
|
-
"__@toStringTag@
|
|
535
|
+
"__@toStringTag@130881",
|
|
536
536
|
"byteLength"
|
|
537
537
|
]
|
|
538
538
|
},
|
|
@@ -542,18 +542,18 @@
|
|
|
542
542
|
"byteLength": {
|
|
543
543
|
"type": "number"
|
|
544
544
|
},
|
|
545
|
-
"__@species@
|
|
545
|
+
"__@species@130982": {
|
|
546
546
|
"$ref": "#/definitions/SharedArrayBuffer"
|
|
547
547
|
},
|
|
548
|
-
"__@toStringTag@
|
|
548
|
+
"__@toStringTag@130881": {
|
|
549
549
|
"type": "string",
|
|
550
550
|
"const": "SharedArrayBuffer"
|
|
551
551
|
}
|
|
552
552
|
},
|
|
553
553
|
"additionalProperties": false,
|
|
554
554
|
"required": [
|
|
555
|
-
"__@species@
|
|
556
|
-
"__@toStringTag@
|
|
555
|
+
"__@species@130982",
|
|
556
|
+
"__@toStringTag@130881",
|
|
557
557
|
"byteLength"
|
|
558
558
|
]
|
|
559
559
|
},
|
|
@@ -394,14 +394,14 @@
|
|
|
394
394
|
"length": {
|
|
395
395
|
"type": "number"
|
|
396
396
|
},
|
|
397
|
-
"__@toStringTag@
|
|
397
|
+
"__@toStringTag@141962": {
|
|
398
398
|
"type": "string",
|
|
399
399
|
"const": "Uint8Array"
|
|
400
400
|
}
|
|
401
401
|
},
|
|
402
402
|
"required": [
|
|
403
403
|
"BYTES_PER_ELEMENT",
|
|
404
|
-
"__@toStringTag@
|
|
404
|
+
"__@toStringTag@141962",
|
|
405
405
|
"buffer",
|
|
406
406
|
"byteLength",
|
|
407
407
|
"byteOffset",
|
|
@@ -436,13 +436,13 @@
|
|
|
436
436
|
"byteLength": {
|
|
437
437
|
"type": "number"
|
|
438
438
|
},
|
|
439
|
-
"__@toStringTag@
|
|
439
|
+
"__@toStringTag@141962": {
|
|
440
440
|
"type": "string"
|
|
441
441
|
}
|
|
442
442
|
},
|
|
443
443
|
"additionalProperties": false,
|
|
444
444
|
"required": [
|
|
445
|
-
"__@toStringTag@
|
|
445
|
+
"__@toStringTag@141962",
|
|
446
446
|
"byteLength"
|
|
447
447
|
]
|
|
448
448
|
},
|
|
@@ -452,18 +452,18 @@
|
|
|
452
452
|
"byteLength": {
|
|
453
453
|
"type": "number"
|
|
454
454
|
},
|
|
455
|
-
"__@species@
|
|
455
|
+
"__@species@142063": {
|
|
456
456
|
"$ref": "#/definitions/SharedArrayBuffer"
|
|
457
457
|
},
|
|
458
|
-
"__@toStringTag@
|
|
458
|
+
"__@toStringTag@141962": {
|
|
459
459
|
"type": "string",
|
|
460
460
|
"const": "SharedArrayBuffer"
|
|
461
461
|
}
|
|
462
462
|
},
|
|
463
463
|
"additionalProperties": false,
|
|
464
464
|
"required": [
|
|
465
|
-
"__@species@
|
|
466
|
-
"__@toStringTag@
|
|
465
|
+
"__@species@142063",
|
|
466
|
+
"__@toStringTag@141962",
|
|
467
467
|
"byteLength"
|
|
468
468
|
]
|
|
469
469
|
},
|
|
@@ -29,7 +29,7 @@ export default (config, debug, options = {}) => async (req, browser) => {
|
|
|
29
29
|
*/
|
|
30
30
|
page.on('request', async (request) => {
|
|
31
31
|
const requestUrl = request.url();
|
|
32
|
-
debug(
|
|
32
|
+
debug(`Outbound Page Request: "${requestUrl}"`);
|
|
33
33
|
if (requestUrl.startsWith(functionRequestPath)) {
|
|
34
34
|
const filename = path.basename(requestUrl);
|
|
35
35
|
if (filename === functionCodeJS) {
|
|
@@ -55,10 +55,10 @@ export default (config, debug, options = {}) => async (req, browser) => {
|
|
|
55
55
|
status: 404,
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
+
debug(`Request: "${requestUrl}" no responder found, continuing...`);
|
|
58
59
|
return request.continue();
|
|
59
60
|
});
|
|
60
61
|
page.on('response', (res) => {
|
|
61
|
-
debug(`/function.js: Page Response: "${res.url()}"`);
|
|
62
62
|
if (res.status() !== 200) {
|
|
63
63
|
debug(`Received a non-200 response for request "${res.url()}"`);
|
|
64
64
|
}
|
|
@@ -73,6 +73,7 @@ export default (config, debug, options = {}) => async (req, browser) => {
|
|
|
73
73
|
import('./' + functionCodeJS),
|
|
74
74
|
]);
|
|
75
75
|
console.log('/function.js: imported successfully.');
|
|
76
|
+
console.log(`/function.js: BrowserlessFunctionRunner: ${typeof window.BrowserlessFunctionRunner}`);
|
|
76
77
|
const helper = new window.BrowserlessFunctionRunner();
|
|
77
78
|
const options = JSON.parse(serializedOptions);
|
|
78
79
|
console.log('/function.js: executing puppeteer code.');
|
package/package.json
CHANGED
|
@@ -1,18 +1,48 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-undef */
|
|
3
|
+
|
|
2
4
|
'use strict';
|
|
3
5
|
|
|
4
6
|
import { build } from 'esbuild';
|
|
7
|
+
import fs from 'fs/promises';
|
|
8
|
+
import { join } from 'path';
|
|
5
9
|
import { polyfillNode } from 'esbuild-plugin-polyfill-node';
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
const html = (contents) => `<!DOCTYPE html>
|
|
12
|
+
<html lang="en">
|
|
13
|
+
<head>
|
|
14
|
+
<meta charset="UTF-8">
|
|
15
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
16
|
+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
17
|
+
<title>browserless.io function runner</title>
|
|
18
|
+
<script type="module">
|
|
19
|
+
${contents}
|
|
20
|
+
</script>
|
|
21
|
+
</head>
|
|
22
|
+
<body>
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
const entryPoints = ['src/shared/utils/function/client.ts'];
|
|
28
|
+
const outfile = join(process.cwd(), 'static/function/client.js');
|
|
29
|
+
const htmlLocation = join(process.cwd(), 'static/function/index.html');
|
|
30
|
+
|
|
31
|
+
(async () => {
|
|
32
|
+
await build({
|
|
33
|
+
bundle: true,
|
|
34
|
+
entryPoints,
|
|
35
|
+
outfile,
|
|
36
|
+
plugins: [
|
|
37
|
+
polyfillNode({
|
|
38
|
+
globals: {
|
|
39
|
+
process: false,
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
const contents = await fs.readFile(outfile, 'utf-8');
|
|
45
|
+
const final = html(contents);
|
|
46
|
+
|
|
47
|
+
await fs.writeFile(htmlLocation, final);
|
|
48
|
+
})();
|
|
@@ -175,16 +175,17 @@ export class ChromiumCDP extends EventEmitter {
|
|
|
175
175
|
return null;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
const
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
178
|
+
const externalURL = new URL(this.config.getExternalWebSocketAddress());
|
|
179
|
+
const internalURL = new URL(this.browserWSEndpoint);
|
|
180
|
+
internalURL.host = externalURL.host;
|
|
181
|
+
internalURL.port = externalURL.port;
|
|
182
|
+
internalURL.protocol = externalURL.protocol;
|
|
182
183
|
|
|
183
184
|
if (token) {
|
|
184
|
-
|
|
185
|
+
internalURL.searchParams.set('token', token);
|
|
185
186
|
}
|
|
186
187
|
|
|
187
|
-
return
|
|
188
|
+
return internalURL.href;
|
|
188
189
|
};
|
|
189
190
|
|
|
190
191
|
public proxyPageWebSocket = async (
|
|
@@ -104,16 +104,17 @@ export class ChromiumPlaywright extends EventEmitter {
|
|
|
104
104
|
return null;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
const externalURL = new URL(this.config.getExternalWebSocketAddress());
|
|
108
|
+
const internalURL = new URL(this.browserWSEndpoint);
|
|
109
|
+
internalURL.host = externalURL.host;
|
|
110
|
+
internalURL.port = externalURL.port;
|
|
111
|
+
internalURL.protocol = externalURL.protocol;
|
|
111
112
|
|
|
112
113
|
if (token) {
|
|
113
|
-
|
|
114
|
+
internalURL.searchParams.set('token', token);
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
return
|
|
117
|
+
return internalURL.href;
|
|
117
118
|
};
|
|
118
119
|
|
|
119
120
|
public proxyPageWebSocket = async () => {
|
|
@@ -96,16 +96,17 @@ export class FirefoxPlaywright extends EventEmitter {
|
|
|
96
96
|
return null;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
const externalURL = new URL(this.config.getExternalWebSocketAddress());
|
|
100
|
+
const internalURL = new URL(this.browserWSEndpoint);
|
|
101
|
+
internalURL.host = externalURL.host;
|
|
102
|
+
internalURL.port = externalURL.port;
|
|
103
|
+
internalURL.protocol = externalURL.protocol;
|
|
103
104
|
|
|
104
105
|
if (token) {
|
|
105
|
-
|
|
106
|
+
internalURL.searchParams.set('token', token);
|
|
106
107
|
}
|
|
107
108
|
|
|
108
|
-
return
|
|
109
|
+
return internalURL.href;
|
|
109
110
|
};
|
|
110
111
|
|
|
111
112
|
public proxyPageWebSocket = async () => {
|
|
@@ -96,16 +96,17 @@ export class WebkitPlaywright extends EventEmitter {
|
|
|
96
96
|
return null;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
const externalURL = new URL(this.config.getExternalWebSocketAddress());
|
|
100
|
+
const internalURL = new URL(this.browserWSEndpoint);
|
|
101
|
+
internalURL.host = externalURL.host;
|
|
102
|
+
internalURL.port = externalURL.port;
|
|
103
|
+
internalURL.protocol = externalURL.protocol;
|
|
103
104
|
|
|
104
105
|
if (token) {
|
|
105
|
-
|
|
106
|
+
internalURL.searchParams.set('token', token);
|
|
106
107
|
}
|
|
107
108
|
|
|
108
|
-
return
|
|
109
|
+
return internalURL.href;
|
|
109
110
|
};
|
|
110
111
|
|
|
111
112
|
public proxyPageWebSocket = async () => {
|
package/src/server.ts
CHANGED
|
@@ -143,7 +143,9 @@ export class HTTPServer extends EventEmitter {
|
|
|
143
143
|
const route = await this.router.getRouteForHTTPRequest(req);
|
|
144
144
|
|
|
145
145
|
if (!route) {
|
|
146
|
-
this.log(
|
|
146
|
+
this.log(
|
|
147
|
+
`No matching HTTP route handler for "${req.method}: ${req.parsed.href}"`,
|
|
148
|
+
);
|
|
147
149
|
writeResponse(res, 404, 'Not Found');
|
|
148
150
|
return Promise.resolve();
|
|
149
151
|
}
|
|
@@ -88,7 +88,7 @@ export default (
|
|
|
88
88
|
*/
|
|
89
89
|
page.on('request', async (request) => {
|
|
90
90
|
const requestUrl = request.url();
|
|
91
|
-
debug(
|
|
91
|
+
debug(`Outbound Page Request: "${requestUrl}"`);
|
|
92
92
|
if (requestUrl.startsWith(functionRequestPath)) {
|
|
93
93
|
const filename = path.basename(requestUrl);
|
|
94
94
|
if (filename === functionCodeJS) {
|
|
@@ -116,11 +116,11 @@ export default (
|
|
|
116
116
|
status: 404,
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
+
debug(`Request: "${requestUrl}" no responder found, continuing...`);
|
|
119
120
|
return request.continue();
|
|
120
121
|
});
|
|
121
122
|
|
|
122
123
|
page.on('response', (res) => {
|
|
123
|
-
debug(`/function.js: Page Response: "${res.url()}"`);
|
|
124
124
|
if (res.status() !== 200) {
|
|
125
125
|
debug(`Received a non-200 response for request "${res.url()}"`);
|
|
126
126
|
}
|
|
@@ -144,6 +144,9 @@ export default (
|
|
|
144
144
|
import('./' + functionCodeJS),
|
|
145
145
|
]);
|
|
146
146
|
console.log('/function.js: imported successfully.');
|
|
147
|
+
console.log(
|
|
148
|
+
`/function.js: BrowserlessFunctionRunner: ${typeof window.BrowserlessFunctionRunner}`,
|
|
149
|
+
);
|
|
147
150
|
const helper = new window.BrowserlessFunctionRunner();
|
|
148
151
|
const options = JSON.parse(serializedOptions);
|
|
149
152
|
console.log('/function.js: executing puppeteer code.');
|
package/static/docs/swagger.json
CHANGED