@browserless.io/browserless 2.29.0-beta-2 → 2.29.0-beta-4

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.
@@ -34,6 +34,7 @@ export declare class Browserless extends EventEmitter {
34
34
  token?: Browserless['token'];
35
35
  webhooks?: Browserless['webhooks'];
36
36
  });
37
+ protected filterRoutes(route: HTTPRoute | BrowserHTTPRoute | WebSocketRoute | BrowserWebsocketRoute): boolean;
37
38
  protected loadPwVersions(): Promise<void>;
38
39
  protected saveMetrics(): Promise<void>;
39
40
  setMetricsSaveInterval(interval: number): void;
@@ -5,6 +5,8 @@ import { EventEmitter } from 'events';
5
5
  import { readFile } from 'fs/promises';
6
6
  import { userInfo } from 'os';
7
7
  const routeSchemas = ['body', 'query'];
8
+ const isArm64 = process.arch === 'arm64';
9
+ const isMacOS = process.platform === 'darwin';
8
10
  export class Browserless extends EventEmitter {
9
11
  logger;
10
12
  browserManager;
@@ -46,6 +48,19 @@ export class Browserless extends EventEmitter {
46
48
  router ||
47
49
  new Router(this.config, this.browserManager, this.limiter, this.Logger);
48
50
  }
51
+ // Filter out routes that are not able to work on the arm64 architecture
52
+ // and log a message as to why that is (can't run Chrome on non-apple arm64)
53
+ filterRoutes(route) {
54
+ if (isArm64 &&
55
+ !isMacOS &&
56
+ 'browser' in route &&
57
+ route.browser &&
58
+ route.browser.name.toLowerCase().includes('chrome')) {
59
+ this.logger.warn(`Ignoring route "${route.path}" because it is not supported on arm64 platforms (route requires browser "Chrome").`);
60
+ return false;
61
+ }
62
+ return true;
63
+ }
49
64
  async loadPwVersions() {
50
65
  const { playwrightVersions } = JSON.parse((await fs.readFile('package.json')).toString());
51
66
  this.config.setPwVersions(playwrightVersions);
@@ -203,7 +218,7 @@ export class Browserless extends EventEmitter {
203
218
  internalBrowsers.includes(route.browser) &&
204
219
  !installedBrowsers.some((b) => b.name === route.browser?.name)) {
205
220
  throw new Error(dedent(`Couldn't load route "${route.path}" due to missing browser binary for "${route.browser?.name}".
206
- Installed Browsers: ${installedBrowsers.join(', ')}`));
221
+ Installed Browsers: ${installedBrowsers.map((b) => b.name).join(', ')}`));
207
222
  }
208
223
  });
209
224
  const duplicateNamedRoutes = allRoutes
@@ -212,8 +227,12 @@ export class Browserless extends EventEmitter {
212
227
  if (duplicateNamedRoutes.length) {
213
228
  this.logger.warn(`Found duplicate routing names. Route names must be unique:`, duplicateNamedRoutes);
214
229
  }
215
- httpRoutes.forEach((r) => this.router.registerHTTPRoute(r));
216
- wsRoutes.forEach((r) => this.router.registerWebSocketRoute(r));
230
+ httpRoutes
231
+ .filter((r) => this.filterRoutes(r))
232
+ .forEach((r) => this.router.registerHTTPRoute(r));
233
+ wsRoutes
234
+ .filter((r) => this.filterRoutes(r))
235
+ .forEach((r) => this.router.registerWebSocketRoute(r));
217
236
  this.logger.info(`Imported and validated all route files, starting up server.`);
218
237
  this.server = new HTTPServer(this.config, this.metrics, this.token, this.router, this.hooks, this.Logger);
219
238
  await this.loadPwVersions();
@@ -463,14 +463,14 @@
463
463
  "length": {
464
464
  "type": "number"
465
465
  },
466
- "__@toStringTag@14863": {
466
+ "__@toStringTag@14882": {
467
467
  "type": "string",
468
468
  "const": "Uint8Array"
469
469
  }
470
470
  },
471
471
  "required": [
472
472
  "BYTES_PER_ELEMENT",
473
- "__@toStringTag@14863",
473
+ "__@toStringTag@14882",
474
474
  "buffer",
475
475
  "byteLength",
476
476
  "byteOffset",
@@ -505,13 +505,13 @@
505
505
  "byteLength": {
506
506
  "type": "number"
507
507
  },
508
- "__@toStringTag@14863": {
508
+ "__@toStringTag@14882": {
509
509
  "type": "string"
510
510
  }
511
511
  },
512
512
  "additionalProperties": false,
513
513
  "required": [
514
- "__@toStringTag@14863",
514
+ "__@toStringTag@14882",
515
515
  "byteLength"
516
516
  ]
517
517
  },
@@ -521,18 +521,18 @@
521
521
  "byteLength": {
522
522
  "type": "number"
523
523
  },
524
- "__@species@14901": {
524
+ "__@species@14920": {
525
525
  "$ref": "#/definitions/SharedArrayBuffer"
526
526
  },
527
- "__@toStringTag@14863": {
527
+ "__@toStringTag@14882": {
528
528
  "type": "string",
529
529
  "const": "SharedArrayBuffer"
530
530
  }
531
531
  },
532
532
  "additionalProperties": false,
533
533
  "required": [
534
- "__@species@14901",
535
- "__@toStringTag@14863",
534
+ "__@species@14920",
535
+ "__@toStringTag@14882",
536
536
  "byteLength"
537
537
  ]
538
538
  },
@@ -608,14 +608,14 @@
608
608
  "length": {
609
609
  "type": "number"
610
610
  },
611
- "__@toStringTag@133331": {
611
+ "__@toStringTag@118463": {
612
612
  "type": "string",
613
613
  "const": "Uint8Array"
614
614
  }
615
615
  },
616
616
  "required": [
617
617
  "BYTES_PER_ELEMENT",
618
- "__@toStringTag@133331",
618
+ "__@toStringTag@118463",
619
619
  "buffer",
620
620
  "byteLength",
621
621
  "byteOffset",
@@ -650,13 +650,13 @@
650
650
  "byteLength": {
651
651
  "type": "number"
652
652
  },
653
- "__@toStringTag@133331": {
653
+ "__@toStringTag@118463": {
654
654
  "type": "string"
655
655
  }
656
656
  },
657
657
  "additionalProperties": false,
658
658
  "required": [
659
- "__@toStringTag@133331",
659
+ "__@toStringTag@118463",
660
660
  "byteLength"
661
661
  ]
662
662
  },
@@ -666,18 +666,18 @@
666
666
  "byteLength": {
667
667
  "type": "number"
668
668
  },
669
- "__@species@133369": {
669
+ "__@species@118501": {
670
670
  "$ref": "#/definitions/SharedArrayBuffer"
671
671
  },
672
- "__@toStringTag@133331": {
672
+ "__@toStringTag@118463": {
673
673
  "type": "string",
674
674
  "const": "SharedArrayBuffer"
675
675
  }
676
676
  },
677
677
  "additionalProperties": false,
678
678
  "required": [
679
- "__@species@133369",
680
- "__@toStringTag@133331",
679
+ "__@species@118501",
680
+ "__@toStringTag@118463",
681
681
  "byteLength"
682
682
  ]
683
683
  },
@@ -510,14 +510,14 @@
510
510
  "length": {
511
511
  "type": "number"
512
512
  },
513
- "__@toStringTag@118297": {
513
+ "__@toStringTag@178172": {
514
514
  "type": "string",
515
515
  "const": "Uint8Array"
516
516
  }
517
517
  },
518
518
  "required": [
519
519
  "BYTES_PER_ELEMENT",
520
- "__@toStringTag@118297",
520
+ "__@toStringTag@178172",
521
521
  "buffer",
522
522
  "byteLength",
523
523
  "byteOffset",
@@ -552,13 +552,13 @@
552
552
  "byteLength": {
553
553
  "type": "number"
554
554
  },
555
- "__@toStringTag@118297": {
555
+ "__@toStringTag@178172": {
556
556
  "type": "string"
557
557
  }
558
558
  },
559
559
  "additionalProperties": false,
560
560
  "required": [
561
- "__@toStringTag@118297",
561
+ "__@toStringTag@178172",
562
562
  "byteLength"
563
563
  ]
564
564
  },
@@ -568,18 +568,18 @@
568
568
  "byteLength": {
569
569
  "type": "number"
570
570
  },
571
- "__@species@118335": {
571
+ "__@species@178210": {
572
572
  "$ref": "#/definitions/SharedArrayBuffer"
573
573
  },
574
- "__@toStringTag@118297": {
574
+ "__@toStringTag@178172": {
575
575
  "type": "string",
576
576
  "const": "SharedArrayBuffer"
577
577
  }
578
578
  },
579
579
  "additionalProperties": false,
580
580
  "required": [
581
- "__@species@118335",
582
- "__@toStringTag@118297",
581
+ "__@species@178210",
582
+ "__@toStringTag@178172",
583
583
  "byteLength"
584
584
  ]
585
585
  },
@@ -553,14 +553,14 @@
553
553
  "length": {
554
554
  "type": "number"
555
555
  },
556
- "__@toStringTag@178010": {
556
+ "__@toStringTag@148220": {
557
557
  "type": "string",
558
558
  "const": "Uint8Array"
559
559
  }
560
560
  },
561
561
  "required": [
562
562
  "BYTES_PER_ELEMENT",
563
- "__@toStringTag@178010",
563
+ "__@toStringTag@148220",
564
564
  "buffer",
565
565
  "byteLength",
566
566
  "byteOffset",
@@ -595,13 +595,13 @@
595
595
  "byteLength": {
596
596
  "type": "number"
597
597
  },
598
- "__@toStringTag@178010": {
598
+ "__@toStringTag@148220": {
599
599
  "type": "string"
600
600
  }
601
601
  },
602
602
  "additionalProperties": false,
603
603
  "required": [
604
- "__@toStringTag@178010",
604
+ "__@toStringTag@148220",
605
605
  "byteLength"
606
606
  ]
607
607
  },
@@ -611,18 +611,18 @@
611
611
  "byteLength": {
612
612
  "type": "number"
613
613
  },
614
- "__@species@178048": {
614
+ "__@species@148258": {
615
615
  "$ref": "#/definitions/SharedArrayBuffer"
616
616
  },
617
- "__@toStringTag@178010": {
617
+ "__@toStringTag@148220": {
618
618
  "type": "string",
619
619
  "const": "SharedArrayBuffer"
620
620
  }
621
621
  },
622
622
  "additionalProperties": false,
623
623
  "required": [
624
- "__@species@178048",
625
- "__@toStringTag@178010",
624
+ "__@species@148258",
625
+ "__@toStringTag@148220",
626
626
  "byteLength"
627
627
  ]
628
628
  },
@@ -463,14 +463,14 @@
463
463
  "length": {
464
464
  "type": "number"
465
465
  },
466
- "__@toStringTag@148273": {
466
+ "__@toStringTag@163181": {
467
467
  "type": "string",
468
468
  "const": "Uint8Array"
469
469
  }
470
470
  },
471
471
  "required": [
472
472
  "BYTES_PER_ELEMENT",
473
- "__@toStringTag@148273",
473
+ "__@toStringTag@163181",
474
474
  "buffer",
475
475
  "byteLength",
476
476
  "byteOffset",
@@ -505,13 +505,13 @@
505
505
  "byteLength": {
506
506
  "type": "number"
507
507
  },
508
- "__@toStringTag@148273": {
508
+ "__@toStringTag@163181": {
509
509
  "type": "string"
510
510
  }
511
511
  },
512
512
  "additionalProperties": false,
513
513
  "required": [
514
- "__@toStringTag@148273",
514
+ "__@toStringTag@163181",
515
515
  "byteLength"
516
516
  ]
517
517
  },
@@ -521,18 +521,18 @@
521
521
  "byteLength": {
522
522
  "type": "number"
523
523
  },
524
- "__@species@148311": {
524
+ "__@species@163219": {
525
525
  "$ref": "#/definitions/SharedArrayBuffer"
526
526
  },
527
- "__@toStringTag@148273": {
527
+ "__@toStringTag@163181": {
528
528
  "type": "string",
529
529
  "const": "SharedArrayBuffer"
530
530
  }
531
531
  },
532
532
  "additionalProperties": false,
533
533
  "required": [
534
- "__@species@148311",
535
- "__@toStringTag@148273",
534
+ "__@species@163219",
535
+ "__@toStringTag@163181",
536
536
  "byteLength"
537
537
  ]
538
538
  },
@@ -608,14 +608,14 @@
608
608
  "length": {
609
609
  "type": "number"
610
610
  },
611
- "__@toStringTag@341117": {
611
+ "__@toStringTag@252290": {
612
612
  "type": "string",
613
613
  "const": "Uint8Array"
614
614
  }
615
615
  },
616
616
  "required": [
617
617
  "BYTES_PER_ELEMENT",
618
- "__@toStringTag@341117",
618
+ "__@toStringTag@252290",
619
619
  "buffer",
620
620
  "byteLength",
621
621
  "byteOffset",
@@ -650,13 +650,13 @@
650
650
  "byteLength": {
651
651
  "type": "number"
652
652
  },
653
- "__@toStringTag@341117": {
653
+ "__@toStringTag@252290": {
654
654
  "type": "string"
655
655
  }
656
656
  },
657
657
  "additionalProperties": false,
658
658
  "required": [
659
- "__@toStringTag@341117",
659
+ "__@toStringTag@252290",
660
660
  "byteLength"
661
661
  ]
662
662
  },
@@ -666,18 +666,18 @@
666
666
  "byteLength": {
667
667
  "type": "number"
668
668
  },
669
- "__@species@341155": {
669
+ "__@species@252328": {
670
670
  "$ref": "#/definitions/SharedArrayBuffer"
671
671
  },
672
- "__@toStringTag@341117": {
672
+ "__@toStringTag@252290": {
673
673
  "type": "string",
674
674
  "const": "SharedArrayBuffer"
675
675
  }
676
676
  },
677
677
  "additionalProperties": false,
678
678
  "required": [
679
- "__@species@341155",
680
- "__@toStringTag@341117",
679
+ "__@species@252328",
680
+ "__@toStringTag@252290",
681
681
  "byteLength"
682
682
  ]
683
683
  },
@@ -510,14 +510,14 @@
510
510
  "length": {
511
511
  "type": "number"
512
512
  },
513
- "__@toStringTag@281407": {
513
+ "__@toStringTag@282030": {
514
514
  "type": "string",
515
515
  "const": "Uint8Array"
516
516
  }
517
517
  },
518
518
  "required": [
519
519
  "BYTES_PER_ELEMENT",
520
- "__@toStringTag@281407",
520
+ "__@toStringTag@282030",
521
521
  "buffer",
522
522
  "byteLength",
523
523
  "byteOffset",
@@ -552,13 +552,13 @@
552
552
  "byteLength": {
553
553
  "type": "number"
554
554
  },
555
- "__@toStringTag@281407": {
555
+ "__@toStringTag@282030": {
556
556
  "type": "string"
557
557
  }
558
558
  },
559
559
  "additionalProperties": false,
560
560
  "required": [
561
- "__@toStringTag@281407",
561
+ "__@toStringTag@282030",
562
562
  "byteLength"
563
563
  ]
564
564
  },
@@ -568,18 +568,18 @@
568
568
  "byteLength": {
569
569
  "type": "number"
570
570
  },
571
- "__@species@281445": {
571
+ "__@species@282068": {
572
572
  "$ref": "#/definitions/SharedArrayBuffer"
573
573
  },
574
- "__@toStringTag@281407": {
574
+ "__@toStringTag@282030": {
575
575
  "type": "string",
576
576
  "const": "SharedArrayBuffer"
577
577
  }
578
578
  },
579
579
  "additionalProperties": false,
580
580
  "required": [
581
- "__@species@281445",
582
- "__@toStringTag@281407",
581
+ "__@species@282068",
582
+ "__@toStringTag@282030",
583
583
  "byteLength"
584
584
  ]
585
585
  },
@@ -553,14 +553,14 @@
553
553
  "length": {
554
554
  "type": "number"
555
555
  },
556
- "__@toStringTag@296436": {
556
+ "__@toStringTag@297078": {
557
557
  "type": "string",
558
558
  "const": "Uint8Array"
559
559
  }
560
560
  },
561
561
  "required": [
562
562
  "BYTES_PER_ELEMENT",
563
- "__@toStringTag@296436",
563
+ "__@toStringTag@297078",
564
564
  "buffer",
565
565
  "byteLength",
566
566
  "byteOffset",
@@ -595,13 +595,13 @@
595
595
  "byteLength": {
596
596
  "type": "number"
597
597
  },
598
- "__@toStringTag@296436": {
598
+ "__@toStringTag@297078": {
599
599
  "type": "string"
600
600
  }
601
601
  },
602
602
  "additionalProperties": false,
603
603
  "required": [
604
- "__@toStringTag@296436",
604
+ "__@toStringTag@297078",
605
605
  "byteLength"
606
606
  ]
607
607
  },
@@ -611,18 +611,18 @@
611
611
  "byteLength": {
612
612
  "type": "number"
613
613
  },
614
- "__@species@296474": {
614
+ "__@species@297116": {
615
615
  "$ref": "#/definitions/SharedArrayBuffer"
616
616
  },
617
- "__@toStringTag@296436": {
617
+ "__@toStringTag@297078": {
618
618
  "type": "string",
619
619
  "const": "SharedArrayBuffer"
620
620
  }
621
621
  },
622
622
  "additionalProperties": false,
623
623
  "required": [
624
- "__@species@296474",
625
- "__@toStringTag@296436",
624
+ "__@species@297116",
625
+ "__@toStringTag@297078",
626
626
  "byteLength"
627
627
  ]
628
628
  },
@@ -463,14 +463,14 @@
463
463
  "length": {
464
464
  "type": "number"
465
465
  },
466
- "__@toStringTag@311381": {
466
+ "__@toStringTag@312042": {
467
467
  "type": "string",
468
468
  "const": "Uint8Array"
469
469
  }
470
470
  },
471
471
  "required": [
472
472
  "BYTES_PER_ELEMENT",
473
- "__@toStringTag@311381",
473
+ "__@toStringTag@312042",
474
474
  "buffer",
475
475
  "byteLength",
476
476
  "byteOffset",
@@ -505,13 +505,13 @@
505
505
  "byteLength": {
506
506
  "type": "number"
507
507
  },
508
- "__@toStringTag@311381": {
508
+ "__@toStringTag@312042": {
509
509
  "type": "string"
510
510
  }
511
511
  },
512
512
  "additionalProperties": false,
513
513
  "required": [
514
- "__@toStringTag@311381",
514
+ "__@toStringTag@312042",
515
515
  "byteLength"
516
516
  ]
517
517
  },
@@ -521,18 +521,18 @@
521
521
  "byteLength": {
522
522
  "type": "number"
523
523
  },
524
- "__@species@311419": {
524
+ "__@species@312080": {
525
525
  "$ref": "#/definitions/SharedArrayBuffer"
526
526
  },
527
- "__@toStringTag@311381": {
527
+ "__@toStringTag@312042": {
528
528
  "type": "string",
529
529
  "const": "SharedArrayBuffer"
530
530
  }
531
531
  },
532
532
  "additionalProperties": false,
533
533
  "required": [
534
- "__@species@311419",
535
- "__@toStringTag@311381",
534
+ "__@species@312080",
535
+ "__@toStringTag@312042",
536
536
  "byteLength"
537
537
  ]
538
538
  },
@@ -608,14 +608,14 @@
608
608
  "length": {
609
609
  "type": "number"
610
610
  },
611
- "__@toStringTag@474306": {
611
+ "__@toStringTag@400823": {
612
612
  "type": "string",
613
613
  "const": "Uint8Array"
614
614
  }
615
615
  },
616
616
  "required": [
617
617
  "BYTES_PER_ELEMENT",
618
- "__@toStringTag@474306",
618
+ "__@toStringTag@400823",
619
619
  "buffer",
620
620
  "byteLength",
621
621
  "byteOffset",
@@ -650,13 +650,13 @@
650
650
  "byteLength": {
651
651
  "type": "number"
652
652
  },
653
- "__@toStringTag@474306": {
653
+ "__@toStringTag@400823": {
654
654
  "type": "string"
655
655
  }
656
656
  },
657
657
  "additionalProperties": false,
658
658
  "required": [
659
- "__@toStringTag@474306",
659
+ "__@toStringTag@400823",
660
660
  "byteLength"
661
661
  ]
662
662
  },
@@ -666,18 +666,18 @@
666
666
  "byteLength": {
667
667
  "type": "number"
668
668
  },
669
- "__@species@474344": {
669
+ "__@species@400861": {
670
670
  "$ref": "#/definitions/SharedArrayBuffer"
671
671
  },
672
- "__@toStringTag@474306": {
672
+ "__@toStringTag@400823": {
673
673
  "type": "string",
674
674
  "const": "SharedArrayBuffer"
675
675
  }
676
676
  },
677
677
  "additionalProperties": false,
678
678
  "required": [
679
- "__@species@474344",
680
- "__@toStringTag@474306",
679
+ "__@species@400861",
680
+ "__@toStringTag@400823",
681
681
  "byteLength"
682
682
  ]
683
683
  },
@@ -510,14 +510,14 @@
510
510
  "length": {
511
511
  "type": "number"
512
512
  },
513
- "__@toStringTag@429781": {
513
+ "__@toStringTag@475100": {
514
514
  "type": "string",
515
515
  "const": "Uint8Array"
516
516
  }
517
517
  },
518
518
  "required": [
519
519
  "BYTES_PER_ELEMENT",
520
- "__@toStringTag@429781",
520
+ "__@toStringTag@475100",
521
521
  "buffer",
522
522
  "byteLength",
523
523
  "byteOffset",
@@ -552,13 +552,13 @@
552
552
  "byteLength": {
553
553
  "type": "number"
554
554
  },
555
- "__@toStringTag@429781": {
555
+ "__@toStringTag@475100": {
556
556
  "type": "string"
557
557
  }
558
558
  },
559
559
  "additionalProperties": false,
560
560
  "required": [
561
- "__@toStringTag@429781",
561
+ "__@toStringTag@475100",
562
562
  "byteLength"
563
563
  ]
564
564
  },
@@ -568,18 +568,18 @@
568
568
  "byteLength": {
569
569
  "type": "number"
570
570
  },
571
- "__@species@429819": {
571
+ "__@species@475138": {
572
572
  "$ref": "#/definitions/SharedArrayBuffer"
573
573
  },
574
- "__@toStringTag@429781": {
574
+ "__@toStringTag@475100": {
575
575
  "type": "string",
576
576
  "const": "SharedArrayBuffer"
577
577
  }
578
578
  },
579
579
  "additionalProperties": false,
580
580
  "required": [
581
- "__@species@429819",
582
- "__@toStringTag@429781",
581
+ "__@species@475138",
582
+ "__@toStringTag@475100",
583
583
  "byteLength"
584
584
  ]
585
585
  },
@@ -553,14 +553,14 @@
553
553
  "length": {
554
554
  "type": "number"
555
555
  },
556
- "__@toStringTag@518759": {
556
+ "__@toStringTag@460126": {
557
557
  "type": "string",
558
558
  "const": "Uint8Array"
559
559
  }
560
560
  },
561
561
  "required": [
562
562
  "BYTES_PER_ELEMENT",
563
- "__@toStringTag@518759",
563
+ "__@toStringTag@460126",
564
564
  "buffer",
565
565
  "byteLength",
566
566
  "byteOffset",
@@ -595,13 +595,13 @@
595
595
  "byteLength": {
596
596
  "type": "number"
597
597
  },
598
- "__@toStringTag@518759": {
598
+ "__@toStringTag@460126": {
599
599
  "type": "string"
600
600
  }
601
601
  },
602
602
  "additionalProperties": false,
603
603
  "required": [
604
- "__@toStringTag@518759",
604
+ "__@toStringTag@460126",
605
605
  "byteLength"
606
606
  ]
607
607
  },
@@ -611,18 +611,18 @@
611
611
  "byteLength": {
612
612
  "type": "number"
613
613
  },
614
- "__@species@518797": {
614
+ "__@species@460164": {
615
615
  "$ref": "#/definitions/SharedArrayBuffer"
616
616
  },
617
- "__@toStringTag@518759": {
617
+ "__@toStringTag@460126": {
618
618
  "type": "string",
619
619
  "const": "SharedArrayBuffer"
620
620
  }
621
621
  },
622
622
  "additionalProperties": false,
623
623
  "required": [
624
- "__@species@518797",
625
- "__@toStringTag@518759",
624
+ "__@species@460164",
625
+ "__@toStringTag@460126",
626
626
  "byteLength"
627
627
  ]
628
628
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browserless.io/browserless",
3
- "version": "2.29.0-beta-2",
3
+ "version": "2.29.0-beta-4",
4
4
  "license": "SSPL",
5
5
  "description": "The browserless platform",
6
6
  "author": "browserless.io",
@@ -62,7 +62,7 @@
62
62
  "playwright-1.50": "npm:playwright-core@1.50.1",
63
63
  "playwright-1.51": "npm:playwright-core@1.51.1",
64
64
  "playwright-core": "1.52.0",
65
- "puppeteer-core": "24.7.1",
65
+ "puppeteer-core": "24.7.2",
66
66
  "puppeteer-extra": "^3.3.6",
67
67
  "puppeteer-extra-plugin-stealth": "^2.11.2",
68
68
  "queue": "^7.0.0",
@@ -76,7 +76,7 @@
76
76
  "@types/http-proxy": "^1.17.16",
77
77
  "@types/micromatch": "^4.0.9",
78
78
  "@types/mocha": "^10.0.10",
79
- "@types/node": "^22.14.1",
79
+ "@types/node": "^22.15.1",
80
80
  "@types/sinon": "^17.0.4",
81
81
  "@typescript-eslint/eslint-plugin": "^8.31.0",
82
82
  "@typescript-eslint/parser": "^8.31.0",
@@ -89,7 +89,7 @@
89
89
  "eslint": "^9.25.1",
90
90
  "extract-zip": "^2.0.1",
91
91
  "gunzip-maybe": "^1.4.2",
92
- "marked": "^15.0.9",
92
+ "marked": "^15.0.11",
93
93
  "mocha": "^11.1.0",
94
94
  "move-file": "^3.1.0",
95
95
  "prettier": "^3.5.3",
@@ -40,6 +40,9 @@ import { userInfo } from 'os';
40
40
 
41
41
  const routeSchemas = ['body', 'query'];
42
42
 
43
+ const isArm64 = process.arch === 'arm64';
44
+ const isMacOS = process.platform === 'darwin';
45
+
43
46
  type Implements<T> = {
44
47
  new (...args: unknown[]): T;
45
48
  };
@@ -124,6 +127,30 @@ export class Browserless extends EventEmitter {
124
127
  new Router(this.config, this.browserManager, this.limiter, this.Logger);
125
128
  }
126
129
 
130
+ // Filter out routes that are not able to work on the arm64 architecture
131
+ // and log a message as to why that is (can't run Chrome on non-apple arm64)
132
+ protected filterRoutes(
133
+ route:
134
+ | HTTPRoute
135
+ | BrowserHTTPRoute
136
+ | WebSocketRoute
137
+ | BrowserWebsocketRoute,
138
+ ) {
139
+ if (
140
+ isArm64 &&
141
+ !isMacOS &&
142
+ 'browser' in route &&
143
+ route.browser &&
144
+ route.browser.name.toLowerCase().includes('chrome')
145
+ ) {
146
+ this.logger.warn(
147
+ `Ignoring route "${route.path}" because it is not supported on arm64 platforms (route requires browser "Chrome").`,
148
+ );
149
+ return false;
150
+ }
151
+ return true;
152
+ }
153
+
127
154
  protected async loadPwVersions(): Promise<void> {
128
155
  const { playwrightVersions } = JSON.parse(
129
156
  (await fs.readFile('package.json')).toString(),
@@ -363,7 +390,7 @@ export class Browserless extends EventEmitter {
363
390
  ) {
364
391
  throw new Error(
365
392
  dedent(`Couldn't load route "${route.path}" due to missing browser binary for "${route.browser?.name}".
366
- Installed Browsers: ${installedBrowsers.join(', ')}`),
393
+ Installed Browsers: ${installedBrowsers.map((b) => b.name).join(', ')}`),
367
394
  );
368
395
  }
