@browserless.io/browserless 2.3.0 → 2.4.0-beta-3
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 +6 -0
- package/bin/browserless.js +2 -0
- package/bin/scaffold/README.md +26 -1
- package/build/browserless.d.ts +6 -2
- package/build/browserless.js +23 -4
- package/build/browsers/chromium.cdp.d.ts +1 -5
- package/build/browsers/chromium.cdp.js +5 -115
- package/build/browsers/chromium.playwright.d.ts +1 -3
- package/build/browsers/chromium.playwright.js +1 -6
- package/build/browsers/firefox.playwright.d.ts +1 -3
- package/build/browsers/firefox.playwright.js +1 -6
- package/build/browsers/index.d.ts +5 -1
- package/build/browsers/index.js +6 -5
- package/build/browsers/webkit.playwright.d.ts +1 -3
- package/build/browsers/webkit.playwright.js +1 -6
- package/build/config.d.ts +9 -0
- package/build/config.js +11 -0
- package/build/constants.d.ts +0 -1
- package/build/constants.js +0 -1
- package/build/data/selectors.json +1 -1
- package/build/file-system.d.ts +12 -1
- package/build/file-system.js +14 -1
- package/build/http.d.ts +0 -7
- package/build/limiter.d.ts +9 -0
- package/build/limiter.js +11 -0
- package/build/metrics.d.ts +12 -1
- package/build/metrics.js +13 -1
- package/build/monitoring.d.ts +12 -1
- package/build/monitoring.js +14 -1
- package/build/router.d.ts +12 -2
- package/build/router.js +16 -6
- package/build/routes/chrome/http/content.post.body.json +8 -8
- package/build/routes/chrome/http/content.post.query.json +0 -4
- package/build/routes/chrome/http/download.post.query.json +0 -4
- package/build/routes/chrome/http/function.post.query.json +0 -4
- package/build/routes/chrome/http/pdf.post.body.json +8 -8
- package/build/routes/chrome/http/pdf.post.query.json +0 -4
- package/build/routes/chrome/http/performance.post.query.json +0 -4
- package/build/routes/chrome/http/scrape.post.body.json +8 -8
- package/build/routes/chrome/http/scrape.post.query.json +0 -4
- package/build/routes/chrome/http/screenshot.post.body.json +8 -8
- package/build/routes/chrome/http/screenshot.post.query.json +0 -4
- package/build/routes/chrome/tests/function.spec.js +32 -0
- package/build/routes/chrome/ws/browser.query.json +0 -4
- package/build/routes/chrome/ws/cdp.query.json +0 -4
- package/build/routes/chrome/ws/page.query.json +0 -4
- package/build/routes/chrome/ws/playwright.query.json +0 -4
- package/build/routes/chromium/http/content.post.body.json +8 -8
- package/build/routes/chromium/http/content.post.query.json +0 -4
- package/build/routes/chromium/http/download.post.query.json +0 -4
- package/build/routes/chromium/http/function.post.query.json +0 -4
- package/build/routes/chromium/http/pdf.post.body.json +8 -8
- package/build/routes/chromium/http/pdf.post.query.json +0 -4
- package/build/routes/chromium/http/performance.post.query.json +0 -4
- package/build/routes/chromium/http/scrape.post.body.json +8 -8
- package/build/routes/chromium/http/scrape.post.query.json +0 -4
- package/build/routes/chromium/http/screenshot.post.body.json +8 -8
- package/build/routes/chromium/http/screenshot.post.query.json +0 -4
- package/build/routes/chromium/ws/browser.query.json +0 -4
- package/build/routes/chromium/ws/cdp.query.json +0 -4
- package/build/routes/chromium/ws/page.query.json +0 -4
- package/build/routes/chromium/ws/playwright.query.json +0 -4
- package/build/routes/firefox/ws/playwright.query.json +0 -4
- package/build/routes/management/http/static.get.js +17 -11
- package/build/routes/webkit/ws/playwright.query.json +0 -4
- package/build/server.d.ts +8 -3
- package/build/server.js +15 -13
- package/build/token.d.ts +12 -1
- package/build/token.js +14 -1
- package/build/types.d.ts +9 -12
- package/build/types.js +10 -1
- package/build/webhooks.d.ts +12 -1
- package/build/webhooks.js +14 -1
- package/extensions/.gitkeep +0 -0
- package/package.json +5 -5
- package/src/browserless.ts +24 -2
- package/src/browsers/chromium.cdp.ts +10 -157
- package/src/browsers/chromium.playwright.ts +0 -8
- package/src/browsers/firefox.playwright.ts +0 -8
- package/src/browsers/index.ts +7 -6
- package/src/browsers/webkit.playwright.ts +0 -8
- package/src/config.ts +13 -0
- package/src/constants.ts +0 -1
- package/src/file-system.ts +16 -1
- package/src/http.ts +0 -8
- package/src/limiter.ts +13 -0
- package/src/metrics.ts +16 -1
- package/src/monitoring.ts +18 -2
- package/src/router.ts +20 -9
- package/src/routes/chrome/tests/function.spec.ts +35 -0
- package/src/routes/management/http/static.get.ts +25 -15
- package/src/server.ts +18 -16
- package/src/token.ts +18 -2
- package/src/types.ts +9 -13
- package/src/webhooks.ts +18 -2
- package/static/docs/swagger.json +10 -186
- package/static/docs/swagger.min.json +9 -185
- package/extensions/screencast/background.js +0 -143
- package/extensions/screencast/content_script.js +0 -18
- package/extensions/screencast/manifest.json +0 -19
|
@@ -225,14 +225,14 @@
|
|
|
225
225
|
"length": {
|
|
226
226
|
"type": "number"
|
|
227
227
|
},
|
|
228
|
-
"__@toStringTag@
|
|
228
|
+
"__@toStringTag@10915": {
|
|
229
229
|
"type": "string",
|
|
230
230
|
"const": "Uint8Array"
|
|
231
231
|
}
|
|
232
232
|
},
|
|
233
233
|
"required": [
|
|
234
234
|
"BYTES_PER_ELEMENT",
|
|
235
|
-
"__@toStringTag@
|
|
235
|
+
"__@toStringTag@10915",
|
|
236
236
|
"buffer",
|
|
237
237
|
"byteLength",
|
|
238
238
|
"byteOffset",
|
|
@@ -267,13 +267,13 @@
|
|
|
267
267
|
"byteLength": {
|
|
268
268
|
"type": "number"
|
|
269
269
|
},
|
|
270
|
-
"__@toStringTag@
|
|
270
|
+
"__@toStringTag@10915": {
|
|
271
271
|
"type": "string"
|
|
272
272
|
}
|
|
273
273
|
},
|
|
274
274
|
"additionalProperties": false,
|
|
275
275
|
"required": [
|
|
276
|
-
"__@toStringTag@
|
|
276
|
+
"__@toStringTag@10915",
|
|
277
277
|
"byteLength"
|
|
278
278
|
]
|
|
279
279
|
},
|
|
@@ -283,18 +283,18 @@
|
|
|
283
283
|
"byteLength": {
|
|
284
284
|
"type": "number"
|
|
285
285
|
},
|
|
286
|
-
"__@species@
|
|
286
|
+
"__@species@11016": {
|
|
287
287
|
"$ref": "#/definitions/SharedArrayBuffer"
|
|
288
288
|
},
|
|
289
|
-
"__@toStringTag@
|
|
289
|
+
"__@toStringTag@10915": {
|
|
290
290
|
"type": "string",
|
|
291
291
|
"const": "SharedArrayBuffer"
|
|
292
292
|
}
|
|
293
293
|
},
|
|
294
294
|
"additionalProperties": false,
|
|
295
295
|
"required": [
|
|
296
|
-
"__@species@
|
|
297
|
-
"__@toStringTag@
|
|
296
|
+
"__@species@11016",
|
|
297
|
+
"__@toStringTag@10915",
|
|
298
298
|
"byteLength"
|
|
299
299
|
]
|
|
300
300
|
},
|
|
@@ -1098,7 +1098,7 @@
|
|
|
1098
1098
|
},
|
|
1099
1099
|
"info": {
|
|
1100
1100
|
"title": "Browserless",
|
|
1101
|
-
"version": "2.
|
|
1101
|
+
"version": "2.4.0-beta-3",
|
|
1102
1102
|
"x-logo": {
|
|
1103
1103
|
"altText": "browserless logo",
|
|
1104
1104
|
"url": "./docs/browserless-logo-inline.svg"
|
|
@@ -1133,14 +1133,6 @@
|
|
|
1133
1133
|
]
|
|
1134
1134
|
}
|
|
1135
1135
|
},
|
|
1136
|
-
{
|
|
1137
|
-
"in": "query",
|
|
1138
|
-
"name": "record",
|
|
1139
|
-
"schema": {
|
|
1140
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
1141
|
-
"type": "boolean"
|
|
1142
|
-
}
|
|
1143
|
-
},
|
|
1144
1136
|
{
|
|
1145
1137
|
"in": "query",
|
|
1146
1138
|
"name": "timeout",
|
|
@@ -1413,14 +1405,6 @@
|
|
|
1413
1405
|
]
|
|
1414
1406
|
}
|
|
1415
1407
|
},
|
|
1416
|
-
{
|
|
1417
|
-
"in": "query",
|
|
1418
|
-
"name": "record",
|
|
1419
|
-
"schema": {
|
|
1420
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
1421
|
-
"type": "boolean"
|
|
1422
|
-
}
|
|
1423
|
-
},
|
|
1424
1408
|
{
|
|
1425
1409
|
"in": "query",
|
|
1426
1410
|
"name": "timeout",
|
|
@@ -1529,14 +1513,6 @@
|
|
|
1529
1513
|
]
|
|
1530
1514
|
}
|
|
1531
1515
|
},
|
|
1532
|
-
{
|
|
1533
|
-
"in": "query",
|
|
1534
|
-
"name": "record",
|
|
1535
|
-
"schema": {
|
|
1536
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
1537
|
-
"type": "boolean"
|
|
1538
|
-
}
|
|
1539
|
-
},
|
|
1540
1516
|
{
|
|
1541
1517
|
"in": "query",
|
|
1542
1518
|
"name": "timeout",
|
|
@@ -1999,14 +1975,6 @@
|
|
|
1999
1975
|
]
|
|
2000
1976
|
}
|
|
2001
1977
|
},
|
|
2002
|
-
{
|
|
2003
|
-
"in": "query",
|
|
2004
|
-
"name": "record",
|
|
2005
|
-
"schema": {
|
|
2006
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
2007
|
-
"type": "boolean"
|
|
2008
|
-
}
|
|
2009
|
-
},
|
|
2010
1978
|
{
|
|
2011
1979
|
"in": "query",
|
|
2012
1980
|
"name": "timeout",
|
|
@@ -2284,14 +2252,6 @@
|
|
|
2284
2252
|
]
|
|
2285
2253
|
}
|
|
2286
2254
|
},
|
|
2287
|
-
{
|
|
2288
|
-
"in": "query",
|
|
2289
|
-
"name": "record",
|
|
2290
|
-
"schema": {
|
|
2291
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
2292
|
-
"type": "boolean"
|
|
2293
|
-
}
|
|
2294
|
-
},
|
|
2295
2255
|
{
|
|
2296
2256
|
"in": "query",
|
|
2297
2257
|
"name": "timeout",
|
|
@@ -2415,14 +2375,6 @@
|
|
|
2415
2375
|
]
|
|
2416
2376
|
}
|
|
2417
2377
|
},
|
|
2418
|
-
{
|
|
2419
|
-
"in": "query",
|
|
2420
|
-
"name": "record",
|
|
2421
|
-
"schema": {
|
|
2422
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
2423
|
-
"type": "boolean"
|
|
2424
|
-
}
|
|
2425
|
-
},
|
|
2426
2378
|
{
|
|
2427
2379
|
"in": "query",
|
|
2428
2380
|
"name": "timeout",
|
|
@@ -3007,14 +2959,6 @@
|
|
|
3007
2959
|
]
|
|
3008
2960
|
}
|
|
3009
2961
|
},
|
|
3010
|
-
{
|
|
3011
|
-
"in": "query",
|
|
3012
|
-
"name": "record",
|
|
3013
|
-
"schema": {
|
|
3014
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
3015
|
-
"type": "boolean"
|
|
3016
|
-
}
|
|
3017
|
-
},
|
|
3018
2962
|
{
|
|
3019
2963
|
"in": "query",
|
|
3020
2964
|
"name": "timeout",
|
|
@@ -3303,14 +3247,6 @@
|
|
|
3303
3247
|
]
|
|
3304
3248
|
}
|
|
3305
3249
|
},
|
|
3306
|
-
{
|
|
3307
|
-
"in": "query",
|
|
3308
|
-
"name": "record",
|
|
3309
|
-
"schema": {
|
|
3310
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
3311
|
-
"type": "boolean"
|
|
3312
|
-
}
|
|
3313
|
-
},
|
|
3314
3250
|
{
|
|
3315
3251
|
"in": "query",
|
|
3316
3252
|
"name": "timeout",
|
|
@@ -3400,14 +3336,6 @@
|
|
|
3400
3336
|
]
|
|
3401
3337
|
}
|
|
3402
3338
|
},
|
|
3403
|
-
{
|
|
3404
|
-
"in": "query",
|
|
3405
|
-
"name": "record",
|
|
3406
|
-
"schema": {
|
|
3407
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
3408
|
-
"type": "boolean"
|
|
3409
|
-
}
|
|
3410
|
-
},
|
|
3411
3339
|
{
|
|
3412
3340
|
"in": "query",
|
|
3413
3341
|
"name": "timeout",
|
|
@@ -3497,14 +3425,6 @@
|
|
|
3497
3425
|
]
|
|
3498
3426
|
}
|
|
3499
3427
|
},
|
|
3500
|
-
{
|
|
3501
|
-
"in": "query",
|
|
3502
|
-
"name": "record",
|
|
3503
|
-
"schema": {
|
|
3504
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
3505
|
-
"type": "boolean"
|
|
3506
|
-
}
|
|
3507
|
-
},
|
|
3508
3428
|
{
|
|
3509
3429
|
"in": "query",
|
|
3510
3430
|
"name": "timeout",
|
|
@@ -3594,14 +3514,6 @@
|
|
|
3594
3514
|
]
|
|
3595
3515
|
}
|
|
3596
3516
|
},
|
|
3597
|
-
{
|
|
3598
|
-
"in": "query",
|
|
3599
|
-
"name": "record",
|
|
3600
|
-
"schema": {
|
|
3601
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
3602
|
-
"type": "boolean"
|
|
3603
|
-
}
|
|
3604
|
-
},
|
|
3605
3517
|
{
|
|
3606
3518
|
"in": "query",
|
|
3607
3519
|
"name": "timeout",
|
|
@@ -3690,14 +3602,6 @@
|
|
|
3690
3602
|
]
|
|
3691
3603
|
}
|
|
3692
3604
|
},
|
|
3693
|
-
{
|
|
3694
|
-
"in": "query",
|
|
3695
|
-
"name": "record",
|
|
3696
|
-
"schema": {
|
|
3697
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
3698
|
-
"type": "boolean"
|
|
3699
|
-
}
|
|
3700
|
-
},
|
|
3701
3605
|
{
|
|
3702
3606
|
"in": "query",
|
|
3703
3607
|
"name": "timeout",
|
|
@@ -3970,14 +3874,6 @@
|
|
|
3970
3874
|
]
|
|
3971
3875
|
}
|
|
3972
3876
|
},
|
|
3973
|
-
{
|
|
3974
|
-
"in": "query",
|
|
3975
|
-
"name": "record",
|
|
3976
|
-
"schema": {
|
|
3977
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
3978
|
-
"type": "boolean"
|
|
3979
|
-
}
|
|
3980
|
-
},
|
|
3981
3877
|
{
|
|
3982
3878
|
"in": "query",
|
|
3983
3879
|
"name": "timeout",
|
|
@@ -4086,14 +3982,6 @@
|
|
|
4086
3982
|
]
|
|
4087
3983
|
}
|
|
4088
3984
|
},
|
|
4089
|
-
{
|
|
4090
|
-
"in": "query",
|
|
4091
|
-
"name": "record",
|
|
4092
|
-
"schema": {
|
|
4093
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
4094
|
-
"type": "boolean"
|
|
4095
|
-
}
|
|
4096
|
-
},
|
|
4097
3985
|
{
|
|
4098
3986
|
"in": "query",
|
|
4099
3987
|
"name": "timeout",
|
|
@@ -4202,14 +4090,6 @@
|
|
|
4202
4090
|
]
|
|
4203
4091
|
}
|
|
4204
4092
|
},
|
|
4205
|
-
{
|
|
4206
|
-
"in": "query",
|
|
4207
|
-
"name": "record",
|
|
4208
|
-
"schema": {
|
|
4209
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
4210
|
-
"type": "boolean"
|
|
4211
|
-
}
|
|
4212
|
-
},
|
|
4213
4093
|
{
|
|
4214
4094
|
"in": "query",
|
|
4215
4095
|
"name": "timeout",
|
|
@@ -4487,14 +4367,6 @@
|
|
|
4487
4367
|
]
|
|
4488
4368
|
}
|
|
4489
4369
|
},
|
|
4490
|
-
{
|
|
4491
|
-
"in": "query",
|
|
4492
|
-
"name": "record",
|
|
4493
|
-
"schema": {
|
|
4494
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
4495
|
-
"type": "boolean"
|
|
4496
|
-
}
|
|
4497
|
-
},
|
|
4498
4370
|
{
|
|
4499
4371
|
"in": "query",
|
|
4500
4372
|
"name": "timeout",
|
|
@@ -4618,14 +4490,6 @@
|
|
|
4618
4490
|
]
|
|
4619
4491
|
}
|
|
4620
4492
|
},
|
|
4621
|
-
{
|
|
4622
|
-
"in": "query",
|
|
4623
|
-
"name": "record",
|
|
4624
|
-
"schema": {
|
|
4625
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
4626
|
-
"type": "boolean"
|
|
4627
|
-
}
|
|
4628
|
-
},
|
|
4629
4493
|
{
|
|
4630
4494
|
"in": "query",
|
|
4631
4495
|
"name": "timeout",
|
|
@@ -5210,14 +5074,6 @@
|
|
|
5210
5074
|
]
|
|
5211
5075
|
}
|
|
5212
5076
|
},
|
|
5213
|
-
{
|
|
5214
|
-
"in": "query",
|
|
5215
|
-
"name": "record",
|
|
5216
|
-
"schema": {
|
|
5217
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
5218
|
-
"type": "boolean"
|
|
5219
|
-
}
|
|
5220
|
-
},
|
|
5221
5077
|
{
|
|
5222
5078
|
"in": "query",
|
|
5223
5079
|
"name": "timeout",
|
|
@@ -5506,14 +5362,6 @@
|
|
|
5506
5362
|
]
|
|
5507
5363
|
}
|
|
5508
5364
|
},
|
|
5509
|
-
{
|
|
5510
|
-
"in": "query",
|
|
5511
|
-
"name": "record",
|
|
5512
|
-
"schema": {
|
|
5513
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
5514
|
-
"type": "boolean"
|
|
5515
|
-
}
|
|
5516
|
-
},
|
|
5517
5365
|
{
|
|
5518
5366
|
"in": "query",
|
|
5519
5367
|
"name": "timeout",
|
|
@@ -5603,14 +5451,6 @@
|
|
|
5603
5451
|
]
|
|
5604
5452
|
}
|
|
5605
5453
|
},
|
|
5606
|
-
{
|
|
5607
|
-
"in": "query",
|
|
5608
|
-
"name": "record",
|
|
5609
|
-
"schema": {
|
|
5610
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
5611
|
-
"type": "boolean"
|
|
5612
|
-
}
|
|
5613
|
-
},
|
|
5614
5454
|
{
|
|
5615
5455
|
"in": "query",
|
|
5616
5456
|
"name": "timeout",
|
|
@@ -5764,14 +5604,6 @@
|
|
|
5764
5604
|
}
|
|
5765
5605
|
}
|
|
5766
5606
|
},
|
|
5767
|
-
{
|
|
5768
|
-
"in": "query",
|
|
5769
|
-
"name": "record",
|
|
5770
|
-
"schema": {
|
|
5771
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
5772
|
-
"type": "boolean"
|
|
5773
|
-
}
|
|
5774
|
-
},
|
|
5775
5607
|
{
|
|
5776
5608
|
"in": "query",
|
|
5777
5609
|
"name": "timeout",
|
|
@@ -6623,14 +6455,6 @@
|
|
|
6623
6455
|
]
|
|
6624
6456
|
}
|
|
6625
6457
|
},
|
|
6626
|
-
{
|
|
6627
|
-
"in": "query",
|
|
6628
|
-
"name": "record",
|
|
6629
|
-
"schema": {
|
|
6630
|
-
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
6631
|
-
"type": "boolean"
|
|
6632
|
-
}
|
|
6633
|
-
},
|
|
6634
6458
|
{
|
|
6635
6459
|
"in": "query",
|
|
6636
6460
|
"name": "timeout",
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
|
|
3
|
-
// All recordings are hoisted in this reference
|
|
4
|
-
// so we can navigate pages and more.
|
|
5
|
-
const recordings = new Map();
|
|
6
|
-
class Recorder {
|
|
7
|
-
#recorder = null;
|
|
8
|
-
#chunks = [];
|
|
9
|
-
|
|
10
|
-
async start(opts) {
|
|
11
|
-
return new Promise((resolve, reject) => {
|
|
12
|
-
if (this.#recorder) {
|
|
13
|
-
return reject(new Error(`${id} has already started recording`));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
chrome.desktopCapture.chooseDesktopMedia(
|
|
17
|
-
['audio', 'tab'],
|
|
18
|
-
async (streamId) => {
|
|
19
|
-
const userMediaPreferences = {
|
|
20
|
-
audio: {
|
|
21
|
-
mandatory: {
|
|
22
|
-
chromeMediaSource: 'desktop',
|
|
23
|
-
chromeMediaSourceId: streamId,
|
|
24
|
-
echoCancellation: true,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
video: {
|
|
28
|
-
mandatory: {
|
|
29
|
-
chromeMediaSource: 'desktop',
|
|
30
|
-
chromeMediaSourceId: streamId,
|
|
31
|
-
maxFrameRate: opts.framerate || 60,
|
|
32
|
-
minFrameRate: opts.framerate || 60,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const stream = await navigator.mediaDevices.getUserMedia(
|
|
38
|
-
userMediaPreferences
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
if (opts.video === false) {
|
|
42
|
-
const videoTracks = stream.getVideoTracks();
|
|
43
|
-
videoTracks.forEach((track) => stream.removeTrack(track));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (opts.audio === false) {
|
|
47
|
-
const audioTracks = stream.getAudioTracks();
|
|
48
|
-
audioTracks.forEach((track) => stream.removeTrack(track));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
this.#recorder = new MediaRecorder(stream, {
|
|
52
|
-
ignoreMutedMedia: true,
|
|
53
|
-
mimeType: opts.video === false ? 'audio/webm' : 'video/webm',
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
this.#recorder.ondataavailable = (event) => {
|
|
57
|
-
if (event.data.size > 0) {
|
|
58
|
-
this.#chunks.push(event.data);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
resolve();
|
|
62
|
-
|
|
63
|
-
// Wait 350ms for the invisible dialog to disappear
|
|
64
|
-
setTimeout(() => this.#recorder.start(), 500);
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
async stop() {
|
|
71
|
-
return new Promise((resolve, reject) => {
|
|
72
|
-
if (!this.#recorder) {
|
|
73
|
-
return reject(
|
|
74
|
-
new Error(`No recorder has started, did you forget to start?`)
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
this.#recorder.onstop = () => {
|
|
79
|
-
const blob = new Blob(this.#chunks, {
|
|
80
|
-
type: 'video/webm',
|
|
81
|
-
});
|
|
82
|
-
const reader = new FileReader();
|
|
83
|
-
|
|
84
|
-
reader.onload = () => {
|
|
85
|
-
resolve(reader.result);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
reader.onerror = (err) => {
|
|
89
|
-
reject(err);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
reader.readAsBinaryString(blob);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
this.#recorder.stop();
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
chrome.runtime.onConnect.addListener((port) => {
|
|
101
|
-
port.onMessage.addListener(async (msg) => {
|
|
102
|
-
const { id, type } = msg;
|
|
103
|
-
if (type === 'REC_START') {
|
|
104
|
-
if (recordings.has(id)) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
const recorder = new Recorder();
|
|
108
|
-
recordings.set(id, recorder);
|
|
109
|
-
try {
|
|
110
|
-
await recorder.start(msg);
|
|
111
|
-
return port.postMessage({ id, message: 'REC_STARTED' });
|
|
112
|
-
} catch (err) {
|
|
113
|
-
return port.postMessage({
|
|
114
|
-
error: err.message,
|
|
115
|
-
id,
|
|
116
|
-
message: 'REC_START_FAIL',
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (type === 'REC_STOP') {
|
|
122
|
-
const recorder = recordings.get(id);
|
|
123
|
-
if (!recorder) {
|
|
124
|
-
return port.postMessage({
|
|
125
|
-
id,
|
|
126
|
-
message: 'REC_NOT_STARTED',
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
try {
|
|
130
|
-
const result = await recorder.stop();
|
|
131
|
-
return port.postMessage({ file: result, id, message: 'REC_FILE' });
|
|
132
|
-
} catch (err) {
|
|
133
|
-
return port.postMessage({
|
|
134
|
-
error: err.message,
|
|
135
|
-
id,
|
|
136
|
-
message: 'REC_STOP_FAIL',
|
|
137
|
-
});
|
|
138
|
-
} finally {
|
|
139
|
-
recordings.delete(id);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
/**
|
|
3
|
-
* Simply forwarding messages here back and forth
|
|
4
|
-
* between the background.js script and the page's
|
|
5
|
-
* runtime JavaScript.
|
|
6
|
-
*/
|
|
7
|
-
window.onload = () => {
|
|
8
|
-
const port = chrome.runtime.connect(chrome.runtime.id);
|
|
9
|
-
port.onMessage.addListener((msg) => {
|
|
10
|
-
window.postMessage(msg, '*');
|
|
11
|
-
});
|
|
12
|
-
window.addEventListener('message', event => {
|
|
13
|
-
if (event.source === window && event.data.type) {
|
|
14
|
-
port.postMessage(event.data);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
document.title = 'browserless-screencast';
|
|
18
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "browserless-vhs",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"manifest_version": 2,
|
|
5
|
-
"background": {
|
|
6
|
-
"scripts": ["background.js"]
|
|
7
|
-
},
|
|
8
|
-
"content_scripts": [{
|
|
9
|
-
"matches": ["<all_urls>"],
|
|
10
|
-
"js": ["content_script.js"],
|
|
11
|
-
"run_at": "document_start"
|
|
12
|
-
}],
|
|
13
|
-
"permissions": [
|
|
14
|
-
"desktopCapture",
|
|
15
|
-
"audio",
|
|
16
|
-
"<all_urls>",
|
|
17
|
-
"downloads"
|
|
18
|
-
]
|
|
19
|
-
}
|