Skip to content

Commit

Permalink
Removing check for leading hyphens in .NET FirefoxOptions AddArgument
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jimevans committed Jan 28, 2018
1 parent 19e81de commit c2a11e6
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions dotnet/src/webdriver/Firefox/FirefoxOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ public FirefoxOptions()
: base()
{
this.BrowserName = BrowserNameValue;
/*capabilityName == IsMarionetteCapability ||
capabilityName == FirefoxLegacyProfileCapability ||
capabilityName == FirefoxLegacyBinaryCapability ||
capabilityName == FirefoxOptionsCapability)*/
this.AddKnownCapabilityName(FirefoxOptions.FirefoxOptionsCapability, "current FirefoxOptions class instance");
this.AddKnownCapabilityName(FirefoxOptions.IsMarionetteCapability, "UseLegacyImplementation property");
this.AddKnownCapabilityName(FirefoxOptions.FirefoxProfileCapability, "Profile property");
Expand Down Expand Up @@ -183,14 +179,6 @@ public void AddArguments(IEnumerable<string> argumentsToAdd)
throw new ArgumentNullException("argumentsToAdd", "argumentsToAdd must not be null");
}

foreach (string argument in argumentsToAdd)
{
if (!argument.StartsWith("--", StringComparison.OrdinalIgnoreCase))
{
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "All arguments must start with two dashes ('--'); argument '{0}' does not.", argument), "argumentsToAdd");
}
}

this.firefoxArguments.AddRange(argumentsToAdd);
}

Expand Down

0 comments on commit c2a11e6

Please sign in to comment.