369
396
  });
@@ -379,8 +406,13 @@ export class Browserless extends EventEmitter {
379
406
  );
380
407
  }
381
408
 
382
- httpRoutes.forEach((r) => this.router.registerHTTPRoute(r));
383
- wsRoutes.forEach((r) => this.router.registerWebSocketRoute(r));
409
+ httpRoutes
410
+ .filter((r) => this.filterRoutes(r))
411
+ .forEach((r) => this.router.registerHTTPRoute(r));
412
+
413
+ wsRoutes
414
+ .filter((r) => this.filterRoutes(r))
415
+ .forEach((r) => this.router.registerWebSocketRoute(r));
384
416
 
385
417
  this.logger.info(
386
418
  `Imported and validated all route files, starting up server.`,
@@ -280,14 +280,14 @@
280
280
  "length": {
281
281
  "type": "number"
282
282
  },
283
- "__@toStringTag@14863": {
283
+ "__@toStringTag@14882": {
284
284
  "type": "string",
285
285
  "const": "Uint8Array"
286
286
  }
287
287
  },
288
288
  "required": [
289
289
  "BYTES_PER_ELEMENT",
290
- "__@toStringTag@14863",
290
+ "__@toStringTag@14882",
291
291
  "buffer",
292
292
  "byteLength",
293
293
  "byteOffset",
@@ -322,13 +322,13 @@
322
322
  "byteLength": {
323
323
  "type": "number"
324
324
  },
325
- "__@toStringTag@14863": {
325
+ "__@toStringTag@14882": {
326
326
  "type": "string"
327
327
  }
328
328
  },
329
329
  "additionalProperties": false,
330
330
  "required": [
331
- "__@toStringTag@14863",
331
+ "__@toStringTag@14882",
332
332
  "byteLength"
333
333
  ]
334
334
  },
@@ -338,18 +338,18 @@
338
338
  "byteLength": {
339
339
  "type": "number"
340
340
  },
341
- "__@species@14901": {
341
+ "__@species@14920": {
342
342
  "$ref": "#/definitions/SharedArrayBuffer"
343
343
  },
344
- "__@toStringTag@14863": {
344
+ "__@toStringTag@14882": {
345
345
  "type": "string",
346
346
  "const": "SharedArrayBuffer"
347
347
  }
348
348
  },
349
349
  "additionalProperties": false,
350
350
  "required": [
351
- "__@species@14901",
352
- "__@toStringTag@14863",
351
+ "__@species@14920",
352
+ "__@toStringTag@14882",
353
353
  "byteLength"
354
354
  ]
355
355
  },
@@ -1001,7 +1001,7 @@
1001
1001
  },
