playwright-core 1.57.0-alpha-2025-10-06 → 1.57.0-alpha-2025-10-07

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.
@@ -5,6 +5,7 @@ THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
5
5
  This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
6
6
 
7
7
  - agent-base@6.0.2 (https://github.com/TooTallNate/node-agent-base)
8
+ - agent-base@7.1.4 (https://github.com/TooTallNate/proxy-agents)
8
9
  - balanced-match@1.0.2 (https://github.com/juliangruber/balanced-match)
9
10
  - brace-expansion@1.1.12 (https://github.com/juliangruber/brace-expansion)
10
11
  - buffer-crc32@0.2.13 (https://github.com/brianloveswords/buffer-crc32)
@@ -20,7 +21,7 @@ This project incorporates components from the projects listed below. The origina
20
21
  - end-of-stream@1.4.4 (https://github.com/mafintosh/end-of-stream)
21
22
  - get-stream@5.2.0 (https://github.com/sindresorhus/get-stream)
22
23
  - graceful-fs@4.2.10 (https://github.com/isaacs/node-graceful-fs)
23
- - https-proxy-agent@5.0.1 (https://github.com/TooTallNate/node-https-proxy-agent)
24
+ - https-proxy-agent@7.0.6 (https://github.com/TooTallNate/proxy-agents)
24
25
  - ip-address@9.0.5 (https://github.com/beaugunderson/ip-address)
25
26
  - is-docker@2.2.1 (https://github.com/sindresorhus/is-docker)
26
27
  - is-wsl@2.2.0 (https://github.com/sindresorhus/is-wsl)
@@ -199,6 +200,33 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
199
200
  =========================================
200
201
  END OF agent-base@6.0.2 AND INFORMATION
201
202
 
203
+ %% agent-base@7.1.4 NOTICES AND INFORMATION BEGIN HERE
204
+ =========================================
205
+ (The MIT License)
206
+
207
+ Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
208
+
209
+ Permission is hereby granted, free of charge, to any person obtaining
210
+ a copy of this software and associated documentation files (the
211
+ 'Software'), to deal in the Software without restriction, including
212
+ without limitation the rights to use, copy, modify, merge, publish,
213
+ distribute, sublicense, and/or sell copies of the Software, and to
214
+ permit persons to whom the Software is furnished to do so, subject to
215
+ the following conditions:
216
+
217
+ The above copyright notice and this permission notice shall be
218
+ included in all copies or substantial portions of the Software.
219
+
220
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
221
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
222
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
223
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
224
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
225
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
226
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
227
+ =========================================
228
+ END OF agent-base@7.1.4 AND INFORMATION
229
+
202
230
  %% balanced-match@1.0.2 NOTICES AND INFORMATION BEGIN HERE
203
231
  =========================================
204
232
  (MIT)
@@ -565,124 +593,11 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
565
593
  =========================================
566
594
  END OF graceful-fs@4.2.10 AND INFORMATION
567
595
 
568
- %% https-proxy-agent@5.0.1 NOTICES AND INFORMATION BEGIN HERE
596
+ %% https-proxy-agent@7.0.6 NOTICES AND INFORMATION BEGIN HERE
569
597
  =========================================
570
- https-proxy-agent
571
- ================
572
- ### An HTTP(s) proxy `http.Agent` implementation for HTTPS
573
- [![Build Status](https://github.com/TooTallNate/node-https-proxy-agent/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-https-proxy-agent/actions?workflow=Node+CI)
574
-
575
- This module provides an `http.Agent` implementation that connects to a specified
576
- HTTP or HTTPS proxy server, and can be used with the built-in `https` module.
577
-
578
- Specifically, this `Agent` implementation connects to an intermediary "proxy"
579
- server and issues the [CONNECT HTTP method][CONNECT], which tells the proxy to
580
- open a direct TCP connection to the destination server.
581
-
582
- Since this agent implements the CONNECT HTTP method, it also works with other
583
- protocols that use this method when connecting over proxies (i.e. WebSockets).
584
- See the "Examples" section below for more.
585
-
586
-
587
- Installation
588
- ------------
589
-
590
- Install with `npm`:
591
-
592
- ``` bash
593
- $ npm install https-proxy-agent
594
- ```
595
-
596
-
597
- Examples
598
- --------
599
-
600
- #### `https` module example
601
-
602
- ``` js
603
- var url = require('url');
604
- var https = require('https');
605
- var HttpsProxyAgent = require('https-proxy-agent');
606
-
607
- // HTTP/HTTPS proxy to connect to
608
- var proxy = process.env.http_proxy || 'http://168.63.76.32:3128';
609
- console.log('using proxy server %j', proxy);
610
-
611
- // HTTPS endpoint for the proxy to connect to
612
- var endpoint = process.argv[2] || 'https://graph.facebook.com/tootallnate';
613
- console.log('attempting to GET %j', endpoint);
614
- var options = url.parse(endpoint);
615
-
616
- // create an instance of the `HttpsProxyAgent` class with the proxy server information
617
- var agent = new HttpsProxyAgent(proxy);
618
- options.agent = agent;
619
-
620
- https.get(options, function (res) {
621
- console.log('"response" event!', res.headers);
622
- res.pipe(process.stdout);
623
- });
624
- ```
625
-
626
- #### `ws` WebSocket connection example
627
-
628
- ``` js
629
- var url = require('url');
630
- var WebSocket = require('ws');
631
- var HttpsProxyAgent = require('https-proxy-agent');
632
-
633
- // HTTP/HTTPS proxy to connect to
634
- var proxy = process.env.http_proxy || 'http://168.63.76.32:3128';
635
- console.log('using proxy server %j', proxy);
636
-
637
- // WebSocket endpoint for the proxy to connect to
638
- var endpoint = process.argv[2] || 'ws://echo.websocket.org';
639
- var parsed = url.parse(endpoint);
640
- console.log('attempting to connect to WebSocket %j', endpoint);
641
-
642
- // create an instance of the `HttpsProxyAgent` class with the proxy server information
643
- var options = url.parse(proxy);
644
-
645
- var agent = new HttpsProxyAgent(options);
646
-
647
- // finally, initiate the WebSocket connection
648
- var socket = new WebSocket(endpoint, { agent: agent });
649
-
650
- socket.on('open', function () {
651
- console.log('"open" event!');
652
- socket.send('hello world');
653
- });
654
-
655
- socket.on('message', function (data, flags) {
656
- console.log('"message" event! %j %j', data, flags);
657
- socket.close();
658
- });
659
- ```
660
-
661
- API
662
- ---
663
-
664
- ### new HttpsProxyAgent(Object options)
665
-
666
- The `HttpsProxyAgent` class implements an `http.Agent` subclass that connects
667
- to the specified "HTTP(s) proxy server" in order to proxy HTTPS and/or WebSocket
668
- requests. This is achieved by using the [HTTP `CONNECT` method][CONNECT].
669
-
670
- The `options` argument may either be a string URI of the proxy server to use, or an
671
- "options" object with more specific properties:
672
-
673
- * `host` - String - Proxy host to connect to (may use `hostname` as well). Required.
674
- * `port` - Number - Proxy port to connect to. Required.
675
- * `protocol` - String - If `https:`, then use TLS to connect to the proxy.
676
- * `headers` - Object - Additional HTTP headers to be sent on the HTTP CONNECT method.
677
- * Any other options given are passed to the `net.connect()`/`tls.connect()` functions.
678
-
679
-
680
- License
681
- -------
682
-
683
598
  (The MIT License)
684
599
 
685
- Copyright (c) 2013 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
600
+ Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
686
601
 
687
602
  Permission is hereby granted, free of charge, to any person obtaining
688
603
  a copy of this software and associated documentation files (the
@@ -702,10 +617,8 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
702
617
  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
703
618
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
704
619
  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
705
-
706
- [CONNECT]: http://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_Tunneling
707
620
  =========================================
708
- END OF https-proxy-agent@5.0.1 AND INFORMATION
621
+ END OF https-proxy-agent@7.0.6 AND INFORMATION
709
622
 
710
623
  %% ip-address@9.0.5 NOTICES AND INFORMATION BEGIN HERE
711
624
  =========================================
@@ -1497,6 +1410,6 @@ END OF yazl@2.5.1 AND INFORMATION
1497
1410
 
1498
1411
  SUMMARY BEGIN HERE
1499
1412
  =========================================
1500
- Total Packages: 44
1413
+ Total Packages: 45
1501
1414
  =========================================
1502
1415
  END OF SUMMARY
@@ -69,7 +69,6 @@ class BrowserContext extends import_instrumentation.SdkObject {
69
69
  this._creatingStorageStatePage = false;
70
70
  this.initScripts = [];
71
71
  this._routesInFlight = /* @__PURE__ */ new Set();
72
- this._playwrightBindingExposed = false;
73
72
  this.attribution.context = this;
74
73
  this._browser = browser;
75
74
  this._options = options;
@@ -231,17 +230,17 @@ if (navigator.serviceWorker) navigator.serviceWorker.register = async () => { co
231
230
  return this._pageBindings.get(name)?.forClient;
232
231
  }
233
232
  async exposePlaywrightBindingIfNeeded() {
234
- if (this._playwrightBindingExposed)
235
- return;
236
- this._playwrightBindingExposed = true;
237
- await this.doExposePlaywrightBinding();
238
- this.bindingsInitScript = import_page2.PageBinding.createInitScript();
239
- this.initScripts.push(this.bindingsInitScript);
240
- await this.doAddInitScript(this.bindingsInitScript);
241
- await this.safeNonStallingEvaluateInAllFrames(this.bindingsInitScript.source, "main");
233
+ this._playwrightBindingExposed ??= (async () => {
234
+ await this.doExposePlaywrightBinding();
235
+ this.bindingsInitScript = import_page2.PageBinding.createInitScript();
236
+ this.initScripts.push(this.bindingsInitScript);
237
+ await this.doAddInitScript(this.bindingsInitScript);
238
+ await this.safeNonStallingEvaluateInAllFrames(this.bindingsInitScript.source, "main");
239
+ })();
240
+ return await this._playwrightBindingExposed;
242
241
  }
243
242
  needsPlaywrightBinding() {
244
- return this._playwrightBindingExposed;
243
+ return this._playwrightBindingExposed !== void 0;
245
244
  }
246
245
  async exposeBinding(progress, name, needsHandle, playwrightBinding, forClient) {
247
246
  if (this._pageBindings.has(name))
@@ -44,6 +44,8 @@ const disabledFeatures = (assistantMode) => [
44
44
  "Translate",
45
45
  // See https://issues.chromium.org/u/1/issues/435410220
46
46
  "AutoDeElevate",
47
+ // See https://github.com/microsoft/playwright/issues/37714
48
+ "RenderDocument",
47
49
  assistantMode ? "AutomationControlled" : ""
48
50
  ].filter(Boolean);
49
51
  const chromiumSwitches = (assistantMode, channel) => [
@@ -81,10 +81,14 @@ class SocksProxyConnection {
81
81
  }
82
82
  async connect() {
83
83
  const proxyAgent = this.socksProxy.getProxyAgent(this.host, this.port);
84
- if (proxyAgent)
85
- this._serverEncrypted = await proxyAgent.callback(new import_events.EventEmitter(), { host: rewriteToLocalhostIfNeeded(this.host), port: this.port, secureEndpoint: false });
86
- else
84
+ if (proxyAgent) {
85
+ if ("callback" in proxyAgent)
86
+ this._serverEncrypted = await proxyAgent.callback(new import_events.EventEmitter(), { host: rewriteToLocalhostIfNeeded(this.host), port: this.port, secureEndpoint: false });
87
+ else
88
+ this._serverEncrypted = await proxyAgent.connect(new import_events.EventEmitter(), { host: rewriteToLocalhostIfNeeded(this.host), port: this.port, secureEndpoint: false });
89
+ } else {
87
90
  this._serverEncrypted = await (0, import_happyEyeballs.createSocket)(rewriteToLocalhostIfNeeded(this.host), this.port);
91
+ }
88
92
  this._serverEncrypted.once("close", this._serverCloseEventListener);
89
93
  this._serverEncrypted.once("error", (error) => this._browserEncrypted.destroy(error));
90
94
  if (this._closed) {
@@ -68,8 +68,7 @@ function httpRequest(params, onResponse, onError) {
68
68
  method: options.method
69
69
  };
70
70
  } else {
71
- parsedProxyURL.secureProxy = parsedProxyURL.protocol === "https:";
72
- options.agent = new import_utilsBundle.HttpsProxyAgent(parsedProxyURL);
71
+ options.agent = new import_utilsBundle.HttpsProxyAgent(import_url.default.format(parsedProxyURL));
73
72
  options.rejectUnauthorized = false;
74
73
  }
75
74
  }
@@ -152,9 +151,9 @@ function createProxyAgent(proxy, forUrl) {
152
151
  if (proxy.username)
153
152
  proxyOpts.auth = `${proxy.username}:${proxy.password || ""}`;
154
153
  if (forUrl && ["ws:", "wss:"].includes(forUrl.protocol)) {
155
- return new import_utilsBundle.HttpsProxyAgent(proxyOpts);
154
+ return new import_utilsBundle.HttpsProxyAgent(import_url.default.format(proxyOpts));
156
155
  }
157
- return new import_utilsBundle.HttpsProxyAgent(proxyOpts);
156
+ return new import_utilsBundle.HttpsProxyAgent(import_url.default.format(proxyOpts));
158
157
  }
159
158
  function createHttpServer(...args) {
160
159
  const server = import_http.default.createServer(...args);