@browserless.io/browserless 2.22.0-beta-1 → 2.22.0-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.
@@ -438,14 +438,14 @@
438
438
  "length": {
439
439
  "type": "number"
440
440
  },
441
- "__@toStringTag@14355": {
441
+ "__@toStringTag@14427": {
442
442
  "type": "string",
443
443
  "const": "Uint8Array"
444
444
  }
445
445
  },
446
446
  "required": [
447
447
  "BYTES_PER_ELEMENT",
448
- "__@toStringTag@14355",
448
+ "__@toStringTag@14427",
449
449
  "buffer",
450
450
  "byteLength",
451
451
  "byteOffset",
@@ -480,13 +480,13 @@
480
480
  "byteLength": {
481
481
  "type": "number"
482
482
  },
483
- "__@toStringTag@14355": {
483
+ "__@toStringTag@14427": {
484
484
  "type": "string"
485
485
  }
486
486
  },
487
487
  "additionalProperties": false,
488
488
  "required": [
489
- "__@toStringTag@14355",
489
+ "__@toStringTag@14427",
490
490
  "byteLength"
491
491
  ]
492
492
  },
@@ -496,18 +496,18 @@
496
496
  "byteLength": {
497
497
  "type": "number"
498
498
  },
499
- "__@species@14393": {
499
+ "__@species@14465": {
500
500
  "$ref": "#/definitions/SharedArrayBuffer"
501
501
  },
502
- "__@toStringTag@14355": {
502
+ "__@toStringTag@14427": {
503
503
  "type": "string",
504
504
  "const": "SharedArrayBuffer"
505
505
  }
506
506
  },
507
507
  "additionalProperties": false,
508
508
  "required": [
509
- "__@species@14393",
510
- "__@toStringTag@14355",
509
+ "__@species@14465",
510
+ "__@toStringTag@14427",
511
511
  "byteLength"
512
512
  ]
513
513
  },
@@ -583,14 +583,14 @@
583
583
  "length": {
584
584
  "type": "number"
585
585
  },
586
- "__@toStringTag@128394": {
586
+ "__@toStringTag@114724": {
587
587
  "type": "string",
588
588
  "const": "Uint8Array"
589
589
  }
590
590
  },
591
591
  "required": [
592
592
  "BYTES_PER_ELEMENT",
593
- "__@toStringTag@128394",
593
+ "__@toStringTag@114724",
594
594
  "buffer",
595
595
  "byteLength",
596
596
  "byteOffset",
@@ -625,13 +625,13 @@
625
625
  "byteLength": {
626
626
  "type": "number"
627
627
  },
628
- "__@toStringTag@128394": {
628
+ "__@toStringTag@114724": {
629
629
  "type": "string"
630
630
  }
631
631
  },
632
632
  "additionalProperties": false,
633
633
  "required": [
634
- "__@toStringTag@128394",
634
+ "__@toStringTag@114724",
635
635
  "byteLength"
636
636
  ]
637
637
  },
@@ -641,18 +641,18 @@
641
641
  "byteLength": {
642
642
  "type": "number"
643
643
  },
644
- "__@species@128432": {
644
+ "__@species@114762": {
645
645
  "$ref": "#/definitions/SharedArrayBuffer"
646
646
  },
647
- "__@toStringTag@128394": {
647
+ "__@toStringTag@114724": {
648
648
  "type": "string",
649
649
  "const": "SharedArrayBuffer"
650
650
  }
651
651
  },
652
652
  "additionalProperties": false,
653
653
  "required": [
654
- "__@species@128432",
655
- "__@toStringTag@128394",
654
+ "__@species@114762",
655
+ "__@toStringTag@114724",
656
656
  "byteLength"
657
657
  ]
658
658
  },
@@ -485,14 +485,14 @@
485
485
  "length": {
486
486
  "type": "number"
487
487
  },
488
- "__@toStringTag@142840": {
488
+ "__@toStringTag@158089": {
489
489
  "type": "string",
490
490
  "const": "Uint8Array"
491
491
  }
492
492
  },
493
493
  "required": [
494
494
  "BYTES_PER_ELEMENT",
495
- "__@toStringTag@142840",
495
+ "__@toStringTag@158089",
496
496
  "buffer",
497
497
  "byteLength",
498
498
  "byteOffset",
@@ -527,13 +527,13 @@
527
527
  "byteLength": {
528
528
  "type": "number"
529
529
  },
530
- "__@toStringTag@142840": {
530
+ "__@toStringTag@158089": {
531
531
  "type": "string"
532
532
  }
533
533
  },
534
534
  "additionalProperties": false,
535
535
  "required": [
536
- "__@toStringTag@142840",
536
+ "__@toStringTag@158089",
537
537
  "byteLength"
538
538
  ]
539
539
  },
