@browserless.io/browserless 2.18.0 → 2.19.0

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 CHANGED
@@ -1,6 +1,13 @@
1
- # [Latest](https://github.com/browserless/chrome/compare/v2.18.0...main)
1
+ # [Latest](https://github.com/browserless/chrome/compare/v2.19.0...main)
2
2
  - Dependency updates.
3
3
 
4
+ # [v2.19.0](https://github.com/browserless/chrome/compare/v2.18.0...v2.19.0)
5
+ - Dependency updates.
6
+ - Drop `sort-keys` for eslint integrations.
7
+ - Fix devtools URLs when `PROXY` is set and contains a path.
8
+ - Disable `auth` when using Chrome's internal `/page` APIs.
9
+ - Small fixes for new eslint rules.
10
+
4
11
  # [v2.18.0](https://github.com/browserless/chrome/compare/v2.17.0...v2.18.0)
5
12
  - Dependency updates.
6
13
  - Supports `puppeteer-core@23.1.1`.
@@ -167,12 +167,16 @@ export class BrowserManager {
167
167
  },
168
168
  });
169
169
  if (response.ok) {
170
+ const externalUrl = new URL(serverAddress);
171
+ const protocol = externalUrl.protocol === 'https:' ? 'wss' : 'ws';
170
172
  const body = await response.json();
171
173
  for (const page of body) {
174
+ const devtoolsFrontendUrl = `/devtools/inspector.html?${protocol}=${externalUrl.host}${externalUrl.pathname}/devtools/page/${page.id}`;
172
175
  sessions.push({
173
176
  ...sessions[0],
174
177
  ...page,
175
178
  browserWSEndpoint: wsEndpoint,
179
+ devtoolsFrontendUrl,
176
180
  });
177
181
  }
178
182
  }
@@ -198,8 +202,8 @@ export class BrowserManager {
198
202
  this.timers.set(session.id, global.setTimeout(() => {
199
203
  const session = this.browsers.get(browser);
200
204
  if (session) {
201
- this.log.trace(`Timer hit for "${session.id}"`),
202
- this.close(browser, session);
205
+ this.log.trace(`Timer hit for "${session.id}"`);
206
+ this.close(browser, session);
203
207
  }
204
208
  }, timeout));
205
209
  }
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-unused-expressions */
1
2
  import { Config, Hooks, Limiter, Metrics, Monitoring, WebHooks, sleep, } from '@browserless.io/browserless';
2
3
  import Sinon, { spy } from 'sinon';
3
4
  import { expect } from 'chai';
@@ -438,14 +438,14 @@
438
438
  "length": {
439
439
  "type": "number"
440
440
  },
441
- "__@toStringTag@12081": {
441
+ "__@toStringTag@14083": {
442
442
  "type": "string",
443
443
  "const": "Uint8Array"
444
444
  }
445
445
  },
446
446
  "required": [
447
447
  "BYTES_PER_ELEMENT",
448
- "__@toStringTag@12081",
448
+ "__@toStringTag@14083",
449
449
  "buffer",
450
450
  "byteLength",
451
451
  "byteOffset",
@@ -480,13 +480,13 @@
480
480
  "byteLength": {
481
481
  "type": "number"
482
482
  },
483
- "__@toStringTag@12081": {
483
+ "__@toStringTag@14083": {
484
484
  "type": "string"
485
485
  }
486
486
  },
487
487
  "additionalProperties": false,
488
488
  "required": [
489
- "__@toStringTag@12081",
489
+ "__@toStringTag@14083",
490
490
  "byteLength"
491
491
  ]
492
492
  },
@@ -496,18 +496,18 @@
496
496
  "byteLength": {
497
497
  "type": "number"
498
498
  },