1002
1002
  "info": {
1003
1003
  "title": "Browserless",
1004
- "version": "2.29.0-beta-2",
1004
+ "version": "2.29.0-beta-4",
1005
1005
  "x-logo": {
1006
1006
  "altText": "browserless logo",
1007
1007
  "url": "./docs/browserless-logo-inline.svg"
@@ -280,14 +280,14 @@
280
280
  "length": {
281
281
  "type": "number"
282
282
  },
283
- "__@toStringTag@14863": {
283
+ "__@toStringTag@14882": {
284
284
  "type": "string",
285
285
  "const": "Uint8Array"
286
286
  }
287
287
  },
288
288
  "required": [
289
289
  "BYTES_PER_ELEMENT",
290
- "__@toStringTag@14863",
290
+ "__@toStringTag@14882",
291
291
  "buffer",
292
292
  "byteLength",
293
293
  "byteOffset",
@@ -322,13 +322,13 @@
322
322
  "byteLength": {
323
323
  "type": "number"
324
324
  },
325
- "__@toStringTag@14863": {
325
+ "__@toStringTag@14882": {
326
326
  "type": "string"
327
327
  }
328
328
  },
329
329
  "additionalProperties": false,
330
330
  "required": [
331
- "__@toStringTag@14863",
331
+ "__@toStringTag@14882",
332
332
  "byteLength"
333
333
  ]
334
334
  },
@@ -338,18 +338,18 @@
338
338
  "byteLength": {
339
339
  "type": "number"
340
340
  },
341
- "__@species@14901": {
341
+ "__@species@14920": {
342
342
  "$ref": "#/definitions/SharedArrayBuffer"
343
343
  },
344
- "__@toStringTag@14863": {
344
+ "__@toStringTag@14882": {
345
345
  "type": "string",
346
346
  "const": "SharedArrayBuffer"
347
347
  }
348
348
  },
349
349
  "additionalProperties": false,
350
350
  "required": [
351
- "__@species@14901",
352
- "__@toStringTag@14863",
351
+ "__@species@14920",
352
+ "__@toStringTag@14882",
353
353
  "byteLength"
354
354
  ]
355
355
  },
@@ -1001,7 +1001,7 @@
1001
1001
  },
1002
1002
  "info": {
1003
1003
  "title": "Browserless",
1004
- "version": "2.29.0-beta-2",
1004
+ "version": "2.29.0-beta-4",
1005
1005
  "x-logo": {
1006
1006
  "altText": "browserless logo",
1007
1007
  "url": "./docs/browserless-logo-inline.svg"
@@ -4401,7 +4401,7 @@
4401
4401
  // node_modules/puppeteer-core/lib/esm/puppeteer/generated/version.js
4402
4402
  init_dirname();
4403
4403
  init_buffer2();
4404
- var packageVersion = "24.7.1";
4404
+ var packageVersion = "24.7.2";
4405
4405
 
4406
4406
  // node_modules/puppeteer-core/lib/esm/puppeteer/util/assert.js
4407
4407
  init_dirname();
@@ -4409,7 +4409,7 @@
4409
4409
  // node_modules/puppeteer-core/lib/esm/puppeteer/generated/version.js
4410
4410
  init_dirname();
4411
4411
  init_buffer2();
4412
- var packageVersion = "24.7.1";
4412
+ var packageVersion = "24.7.2";
4413
4413
 
4414
4414
  // node_modules/puppeteer-core/lib/esm/puppeteer/util/assert.js
4415
4415
  init_dirname();