@@ -543,18 +543,18 @@
543
543
  "byteLength": {
544
544
  "type": "number"
545
545
  },
546
- "__@species@142878": {
546
+ "__@species@158127": {
547
547
  "$ref": "#/definitions/SharedArrayBuffer"
548
548
  },
549
- "__@toStringTag@142840": {
549
+ "__@toStringTag@158089": {
550
550
  "type": "string",
551
551
  "const": "SharedArrayBuffer"
552
552
  }
553
553
  },
554
554
  "additionalProperties": false,
555
555
  "required": [
556
- "__@species@142878",
557
- "__@toStringTag@142840",
556
+ "__@species@158127",
557
+ "__@toStringTag@158089",
558
558
  "byteLength"
559
559
  ]
560
560
  },
@@ -528,14 +528,14 @@
528
528
  "length": {
529
529
  "type": "number"
530
530
  },
531
- "__@toStringTag@157363": {
531
+ "__@toStringTag@143571": {
532
532
  "type": "string",
533
533
  "const": "Uint8Array"
534
534
  }
535
535
  },
536
536
  "required": [
537
537
  "BYTES_PER_ELEMENT",
538
- "__@toStringTag@157363",
538
+ "__@toStringTag@143571",
539
539
  "buffer",
540
540
  "byteLength",
541
541
  "byteOffset",
@@ -570,13 +570,13 @@
570
570
  "byteLength": {
571
571
  "type": "number"
572
572
  },
573
- "__@toStringTag@157363": {
573
+ "__@toStringTag@143571": {
574
574
  "type": "string"
575
575
  }
576
576
  },
577
577
  "additionalProperties": false,
578
578
  "required": [
579
- "__@toStringTag@157363",
579
+ "__@toStringTag@143571",
580
580
  "byteLength"
581
581
  ]
582
582
  },
@@ -586,18 +586,18 @@
586
586
  "byteLength": {
587
587
  "type": "number"
588
588
  },
589
- "__@species@157401": {
589
+ "__@species@143609": {
590
590
  "$ref": "#/definitions/SharedArrayBuffer"
591
591
  },
592
- "__@toStringTag@157363": {
592
+ "__@toStringTag@143571": {
593
593
  "type": "string",
594
594
  "const": "SharedArrayBuffer"
595
595
  }
596
596
  },
597
597
  "additionalProperties": false,
598
598
  "required": [
599
- "__@species@157401",
600
- "__@toStringTag@157363",
599
+ "__@species@143609",
600
+ "__@toStringTag@143571",
601
601
  "byteLength"
602
602
  ]
603
603
  },
@@ -438,14 +438,14 @@
438
438
  "length": {
439
439
  "type": "number"
440
440
  },
441
- "__@toStringTag@171796": {
441
+ "__@toStringTag@172660": {
442
442
  "type": "string",
443
443
  "const": "Uint8Array"
444
444
  }
445
445
  },
446
446
  "required": [
447
447
  "BYTES_PER_ELEMENT",
448
- "__@toStringTag@171796",
448
+ "__@toStringTag@172660",
449
449
  "buffer",
450
450
  "byteLength",
451
451
  "byteOffset",
@@ -480,13 +480,13 @@
480
480
  "byteLength": {
481
481
  "type": "number"
482
482
  },
483
- "__@toStringTag@171796": {
483
+ "__@toStringTag@172660": {
484
484
  "type": "string"
485
485
  }
486
486
  },
487
487
  "additionalProperties": false,
488
488
  "required": [
489
- "__@toStringTag@171796",
489
+ "__@toStringTag@172660",
490
490
  "byteLength"
491
491
  ]
492
492
  },
@@ -496,18 +496,18 @@
496
496
  "byteLength": {
497
497
  "type": "number"
498
498
  },
499
- "__@species@171834": {
499
+ "__@species@172698": {
500
500
  "$ref": "#/definitions/SharedArrayBuffer"
501
501
  },
502
- "__@toStringTag@171796": {
502
+ "__@toStringTag@172660": {
503
503
  "type": "string",
504
504
  "const": "SharedArrayBuffer"
505
505
  }
506
506
  },
507
507
  "additionalProperties": false,
508
508
  "required": [
509
- "__@species@171834",
510
- "__@toStringTag@171796",
509
+ "__@species@172698",
510
+ "__@toStringTag@172660",
511
511
  "byteLength"
512
512
  ]
513
513
  },