499
- "__@species@12119": {
499
+ "__@species@14121": {
500
500
  "$ref": "#/definitions/SharedArrayBuffer"
501
501
  },
502
- "__@toStringTag@12081": {
502
+ "__@toStringTag@14083": {
503
503
  "type": "string",
504
504
  "const": "SharedArrayBuffer"
505
505
  }
506
506
  },
507
507
  "additionalProperties": false,
508
508
  "required": [
509
- "__@species@12119",
510
- "__@toStringTag@12081",
509
+ "__@species@14121",
510
+ "__@toStringTag@14083",
511
511
  "byteLength"
512
512
  ]
513
513
  },
@@ -583,14 +583,14 @@
583
583
  "length": {
584
584
  "type": "number"
585
585
  },
586
- "__@toStringTag@83982": {
586
+ "__@toStringTag@111971": {
587
587
  "type": "string",
588
588
  "const": "Uint8Array"
589
589
  }
590
590
  },
591
591
  "required": [
592
592
  "BYTES_PER_ELEMENT",
593
- "__@toStringTag@83982",
593
+ "__@toStringTag@111971",
594
594
  "buffer",
595
595
  "byteLength",
596
596
  "byteOffset",
@@ -625,13 +625,13 @@
625
625
  "byteLength": {
626
626
  "type": "number"
627
627
  },
628
- "__@toStringTag@83982": {
628
+ "__@toStringTag@111971": {
629
629
  "type": "string"
630
630
  }
631
631
  },
632
632
  "additionalProperties": false,
633
633
  "required": [
634
- "__@toStringTag@83982",
634
+ "__@toStringTag@111971",
635
635
  "byteLength"
636
636
  ]
637
637
  },
@@ -641,18 +641,18 @@
641
641
  "byteLength": {
642
642
  "type": "number"
643
643
  },
644
- "__@species@84020": {
644
+ "__@species@112009": {
645
645
  "$ref": "#/definitions/SharedArrayBuffer"
646
646
  },
647
- "__@toStringTag@83982": {
647
+ "__@toStringTag@111971": {
648
648
  "type": "string",
649
649
  "const": "SharedArrayBuffer"
650
650
  }
651
651
  },
652
652
  "additionalProperties": false,
653
653
  "required": [
654
- "__@species@84020",
655
- "__@toStringTag@83982",
654
+ "__@species@112009",
655
+ "__@toStringTag@111971",
656
656
  "byteLength"
657
657
  ]
658
658
  },
@@ -485,14 +485,14 @@
485
485
  "length": {
486
486
  "type": "number"
487
487
  },
488
- "__@toStringTag@108126": {
488
+ "__@toStringTag@154304": {
489
489
  "type": "string",
490
490
  "const": "Uint8Array"
491
491
  }
492
492
  },
493
493
  "required": [
494
494
  "BYTES_PER_ELEMENT",
495
- "__@toStringTag@108126",
495
+ "__@toStringTag@154304",
496
496
  "buffer",
497
497
  "byteLength",
498
498
  "byteOffset",
@@ -527,13 +527,13 @@
527
527
  "byteLength": {
528
528
  "type": "number"
529
529
  },
530
- "__@toStringTag@108126": {
530
+ "__@toStringTag@154304": {
531
531
  "type": "string"
532
532
  }
533
533
  },
534
534
  "additionalProperties": false,
535
535
  "required": [
536
- "__@toStringTag@108126",
536
+ "__@toStringTag@154304",
537
537
  "byteLength"
538
538
  ]
539
539
  },
@@ -543,18 +543,18 @@
543
543
  "byteLength": {
544
544
  "type": "number"
545
545
  },
546
- "__@species@108164": {
546
+ "__@species@154342": {
547
547
  "$ref": "#/definitions/SharedArrayBuffer"
548
548
  },
549
- "__@toStringTag@108126": {
549
+ "__@toStringTag@154304": {
550
550
  "type": "string",
551
551
  "const": "SharedArrayBuffer"
552
552
  }
553
553
  },
554
554
  "additionalProperties": false,
555
555
  "required": [
556
- "__@species@108164",
557
- "__@toStringTag@108126",
556
+ "__@species@154342",
557
+ "__@toStringTag@154304",
558
558
  "byteLength"
559
559
  ]
560
560
  },
