Skip to content

Commit c2a11e6

Browse files
committed
Removing check for leading hyphens in .NET FirefoxOptions AddArgument
In prior releases of geckodriver, it was a requirement that all arguments be preceeded by double hyphens ("--"). Geckodriver has now relaxed that restriction, and the .NET bindings need to keep up with that change. This commit removes the check for leading hyphens when calling AddArgument.
1 parent 19e81de commit c2a11e6

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

dotnet/src/webdriver/Firefox/FirefoxOptions.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ public FirefoxOptions()
7676
: base()
7777
{
7878
this.BrowserName = BrowserNameValue;
79-
/*capabilityName == IsMarionetteCapability ||
80-
capabilityName == FirefoxLegacyProfileCapability ||
81-
capabilityName == FirefoxLegacyBinaryCapability ||
82-
capabilityName == FirefoxOptionsCapability)*/
8379
this.AddKnownCapabilityName(FirefoxOptions.FirefoxOptionsCapability, "current FirefoxOptions class instance");
8480
this.AddKnownCapabilityName(FirefoxOptions.IsMarionetteCapability, "UseLegacyImplementation property");
8581
this.AddKnownCapabilityName(FirefoxOptions.FirefoxProfileCapability, "Profile property");
@@ -183,14 +179,6 @@ public void AddArguments(IEnumerable<string> argumentsToAdd)
183179
throw new ArgumentNullException("argumentsToAdd", "argumentsToAdd must not be null");
184180
}
185181

186-
foreach (string argument in argumentsToAdd)
187-
{
188-
if (!argument.StartsWith("--", StringComparison.OrdinalIgnoreCase))
189-
{
190-
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "All arguments must start with two dashes ('--'); argument '{0}' does not.", argument), "argumentsToAdd");
191-
}
192-
}
193-
194182
this.firefoxArguments.AddRange(argumentsToAdd);
195183
}
196184

0 commit comments

Comments
 (0)