@@ -583,14 +583,14 @@
583
583
  "length": {
584
584
  "type": "number"
585
585
  },
586
- "__@toStringTag@257332": {
586
+ "__@toStringTag@258628": {
587
587
  "type": "string",
588
588
  "const": "Uint8Array"
589
589
  }
590
590
  },
591
591
  "required": [
592
592
  "BYTES_PER_ELEMENT",
593
- "__@toStringTag@257332",
593
+ "__@toStringTag@258628",
594
594
  "buffer",
595
595
  "byteLength",
596
596
  "byteOffset",
@@ -625,13 +625,13 @@
625
625
  "byteLength": {
626
626
  "type": "number"
627
627
  },
628
- "__@toStringTag@257332": {
628
+ "__@toStringTag@258628": {
629
629
  "type": "string"
630
630
  }
631
631
  },
632
632
  "additionalProperties": false,
633
633
  "required": [
634
- "__@toStringTag@257332",
634
+ "__@toStringTag@258628",
635
635
  "byteLength"
636
636
  ]
637
637
  },
@@ -641,18 +641,18 @@
641
641
  "byteLength": {
642
642
  "type": "number"
643
643
  },
644
- "__@species@257370": {
644
+ "__@species@258666": {
645
645
  "$ref": "#/definitions/SharedArrayBuffer"
646
646
  },
647
- "__@toStringTag@257332": {
647
+ "__@toStringTag@258628": {
648
648
  "type": "string",
649
649
  "const": "SharedArrayBuffer"
650
650
  }
651
651
  },
652
652
  "additionalProperties": false,
653
653
  "required": [
654
- "__@species@257370",
655
- "__@toStringTag@257332",
654
+ "__@species@258666",
655
+ "__@toStringTag@258628",
656
656
  "byteLength"
657
657
  ]
658
658
  },
@@ -485,14 +485,14 @@
485
485
  "length": {
486
486
  "type": "number"
487
487
  },
488
- "__@toStringTag@300254": {
488
+ "__@toStringTag@387827": {
489
489
  "type": "string",
490
490
  "const": "Uint8Array"
491
491
  }
492
492
  },
493
493
  "required": [
494
494
  "BYTES_PER_ELEMENT",
495
- "__@toStringTag@300254",
495
+ "__@toStringTag@387827",
496
496
  "buffer",
497
497
  "byteLength",
498
498
  "byteOffset",
@@ -527,13 +527,13 @@
527
527
  "byteLength": {
528
528
  "type": "number"
529
529
  },
530
- "__@toStringTag@300254": {
530
+ "__@toStringTag@387827": {
531
531
  "type": "string"
532
532
  }
533
533
  },
534
534
  "additionalProperties": false,
535
535
  "required": [
536
- "__@toStringTag@300254",
536
+ "__@toStringTag@387827",
537
537
  "byteLength"
538
538
  ]
539
539
  },
@@ -543,18 +543,18 @@
543
543
  "byteLength": {
544
544
  "type": "number"
545
545
  },
546
- "__@species@300292": {
546
+ "__@species@387865": {
547
547
  "$ref": "#/definitions/SharedArrayBuffer"
548
548
  },
549
- "__@toStringTag@300254": {
549
+ "__@toStringTag@387827": {
550
550
  "type": "string",
551
551
  "const": "SharedArrayBuffer"
552
552
  }
553
553
  },
554
554
  "additionalProperties": false,
555
555
  "required": [
556
- "__@species@300292",
557
- "__@toStringTag@300254",
556
+ "__@species@387865",
557
+ "__@toStringTag@387827",
558
558
  "byteLength"
559
559
  ]
560
560
  },
@@ -528,14 +528,14 @@
528
528
  "length": {
529
529
  "type": "number"
530
530
  },
531
- "__@toStringTag@328971": {
531
+ "__@toStringTag@301731": {
532
532
  "type": "string",
533
533
  "const": "Uint8Array"
534
534
  }
535
535
  },
536
536
  "required": [
537
537
  "BYTES_PER_ELEMENT",
538
- "__@toStringTag@328971",
538
+ "__@toStringTag@301731",
539
539
  "buffer",
540
540
  "byteLength",
541
541
  "byteOffset",
@@ -570,13 +570,13 @@
570
570
  "byteLength": {
571
571
  "type": "number"
572
572
  },
573
- "__@toStringTag@328971": {
573
+ "__@toStringTag@301731": {
574
574
  "type": "string"
575
575
  }
576
576
  },
577
577
  "additionalProperties": false,
578
578
  "required": [
579
- "__@toStringTag@328971",
579
+ "__@toStringTag@301731",
580
580
  "byteLength"
581
581
  ]
582
582
  },
