playwright-core 1.56.0-alpha-2025-09-29 → 1.56.0-alpha-1759271123000

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.
@@ -201,6 +201,12 @@ class BidiBrowserContext extends import_browserContext.BrowserContext {
201
201
  userContexts: [this._userContextId()]
202
202
  }));
203
203
  }
204
+ if (this._options.userAgent) {
205
+ promises.push(this._browser._browserSession.send("emulation.setUserAgentOverride", {
206
+ userAgent: this._options.userAgent,
207
+ userContexts: [this._userContextId()]
208
+ }));
209
+ }
204
210
  await Promise.all(promises);
205
211
  }
206
212
  possiblyUninitializedPages() {
@@ -296,6 +302,11 @@ class BidiBrowserContext extends import_browserContext.BrowserContext {
296
302
  async doUpdateExtraHTTPHeaders() {
297
303
  }
298
304
  async setUserAgent(userAgent) {
305
+ this._options.userAgent = userAgent;
306
+ await this._browser._browserSession.send("emulation.setUserAgentOverride", {
307
+ userAgent: userAgent ?? null,
308
+ userContexts: [this._userContextId()]
309
+ });
299
310
  }
300
311
  async doUpdateOffline() {
301
312
  }