@@ -528,14 +528,14 @@
528
528
  "length": {
529
529
  "type": "number"
530
530
  },
531
- "__@toStringTag@120375": {
531
+ "__@toStringTag@140130": {
532
532
  "type": "string",
533
533
  "const": "Uint8Array"
534
534
  }
535
535
  },
536
536
  "required": [
537
537
  "BYTES_PER_ELEMENT",
538
- "__@toStringTag@120375",
538
+ "__@toStringTag@140130",
539
539
  "buffer",
540
540
  "byteLength",
541
541
  "byteOffset",
@@ -570,13 +570,13 @@
570
570
  "byteLength": {
571
571
  "type": "number"
572
572
  },
573
- "__@toStringTag@120375": {
573
+ "__@toStringTag@140130": {
574
574
  "type": "string"
575
575
  }
576
576
  },
577
577
  "additionalProperties": false,
578
578
  "required": [
579
- "__@toStringTag@120375",
579
+ "__@toStringTag@140130",
580
580
  "byteLength"
581
581
  ]
582
582
  },
@@ -586,18 +586,18 @@
586
586
  "byteLength": {
587
587
  "type": "number"
588
588
  },
589
- "__@species@120413": {
589
+ "__@species@140168": {
590
590
  "$ref": "#/definitions/SharedArrayBuffer"
591
591
  },
592
- "__@toStringTag@120375": {
592
+ "__@toStringTag@140130": {
593
593
  "type": "string",
594
594
  "const": "SharedArrayBuffer"
595
595
  }
596
596
  },
597
597
  "additionalProperties": false,
598
598
  "required": [
599
- "__@species@120413",
600
- "__@toStringTag@120375",
599
+ "__@species@140168",
600
+ "__@toStringTag@140130",
601
601
  "byteLength"
602
602
  ]
603
603
  },
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-unused-expressions */
1
2
  import { Browserless, Config, Metrics, sleep, } from '@browserless.io/browserless';
2
3
  import { expect } from 'chai';