@@ -586,18 +586,18 @@
586
586
  "byteLength": {
587
587
  "type": "number"
588
588
  },
589
- "__@species@329009": {
589
+ "__@species@301769": {
590
590
  "$ref": "#/definitions/SharedArrayBuffer"
591
591
  },
592
- "__@toStringTag@328971": {
592
+ "__@toStringTag@301731": {
593
593
  "type": "string",
594
594
  "const": "SharedArrayBuffer"
595
595
  }
596
596
  },
597
597
  "additionalProperties": false,
598
598
  "required": [
599
- "__@species@329009",
600
- "__@toStringTag@328971",
599
+ "__@species@301769",
600
+ "__@toStringTag@301731",
601
601
  "byteLength"
602
602
  ]
603
603
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browserless.io/browserless",
3
- "version": "2.22.0-beta-1",
3
+ "version": "2.22.0-beta-2",
4
4
  "license": "SSPL",
5
5
  "description": "The browserless platform",
6
6
  "author": "browserless.io",
@@ -61,7 +61,7 @@
61
61
  "playwright-1.44": "npm:playwright-core@1.44.1",
62
62
  "playwright-1.45": "npm:playwright-core@1.45.3",
63
63
  "playwright-1.46": "npm:playwright-core@1.46.1",
64
- "playwright-core": "^1.47.2",
64
+ "playwright-core": "^1.48.0",
65
65
  "puppeteer-core": "^23.5.1",
66
66
  "puppeteer-extra": "^3.3.6",
67
67
  "puppeteer-extra-plugin-stealth": "^2.11.2",
@@ -255,14 +255,14 @@
255
255
  "length": {
256
256
  "type": "number"
257
257
  },
258
- "__@toStringTag@14355": {
258
+ "__@toStringTag@14427": {
259
259
  "type": "string",
260
260
  "const": "Uint8Array"
261
261
  }
262
262
  },
263
263
  "required": [
264
264
  "BYTES_PER_ELEMENT",
265
- "__@toStringTag@14355",
265
+ "__@toStringTag@14427",
266
266
  "buffer",
267
267
  "byteLength",
268
268
  "byteOffset",
@@ -297,13 +297,13 @@
297
297
  "byteLength": {
298
298
  "type": "number"
299
299
  },
300
- "__@toStringTag@14355": {
300
+ "__@toStringTag@14427": {
301
301
  "type": "string"
302
302
  }
303
303
  },
304
304
  "additionalProperties": false,
305
305
  "required": [
306
- "__@toStringTag@14355",
306
+ "__@toStringTag@14427",
307
307
  "byteLength"
308
308
  ]
309
309
  },
@@ -313,18 +313,18 @@
313
313
  "byteLength": {
314
314
  "type": "number"
315
315
  },
316
- "__@species@14393": {
316
+ "__@species@14465": {
317
317
  "$ref": "#/definitions/SharedArrayBuffer"
318
318
  },
319
- "__@toStringTag@14355": {
319
+ "__@toStringTag@14427": {
320
320
  "type": "string",
321
321
  "const": "SharedArrayBuffer"
322
322
  }
323
323
  },
324
324
  "additionalProperties": false,
325
325
  "required": [
326
- "__@species@14393",
327
- "__@toStringTag@14355",
326
+ "__@species@14465",
327
+ "__@toStringTag@14427",
328
328
  "byteLength"
329
329
  ]
330
330
  },
@@ -969,7 +969,7 @@
969
969
  },
