Skip to content

Commit

Permalink
Removing deprecated IsJavaScriptEnabled property from .NET
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Aug 15, 2017
1 parent e353672 commit 9e5a640
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 38 deletions.
5 changes: 0 additions & 5 deletions dotnet/src/webdriver/ICapabilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ public interface ICapabilities
/// </summary>
string Version { get; }

/// <summary>
/// Gets a value indicating whether the browser is JavaScript enabled
/// </summary>
bool IsJavaScriptEnabled { get; }

/// <summary>
/// Gets a value indicating whether the browser has a given capability.
/// </summary>
Expand Down
35 changes: 2 additions & 33 deletions dotnet/src/webdriver/Remote/DesiredCapabilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,30 +139,6 @@ public string Version
}
}

/// <summary>
/// Gets or sets a value indicating whether the browser is JavaScript enabled
/// </summary>
[Obsolete("Capability is not allowed by the W3C specification, and will be removed in a future version of the bindings.")]
public bool IsJavaScriptEnabled
{
get
{
bool javascriptEnabled = false;
object capabilityValue = this.GetCapability(CapabilityType.IsJavaScriptEnabled);
if (capabilityValue != null)
{
javascriptEnabled = (bool)capabilityValue;
}

return javascriptEnabled;
}

set
{
this.SetCapability(CapabilityType.IsJavaScriptEnabled, value);
}
}

/// <summary>
/// Gets or sets a value indicating whether the browser accepts SSL certificates.
/// </summary>
Expand Down Expand Up @@ -248,7 +224,7 @@ public static DesiredCapabilities HtmlUnit()
public static DesiredCapabilities HtmlUnitWithJavaScript()
{
DesiredCapabilities dc = new DesiredCapabilities("htmlunit", string.Empty, new Platform(PlatformType.Any));
dc.IsJavaScriptEnabled = true;
dc.SetCapability(CapabilityType.IsJavaScriptEnabled, true);
return dc;
}

Expand Down Expand Up @@ -278,7 +254,6 @@ public static DesiredCapabilities Chrome()
{
// This is strangely inconsistent.
DesiredCapabilities dc = new DesiredCapabilities("chrome", string.Empty, new Platform(PlatformType.Any));
dc.IsJavaScriptEnabled = true;
return dc;
}

Expand Down Expand Up @@ -383,7 +358,6 @@ public override int GetHashCode()
result = this.BrowserName != null ? this.BrowserName.GetHashCode() : 0;
result = (31 * result) + (this.Version != null ? this.Version.GetHashCode() : 0);
result = (31 * result) + (this.Platform != null ? this.Platform.GetHashCode() : 0);
result = (31 * result) + (this.IsJavaScriptEnabled ? 1 : 0);
return result;
}

Expand All @@ -393,7 +367,7 @@ public override int GetHashCode()
/// <returns>String of capabilities being used</returns>
public override string ToString()
{
return string.Format(CultureInfo.InvariantCulture, "Capabilities [BrowserName={0}, IsJavaScriptEnabled={1}, Platform={2}, Version={3}]", this.BrowserName, this.IsJavaScriptEnabled, this.Platform.PlatformType.ToString(), this.Version);
return string.Format(CultureInfo.InvariantCulture, "Capabilities [BrowserName={0}, Platform={1}, Version={2}]", this.BrowserName, this.Platform.PlatformType.ToString(), this.Version);
}

/// <summary>
Expand All @@ -414,11 +388,6 @@ public override bool Equals(object obj)
return false;
}

if (this.IsJavaScriptEnabled != other.IsJavaScriptEnabled)
{
return false;
}

if (this.BrowserName != null ? this.BrowserName != other.BrowserName : other.BrowserName != null)
{
return false;
Expand Down

0 comments on commit 9e5a640

Please sign in to comment.