diff --git a/dotnet/src/webdriver/BiDi/Modules/Browser/BrowserModule.cs b/dotnet/src/webdriver/BiDi/Modules/Browser/BrowserModule.cs index 822fbe26ae33d..fe6b939eb6292 100644 --- a/dotnet/src/webdriver/BiDi/Modules/Browser/BrowserModule.cs +++ b/dotnet/src/webdriver/BiDi/Modules/Browser/BrowserModule.cs @@ -17,7 +17,6 @@ // under the License. // -using System.Collections.Generic; using System.Threading.Tasks; using OpenQA.Selenium.BiDi.Communication; @@ -32,7 +31,9 @@ public async Task CloseAsync(CloseOptions? options = null) public async Task CreateUserContextAsync(CreateUserContextOptions? options = null) { - return await Broker.ExecuteCommandAsync(new CreateUserContextCommand(), options).ConfigureAwait(false); + var @params = new CreateUserContextCommandParameters(options?.AcceptInsecureCerts, options?.Proxy); + + return await Broker.ExecuteCommandAsync(new CreateUserContextCommand(@params), options).ConfigureAwait(false); } public async Task GetUserContextsAsync(GetUserContextsOptions? options = null) diff --git a/dotnet/src/webdriver/BiDi/Modules/Browser/CreateUserContextCommand.cs b/dotnet/src/webdriver/BiDi/Modules/Browser/CreateUserContextCommand.cs index f847168ebd9f4..fb695faa9d248 100644 --- a/dotnet/src/webdriver/BiDi/Modules/Browser/CreateUserContextCommand.cs +++ b/dotnet/src/webdriver/BiDi/Modules/Browser/CreateUserContextCommand.cs @@ -21,7 +21,14 @@ namespace OpenQA.Selenium.BiDi.Modules.Browser; -internal class CreateUserContextCommand() - : Command(CommandParameters.Empty, "browser.createUserContext"); +internal class CreateUserContextCommand(CreateUserContextCommandParameters @params) + : Command(@params, "browser.createUserContext"); -public record CreateUserContextOptions : CommandOptions; +internal record CreateUserContextCommandParameters(bool? AcceptInsecureCerts, Session.ProxyConfiguration? Proxy) : CommandParameters; + +public record CreateUserContextOptions : CommandOptions +{ + public bool? AcceptInsecureCerts { get; set; } + + public Session.ProxyConfiguration? Proxy { get; set; } +}