970
970
  "info": {
971
971
  "title": "Browserless",
972
- "version": "2.22.0-beta-1",
972
+ "version": "2.22.0-beta-2",
973
973
  "x-logo": {
974
974
  "altText": "browserless logo",
975
975
  "url": "./docs/browserless-logo-inline.svg"
@@ -255,14 +255,14 @@
255
255
  "length": {
256
256
  "type": "number"
257
257
  },
258
- "__@toStringTag@14355": {
258
+ "__@toStringTag@14427": {
259
259
  "type": "string",
260
260
  "const": "Uint8Array"
261
261
  }
262
262
  },
263
263
  "required": [
264
264
  "BYTES_PER_ELEMENT",
265
- "__@toStringTag@14355",
265
+ "__@toStringTag@14427",
266
266
  "buffer",
267
267
  "byteLength",
268
268
  "byteOffset",
@@ -297,13 +297,13 @@
297
297
  "byteLength": {
298
298
  "type": "number"
299
299
  },
300
- "__@toStringTag@14355": {
300
+ "__@toStringTag@14427": {
301
301
  "type": "string"
302
302
  }
303
303
  },
304
304
  "additionalProperties": false,
305
305
  "required": [
306
- "__@toStringTag@14355",
306
+ "__@toStringTag@14427",
307
307
  "byteLength"
308
308
  ]
309
309
  },
@@ -313,18 +313,18 @@
313
313
  "byteLength": {
314
314
  "type": "number"
315
315
  },
316
- "__@species@14393": {
316
+ "__@species@14465": {
317
317
  "$ref": "#/definitions/SharedArrayBuffer"
318
318
  },
319
- "__@toStringTag@14355": {
319
+ "__@toStringTag@14427": {
320
320
  "type": "string",
321
321
  "const": "SharedArrayBuffer"
322
322
  }
323
323
  },
324
324
  "additionalProperties": false,
325
325
  "required": [
326
- "__@species@14393",
327
- "__@toStringTag@14355",
326
+ "__@species@14465",
327
+ "__@toStringTag@14427",
328
328
  "byteLength"
329
329
  ]
330
330
  },
@@ -969,7 +969,7 @@
969
969
  },
970
970
  "info": {
971
971
  "title": "Browserless",
972
- "version": "2.22.0-beta-1",
972
+ "version": "2.22.0-beta-2",
973
973
  "x-logo": {
974
974
  "altText": "browserless logo",
975
975
  "url": "./docs/browserless-logo-inline.svg"
@@ -4382,7 +4382,7 @@
4382
4382
  // node_modules/puppeteer-core/lib/esm/puppeteer/generated/version.js
4383
4383
  init_dirname();
4384
4384
  init_buffer2();
4385
- var packageVersion = "23.4.1";
4385
+ var packageVersion = "23.5.1";
4386
4386
 
4387
4387
  // node_modules/puppeteer-core/lib/esm/puppeteer/util/assert.js
4388
4388
  init_dirname();
@@ -10119,7 +10119,7 @@
10119
10119
  return await frame.isolatedRealm().adoptHandle(elementOrFrame);
10120
10120
  })(), false);
10121
10121
  const { visible = false, hidden = false, timeout: timeout2, signal } = options;
10122
- const polling = options.polling ?? (visible || hidden ? "raf" : "mutation");
10122
+ const polling = visible || hidden ? "raf" : options.polling;
10123
10123
  try {
10124
10124
  const env_4 = { stack: [], error: void 0, hasError: false };
10125
10125
  try {
@@ -14480,8 +14480,9 @@ ${sourceUrlComment}
14480
14480
  * Waits for the next context to be set on the isolated world.
14481
14481
  */
14482
14482
  async #waitForExecutionContext() {
14483
+ const error = new Error("Execution context was destroyed");
14483
14484
  const result = await firstValueFrom(fromEmitterEvent(this.#emitter, "context").pipe(raceWith(fromEmitterEvent(this.#emitter, "disposed").pipe(map(() => {
14484
- throw new Error("Execution context was destroyed");
14485
+ throw error;
14485
14486
  })), timeout(this.timeoutSettings.timeout()))));
14486
14487
  return result;
14487
14488
  }
@@ -15008,6 +15009,20 @@ ${sourceUrlComment}
15008
15009
  exposeFunction() {
15009
15010
  throw new UnsupportedOperation();
15010
15011
  }
15012
+ async frameElement() {
15013
+ const isFirefox = this.page().target()._targetManager() instanceof FirefoxTargetManager;
15014
+ if (isFirefox) {
15015
+ return await super.frameElement();
15016
+ }
15017
+ const parent = this.parentFrame();
15018
+ if (!parent) {
15019
+ return null;
15020
+ }
15021
+ const { backendNodeId } = await parent.client.send("DOM.getFrameOwner", {
15022
+ frameId: this._id
15023
+ });
15024
+ return await parent.mainRealm().adoptBackendNode(backendNodeId);
15025
+ }
15011
15026
  };
15012
15027
  })();
15013
15028
 
@@ -15221,6 +15236,9 @@ ${sourceUrlComment}
15221
15236
  return await this._continue(this.interception.requestOverrides);
15222
15237
  }
15223
15238
  }