3
4
  describe('/chrome/content API', function () {
@@ -3,5 +3,6 @@ import { default as Page, QuerySchema } from '../../../shared/page.ws.js';
3
3
  export default class ChromePageWebSocketRoute extends Page {
4
4
  name: string;
5
5
  browser: typeof ChromeCDP;
6
+ auth: boolean;
6
7
  }
7
8
  export { QuerySchema };
@@ -3,4 +3,5 @@ import { default as Page } from '../../../shared/page.ws.js';
3
3
  export default class ChromePageWebSocketRoute extends Page {
4
4
  name = BrowserlessRoutes.ChromePageWebSocketRoute;
5
5
  browser = ChromeCDP;
6
+ auth = false;
6
7
  }
@@ -438,14 +438,14 @@
438
438
  "length": {
439
439
  "type": "number"
440
440
  },
441
- "__@toStringTag@132534": {
441
+ "__@toStringTag@168531": {
442
442
  "type": "string",
443
443
  "const": "Uint8Array"
444
444
  }
445
445
  },
446
446
  "required": [
447
447
  "BYTES_PER_ELEMENT",
448
- "__@toStringTag@132534",
448
+ "__@toStringTag@168531",
449
449
  "buffer",
450
450
  "byteLength",
451
451
  "byteOffset",
@@ -480,13 +480,13 @@
480
480
  "byteLength": {
481
481
  "type": "number"
482
482
  },
483
- "__@toStringTag@132534": {
483
+ "__@toStringTag@168531": {
484
484
  "type": "string"
485
485
  }
486
486
  },
487
487
  "additionalProperties": false,
488
488
  "required": [
489
- "__@toStringTag@132534",
489
+ "__@toStringTag@168531",
490
490
  "byteLength"
491
491
  ]
492
492
  },
@@ -496,18 +496,18 @@
496
496
  "byteLength": {
497
497
  "type": "number"
498
498
  },
499
- "__@species@132572": {
499
+ "__@species@168569": {
500
500
  "$ref": "#/definitions/SharedArrayBuffer"
501
501
  },
502
- "__@toStringTag@132534": {
502
+ "__@toStringTag@168531": {
503
503
  "type": "string",
504
504
  "const": "SharedArrayBuffer"
505
505
  }
506
506
  },
507
507
  "additionalProperties": false,
508
508
  "required": [
509
- "__@species@132572",
510
- "__@toStringTag@132534",
509
+ "__@species@168569",
510
+ "__@toStringTag@168531",
511
511
  "byteLength"
512
512
  ]
513
513
  },
@@ -583,14 +583,14 @@
583
583
  "length": {
584
584
  "type": "number"
585
585
  },
586
- "__@toStringTag@228360": {
586
+ "__@toStringTag@252426": {
587
587
  "type": "string",
588
588
  "const": "Uint8Array"
589
589
  }
590
590
  },
591
591
  "required": [
592
592
  "BYTES_PER_ELEMENT",
593
- "__@toStringTag@228360",
593
+ "__@toStringTag@252426",
594
594
  "buffer",
595
595
  "byteLength",
596
596
  "byteOffset",
@@ -625,13 +625,13 @@
625
625
  "byteLength": {
626
626
  "type": "number"
627
627
  },
628
- "__@toStringTag@228360": {
628
+ "__@toStringTag@252426": {
629
629
  "type": "string"
630
630
  }
631
631
  },
632
632
  "additionalProperties": false,
633
633
  "required": [
634
- "__@toStringTag@228360",
634
+ "__@toStringTag@252426",
635
635
  "byteLength"
636
636
  ]
637
637
  },
@@ -641,18 +641,18 @@
641
641
  "byteLength": {
642
642
  "type": "number"
643
643
  },
644
- "__@species@228398": {
644
+ "__@species@252464": {
645
645
  "$ref": "#/definitions/SharedArrayBuffer"
646
646
  },
647
- "__@toStringTag@228360": {
647
+ "__@toStringTag@252426": {
648
648
  "type": "string",
649
649
  "const": "SharedArrayBuffer"
650
650
  }
651
651
  },
652
652
  "additionalProperties": false,
653
653
  "required": [
654
- "__@species@228398",
655
- "__@toStringTag@228360",
654
+ "__@species@252464",
655
+ "__@toStringTag@252426",
656
656
  "byteLength"
657
657
  ]
658
658
  },
@@ -485,14 +485,14 @@
485
485
  "length": {
486
486
  "type": "number"
487
487
  },
488
- "__@toStringTag@264678": {
488
+ "__@toStringTag@294540": {
489
489
  "type": "string",
490
490
  "const": "Uint8Array"
491
491
  }
492
492
  },
493
493
  "required": [
494
494
  "BYTES_PER_ELEMENT",
495
- "__@toStringTag@264678",
495
+ "__@toStringTag@294540",
496
496
  "buffer",
497
497
  "byteLength",
498
498
  "byteOffset",
@@ -527,13 +527,13 @@
527
527
  "byteLength": {
528
528
  "type": "number"
529
529
  },
530
- "__@toStringTag@264678": {
530
+ "__@toStringTag@294540": {
531
531
  "type": "string"
532
532
  }
533
533
  },
534
534
  "additionalProperties": false,
535
535
  "required": [
536
- "__@toStringTag@264678",
536
+ "__@toStringTag@294540",
537
537
  "byteLength"
538
538
  ]
539
539
  },
@@ -543,18 +543,18 @@
543
543
  "byteLength": {
544
544
  "type": "number"
545
545
  },
546
- "__@species@264716": {
546
+ "__@species@294578": {
547
547
  "$ref": "#/definitions/SharedArrayBuffer"
548
548
  },
549
- "__@toStringTag@264678": {
549
+ "__@toStringTag@294540": {
550
550
  "type": "string",
551
551
  "const": "SharedArrayBuffer"
552
552
  }
553
553
  },
554
554
  "additionalProperties": false,
555
555
  "required": [
556
- "__@species@264716",
557
- "__@toStringTag@264678",
556
+ "__@species@294578",
557
+ "__@toStringTag@294540",
558
558
  "byteLength"
559
559
  ]
560
560
  },
@@ -528,14 +528,14 @@
528
528
  "length": {
529
529
  "type": "number"
530
530
  },
531
- "__@toStringTag@252509": {
531
+ "__@toStringTag@308788": {
532
532
  "type": "string",
533
533
  "const": "Uint8Array"
534
534
  }
535
535
  },
536
536
  "required": [
537
537
  "BYTES_PER_ELEMENT",
538
- "__@toStringTag@252509",
538
+ "__@toStringTag@308788",
539
539
  "buffer",
540
540
  "byteLength",
541
541
  "byteOffset",
@@ -570,13 +570,13 @@
570
570
  "byteLength": {
571
571
  "type": "number"
572
572
  },
573
- "__@toStringTag@252509": {
573
+ "__@toStringTag@308788": {
574
574
  "type": "string"
575
575
  }
576
576
  },
577
577
  "additionalProperties": false,
578
578
  "required": [
579
- "__@toStringTag@252509",
579
+ "__@toStringTag@308788",
580
580
  "byteLength"
581
581
  ]
582
582
  },
@@ -586,18 +586,18 @@
586
586
  "byteLength": {
587
587
  "type": "number"
588
588
  },
589
- "__@species@252547": {
589
+ "__@species@308826": {
590
590
  "$ref": "#/definitions/SharedArrayBuffer"
591
591
  },
592
- "__@toStringTag@252509": {
592
+ "__@toStringTag@308788": {
593
593
  "type": "string",
594
594
  "const": "SharedArrayBuffer"
595
595
  }
596
596
  },
597
597
  "additionalProperties": false,
598
598
  "required": [
599
- "__@species@252547",
600
- "__@toStringTag@252509",
599
+ "__@species@308826",
600
+ "__@toStringTag@308788",
601
601
  "byteLength"
602
602
  ]
603
603
  },
package/build/server.js CHANGED
@@ -241,7 +241,9 @@ export class HTTPServer extends EventEmitter {
241
241
  async shutdown() {
242
242
  this.logger.info(`HTTP Server is shutting down`);
243
243
  await new Promise((r) => this.server.close(r));
244
- this.server && this.server.removeAllListeners();
244
+ if (this.server) {
245
+ this.server.removeAllListeners();
246
+ }
245
247
  // @ts-ignore garbage collect this reference
246
248
  this.server = null;
247
249
  this.logger.info(`HTTP Server shutdown complete`);
@@ -25,6 +25,7 @@ export default class ChromiumJSONVersionGetRoute extends HTTPRoute {
25
25
  return jsonResponse(res, 200, this.cachedJSON);
26
26
  }
27
27
  catch (err) {
28
+ logger.warn(`Error handling request`, err);
28
29
  return writeResponse(res, 500, 'There was an error handling your request', contentTypes.text);
29
30
  }
30
31
  }
@@ -20,7 +20,8 @@ export default async ({ browser, context, logger, timeout, }) => {
20
20
  return;
21
21
  if (pid)
22
22
  process.kill(pid, 'SIGINT');
23
- timeoutId && clearTimeout(timeoutId);
23
+ if (timeoutId)
24
+ clearTimeout(timeoutId);
24
25
  closed = true;
25
26
  timeoutId = null;
26
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browserless.io/browserless",
3
- "version": "2.18.0",
3
+ "version": "2.19.0",
4
4
  "license": "SSPL",
5
5
  "description": "The browserless platform",
6
6
  "author": "browserless.io",
@@ -56,13 +56,13 @@
56
56
  "gradient-string": "^2.0.0",
57
57
  "http-proxy": "^1.18.1",
58
58
  "lighthouse": "^12.2.0",
59
- "micromatch": "^4.0.7",
59
+ "micromatch": "^4.0.8",
60
60
  "playwright-1.41": "npm:playwright-core@1.41.2",
61
61
  "playwright-1.42": "npm:playwright-core@1.42.1",
62
62
  "playwright-1.43": "npm:playwright-core@1.43.1",
63
63
  "playwright-1.44": "npm:playwright-core@1.44.1",
64
64
  "playwright-core": "^1.46.1",
65
- "puppeteer-core": "^23.1.1",
65
+ "puppeteer-core": "^23.2.1",
66
66
  "puppeteer-extra": "^3.3.6",
67
67
  "puppeteer-extra-plugin-stealth": "^2.11.2",
68
68
  "queue": "^7.0.0",
@@ -70,16 +70,16 @@
70
70
  "tar-fs": "^3.0.6"
71
71
  },
72
72
  "optionalDependencies": {
73
- "@types/chai": "^4.3.17",
73
+ "@types/chai": "^4.3.18",
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
78
  "@types/mocha": "^10.0.7",
79
- "@types/node": "^22.5.0",
79
+ "@types/node": "^22.5.2",
80
80
  "@types/sinon": "^17.0.3",
81
- "@typescript-eslint/eslint-plugin": "^7.18.0",
82
- "@typescript-eslint/parser": "^7.18.0",
81
+ "@typescript-eslint/eslint-plugin": "^8.4.0",
82
+ "@typescript-eslint/parser": "^8.4.0",
83
83
  "assert": "^2.0.0",
84
84
  "chai": "^5.1.1",
85
85
  "cross-env": "^7.0.3",
@@ -87,10 +87,9 @@
87
87
  "esbuild": "^0.23.1",
88
88
  "esbuild-plugin-polyfill-node": "^0.3.0",
89
89
  "eslint": "^8.57.0",
90
- "eslint-plugin-typescript-sort-keys": "^3.2.0",
91
90
  "extract-zip": "^2.0.1",
92
91
  "gunzip-maybe": "^1.4.2",
93
- "marked": "^14.0.0",
92
+ "marked": "^14.1.0",
94
93
  "mocha": "^10.7.3",
95
94
  "move-file": "^3.1.0",
96
95
  "prettier": "^3.3.3",
@@ -111,32 +110,23 @@
111
110
  "root": true,
112
111
  "parser": "@typescript-eslint/parser",
113
112
  "plugins": [
114
- "@typescript-eslint",
115
- "typescript-sort-keys"
113
+ "@typescript-eslint"
116
114
  ],
117
115
  "extends": [
118
116
  "eslint:recommended",
119
117
  "plugin:@typescript-eslint/eslint-recommended",
120
- "plugin:@typescript-eslint/recommended",
121
- "plugin:typescript-sort-keys/recommended"
118
+ "plugin:@typescript-eslint/recommended"
122
119
  ],
123
120
  "ignorePatterns": [
124
121
  "node_modules/*",
122
+ "static/*",
123
+ "**.spec.ts",
125
124
  "build/*",
126
125
  ".DS_Store",
127
126
  ".no-git/*",
128
127
  "*.log"
129
128
  ],
130
129
  "rules": {
131
- "sort-keys": [
132
- "error",
133
- "asc",
134
- {
135
- "caseSensitive": true,
136
- "natural": false,
137
- "minKeys": 2
138
- }
139
- ],
140
130
  "semi": [
141
131
  2,
142
132
  "always"