Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9e5a640

Browse files
committedAug 15, 2017
Removing deprecated IsJavaScriptEnabled property from .NET
1 parent e353672 commit 9e5a640

File tree

2 files changed

+2
-38
lines changed

2 files changed

+2
-38
lines changed
 

‎dotnet/src/webdriver/ICapabilities.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ public interface ICapabilities
3838
/// </summary>
3939
string Version { get; }
4040

41-
/// <summary>
42-
/// Gets a value indicating whether the browser is JavaScript enabled
43-
/// </summary>
44-
bool IsJavaScriptEnabled { get; }
45-
4641
/// <summary>
4742
/// Gets a value indicating whether the browser has a given capability.
4843
/// </summary>

‎dotnet/src/webdriver/Remote/DesiredCapabilities.cs

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -139,30 +139,6 @@ public string Version
139139
}
140140
}
141141

142-
/// <summary>
143-
/// Gets or sets a value indicating whether the browser is JavaScript enabled
144-
/// </summary>
145-
[Obsolete("Capability is not allowed by the W3C specification, and will be removed in a future version of the bindings.")]
146-
public bool IsJavaScriptEnabled
147-
{
148-
get
149-
{
150-
bool javascriptEnabled = false;
151-
object capabilityValue = this.GetCapability(CapabilityType.IsJavaScriptEnabled);
152-
if (capabilityValue != null)
153-
{
154-
javascriptEnabled = (bool)capabilityValue;
155-
}
156-
157-
return javascriptEnabled;
158-
}
159-
160-
set
161-
{
162-
this.SetCapability(CapabilityType.IsJavaScriptEnabled, value);
163-
}
164-
}
165-
166142
/// <summary>
167143
/// Gets or sets a value indicating whether the browser accepts SSL certificates.
168144
/// </summary>
@@ -248,7 +224,7 @@ public static DesiredCapabilities HtmlUnit()
248224
public static DesiredCapabilities HtmlUnitWithJavaScript()
249225
{
250226
DesiredCapabilities dc = new DesiredCapabilities("htmlunit", string.Empty, new Platform(PlatformType.Any));
251-
dc.IsJavaScriptEnabled = true;
227+
dc.SetCapability(CapabilityType.IsJavaScriptEnabled, true);
252228
return dc;
253229
}
254230

@@ -278,7 +254,6 @@ public static DesiredCapabilities Chrome()
278254
{
279255
// This is strangely inconsistent.
280256
DesiredCapabilities dc = new DesiredCapabilities("chrome", string.Empty, new Platform(PlatformType.Any));
281-
dc.IsJavaScriptEnabled = true;
282257
return dc;
283258
}
284259

@@ -383,7 +358,6 @@ public override int GetHashCode()
383358
result = this.BrowserName != null ? this.BrowserName.GetHashCode() : 0;
384359
result = (31 * result) + (this.Version != null ? this.Version.GetHashCode() : 0);
385360
result = (31 * result) + (this.Platform != null ? this.Platform.GetHashCode() : 0);
386-
result = (31 * result) + (this.IsJavaScriptEnabled ? 1 : 0);
387361
return result;
388362
}
389363

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

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

417-
if (this.IsJavaScriptEnabled != other.IsJavaScriptEnabled)
418-
{
419-
return false;
420-
}
421-
422391
if (this.BrowserName != null ? this.BrowserName != other.BrowserName : other.BrowserName != null)
423392
{
424393
return false;

0 commit comments

Comments
 (0)
Please sign in to comment.