15239
+ #canBeIntercepted() {
15240
+ return !this.url().startsWith("data:") && !this._fromMemoryCache;
15241
+ }
15224
15242
  /**
15225
15243
  * Continues request with optional request overrides.
15226
15244
  *
@@ -15250,7 +15268,7 @@ ${sourceUrlComment}
15250
15268
  * Exception is immediately thrown if the request interception is not enabled.
15251
15269
  */
15252
15270
  async continue(overrides = {}, priority) {
15253
- if (this.url().startsWith("data:")) {
15271
+ if (!this.#canBeIntercepted()) {
15254
15272
  return;
15255
15273
  }
15256
15274
  assert(this.interception.enabled, "Request Interception is not enabled!");
@@ -15307,7 +15325,7 @@ ${sourceUrlComment}
15307
15325
  * Exception is immediately thrown if the request interception is not enabled.
15308
15326
  */
15309
15327
  async respond(response, priority) {
15310
- if (this.url().startsWith("data:")) {
15328
+ if (!this.#canBeIntercepted()) {
15311
15329
  return;
15312
15330
  }
15313
15331
  assert(this.interception.enabled, "Request Interception is not enabled!");
@@ -15345,7 +15363,7 @@ ${sourceUrlComment}
15345
15363
  * throw an exception immediately.
15346
15364
  */
15347
15365
  async abort(errorCode = "failed", priority) {
15348
- if (this.url().startsWith("data:")) {
15366
+ if (!this.#canBeIntercepted()) {
15349
15367
  return;
15350
15368
  }
15351
15369
  const errorReason = errorReasons[errorCode];
@@ -15984,6 +16002,29 @@ ${sourceUrlComment}
15984
16002
  forgetQueuedEventGroup(networkRequestId) {
15985
16003
  this.#queuedEventGroupMap.delete(networkRequestId);
15986
16004
  }
16005
+ printState() {
16006
+ function replacer(_key, value) {
16007
+ if (value instanceof Map) {
16008
+ return {
16009
+ dataType: "Map",
16010
+ value: Array.from(value.entries())
16011
+ // or with spread: value: [...value]
16012
+ };
16013
+ } else if (value instanceof CdpHTTPRequest) {
16014
+ return {
16015
+ dataType: "CdpHTTPRequest",
16016
+ value: `${value.id}: ${value.url()}`
16017
+ };
16018
+ }
16019
+ {
16020
+ return value;
16021
+ }
16022
+ }
16023
+ console.log("httpRequestsMap", JSON.stringify(this.#httpRequestsMap, replacer, 2));
16024
+ console.log("requestWillBeSentMap", JSON.stringify(this.#requestWillBeSentMap, replacer, 2));
16025
+ console.log("requestWillBeSentMap", JSON.stringify(this.#responseReceivedExtraInfoMap, replacer, 2));
16026
+ console.log("requestWillBeSentMap", JSON.stringify(this.#requestPausedMap, replacer, 2));
16027
+ }
15987
16028
  };
15988
16029
 
15989
16030
  // node_modules/puppeteer-core/lib/esm/puppeteer/cdp/NetworkManager.js
@@ -16246,7 +16287,7 @@ ${sourceUrlComment}
16246
16287
  this.emit(NetworkManagerEvent.Request, request);
16247
16288
  void request.finalizeInterceptions();
16248
16289
  }
16249
- #onRequest(client, event, fetchRequestId) {
16290
+ #onRequest(client, event, fetchRequestId, fromMemoryCache = false) {
16250
16291
  let redirectChain = [];
16251
16292
  if (event.redirectResponse) {
16252
16293
  let redirectResponseExtraInfo = null;
@@ -16268,15 +16309,25 @@ ${sourceUrlComment}
16268
16309
  }
16269
16310
  const frame = event.frameId ? this.#frameManager.frame(event.frameId) : null;
16270
16311
  const request = new CdpHTTPRequest(client, frame, fetchRequestId, this.#userRequestInterceptionEnabled, event, redirectChain);
16312
+ request._fromMemoryCache = fromMemoryCache;
16271
16313
  this.#networkEventManager.storeRequest(event.requestId, request);
16272
16314
  this.emit(NetworkManagerEvent.Request, request);
16273
16315
  void request.finalizeInterceptions();
16274
16316
  }
16275
- #onRequestServedFromCache(_client, event) {
16276
- const request = this.#networkEventManager.getRequest(event.requestId);
16317
+ #onRequestServedFromCache(client, event) {
16318
+ const requestWillBeSentEvent = this.#networkEventManager.getRequestWillBeSent(event.requestId);
16319
+ let request = this.#networkEventManager.getRequest(event.requestId);
16277
16320
  if (request) {
16278
16321
  request._fromMemoryCache = true;
16279
16322
  }
16323
+ if (!request && requestWillBeSentEvent) {
16324
+ this.#onRequest(client, requestWillBeSentEvent, void 0, true);
16325
+ request = this.#networkEventManager.getRequest(event.requestId);
16326
+ }
16327
+ if (!request) {
16328
+ debugError(new Error(`Request ${event.requestId} was served from cache but we could not find the corresponding request object`));
16329
+ return;
16330
+ }
16280
16331
  this.emit(NetworkManagerEvent.RequestServedFromCache, request);
16281
16332
  }
16282
16333
  #handleRequestRedirect(client, request, responsePayload, extraInfo) {
@@ -4390,7 +4390,7 @@
4390
4390
  // node_modules/puppeteer-core/lib/esm/puppeteer/generated/version.js
4391
4391
  init_dirname();
4392
4392
  init_buffer2();
4393
- var packageVersion = "23.4.1";
4393
+ var packageVersion = "23.5.1";
4394
4394
 
4395
4395
  // node_modules/puppeteer-core/lib/esm/puppeteer/util/assert.js
4396
4396
  init_dirname();
@@ -10127,7 +10127,7 @@
10127
10127
  return await frame.isolatedRealm().adoptHandle(elementOrFrame);
10128
10128
  })(), false);
10129
10129
  const { visible = false, hidden = false, timeout: timeout2, signal } = options;
10130
- const polling = options.polling ?? (visible || hidden ? "raf" : "mutation");
10130
+ const polling = visible || hidden ? "raf" : options.polling;
10131
10131
  try {
10132
10132
  const env_4 = { stack: [], error: void 0, hasError: false };
10133
10133
  try {
@@ -14488,8 +14488,9 @@ ${sourceUrlComment}
14488
14488
  * Waits for the next context to be set on the isolated world.
14489
14489
  */
14490
14490
  async #waitForExecutionContext() {
14491
+ const error = new Error("Execution context was destroyed");
14491
14492
  const result = await firstValueFrom(fromEmitterEvent(this.#emitter, "context").pipe(raceWith(fromEmitterEvent(this.#emitter, "disposed").pipe(map(() => {
14492
- throw new Error("Execution context was destroyed");
14493
+ throw error;
14493
14494
  })), timeout(this.timeoutSettings.timeout()))));
14494
14495
  return result;
14495
14496
  }
@@ -15016,6 +15017,20 @@ ${sourceUrlComment}
15016
15017
  exposeFunction() {
15017
15018
  throw new UnsupportedOperation();
15018
15019
  }
15020
+ async frameElement() {
15021
+ const isFirefox = this.page().target()._targetManager() instanceof FirefoxTargetManager;
15022
+ if (isFirefox) {
15023
+ return await super.frameElement();
15024
+ }
15025
+ const parent = this.parentFrame();
15026
+ if (!parent) {
15027
+ return null;
15028
+ }
15029
+ const { backendNodeId } = await parent.client.send("DOM.getFrameOwner", {
15030
+ frameId: this._id
15031
+ });
15032
+ return await parent.mainRealm().adoptBackendNode(backendNodeId);
15033
+ }
15019
15034
  };
15020
15035
  })();
15021
15036
 
@@ -15229,6 +15244,9 @@ ${sourceUrlComment}
15229
15244
  return await this._continue(this.interception.requestOverrides);
15230
15245
  }
15231
15246
  }
15247
+ #canBeIntercepted() {
15248
+ return !this.url().startsWith("data:") && !this._fromMemoryCache;
15249
+ }
15232
15250
  /**
15233
15251
  * Continues request with optional request overrides.
15234
15252
  *
@@ -15258,7 +15276,7 @@ ${sourceUrlComment}
15258
15276
  * Exception is immediately thrown if the request interception is not enabled.
15259
15277
  */
15260
15278
  async continue(overrides = {}, priority) {
15261
- if (this.url().startsWith("data:")) {
15279
+ if (!this.#canBeIntercepted()) {
15262
15280
  return;
15263
15281
  }
15264
15282
  assert(this.interception.enabled, "Request Interception is not enabled!");
@@ -15315,7 +15333,7 @@ ${sourceUrlComment}
15315
15333
  * Exception is immediately thrown if the request interception is not enabled.
15316
15334
  */
15317
15335
  async respond(response, priority) {
15318
- if (this.url().startsWith("data:")) {
15336
+ if (!this.#canBeIntercepted()) {
15319
15337
  return;
15320
15338
  }
15321
15339
  assert(this.interception.enabled, "Request Interception is not enabled!");
@@ -15353,7 +15371,7 @@ ${sourceUrlComment}
15353
15371
  * throw an exception immediately.
15354
15372
  */
15355
15373
  async abort(errorCode = "failed", priority) {
15356
- if (this.url().startsWith("data:")) {
15374
+ if (!this.#canBeIntercepted()) {
15357
15375
  return;
15358
15376
  }
15359
15377
  const errorReason = errorReasons[errorCode];
@@ -15992,6 +16010,29 @@ ${sourceUrlComment}
15992
16010
  forgetQueuedEventGroup(networkRequestId) {
15993
16011
  this.#queuedEventGroupMap.delete(networkRequestId);
15994
16012
  }
16013
+ printState() {
16014
+ function replacer(_key, value) {
16015
+ if (value instanceof Map) {
16016
+ return {
16017
+ dataType: "Map",
16018
+ value: Array.from(value.entries())
16019
+ // or with spread: value: [...value]
16020
+ };
16021
+ } else if (value instanceof CdpHTTPRequest) {
16022
+ return {
16023
+ dataType: "CdpHTTPRequest",
16024
+ value: `${value.id}: ${value.url()}`
16025
+ };
16026
+ }
16027
+ {
16028
+ return value;
16029
+ }
16030
+ }
16031
+ console.log("httpRequestsMap", JSON.stringify(this.#httpRequestsMap, replacer, 2));
16032
+ console.log("requestWillBeSentMap", JSON.stringify(this.#requestWillBeSentMap, replacer, 2));
16033
+ console.log("requestWillBeSentMap", JSON.stringify(this.#responseReceivedExtraInfoMap, replacer, 2));
16034
+ console.log("requestWillBeSentMap", JSON.stringify(this.#requestPausedMap, replacer, 2));
16035
+ }
15995
16036
  };
15996
16037
 
15997
16038
  // node_modules/puppeteer-core/lib/esm/puppeteer/cdp/NetworkManager.js
@@ -16254,7 +16295,7 @@ ${sourceUrlComment}
16254
16295
  this.emit(NetworkManagerEvent.Request, request);
16255
16296
  void request.finalizeInterceptions();
16256
16297
  }
16257
- #onRequest(client, event, fetchRequestId) {
16298
+ #onRequest(client, event, fetchRequestId, fromMemoryCache = false) {
16258
16299
  let redirectChain = [];
16259
16300
  if (event.redirectResponse) {
16260
16301
  let redirectResponseExtraInfo = null;
@@ -16276,15 +16317,25 @@ ${sourceUrlComment}
16276
16317
  }
16277
16318
  const frame = event.frameId ? this.#frameManager.frame(event.frameId) : null;
16278
16319
  const request = new CdpHTTPRequest(client, frame, fetchRequestId, this.#userRequestInterceptionEnabled, event, redirectChain);
16320
+ request._fromMemoryCache = fromMemoryCache;
16279
16321
  this.#networkEventManager.storeRequest(event.requestId, request);
16280
16322
  this.emit(NetworkManagerEvent.Request, request);
16281
16323
  void request.finalizeInterceptions();
16282
16324
  }
16283
- #onRequestServedFromCache(_client, event) {
16284
- const request = this.#networkEventManager.getRequest(event.requestId);
16325
+ #onRequestServedFromCache(client, event) {
16326
+ const requestWillBeSentEvent = this.#networkEventManager.getRequestWillBeSent(event.requestId);
16327
+ let request = this.#networkEventManager.getRequest(event.requestId);
16285
16328
  if (request) {
16286
16329
  request._fromMemoryCache = true;
16287
16330
  }
16331
+ if (!request && requestWillBeSentEvent) {
16332
+ this.#onRequest(client, requestWillBeSentEvent, void 0, true);
16333
+ request = this.#networkEventManager.getRequest(event.requestId);
16334
+ }
16335
+ if (!request) {
16336
+ debugError(new Error(`Request ${event.requestId} was served from cache but we could not find the corresponding request object`));
16337
+ return;
16338
+ }
16288
16339
  this.emit(NetworkManagerEvent.RequestServedFromCache, request);
16289
16340
  }
16290
16341
  #handleRequestRedirect(client, request, responsePayload, extraInfo) {