@@ -139,30 +139,6 @@ public string Version
139
139
}
140
140
}
141
141
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
-
166
142
/// <summary>
167
143
/// Gets or sets a value indicating whether the browser accepts SSL certificates.
168
144
/// </summary>
@@ -248,7 +224,7 @@ public static DesiredCapabilities HtmlUnit()
248
224
public static DesiredCapabilities HtmlUnitWithJavaScript ( )
249
225
{
250
226
DesiredCapabilities dc = new DesiredCapabilities ( "htmlunit" , string . Empty , new Platform ( PlatformType . Any ) ) ;
251
- dc . IsJavaScriptEnabled = true ;
227
+ dc . SetCapability ( CapabilityType . IsJavaScriptEnabled , true ) ;
252
228
return dc ;
253
229
}
254
230
@@ -278,7 +254,6 @@ public static DesiredCapabilities Chrome()
278
254
{
279
255
// This is strangely inconsistent.
280
256
DesiredCapabilities dc = new DesiredCapabilities ( "chrome" , string . Empty , new Platform ( PlatformType . Any ) ) ;
281
- dc . IsJavaScriptEnabled = true ;
282
257
return dc ;
283
258
}
284
259
@@ -383,7 +358,6 @@ public override int GetHashCode()
383
358
result = this . BrowserName != null ? this . BrowserName . GetHashCode ( ) : 0 ;
384
359
result = ( 31 * result ) + ( this . Version != null ? this . Version . GetHashCode ( ) : 0 ) ;
385
360
result = ( 31 * result ) + ( this . Platform != null ? this . Platform . GetHashCode ( ) : 0 ) ;
386
- result = ( 31 * result ) + ( this . IsJavaScriptEnabled ? 1 : 0 ) ;
387
361
return result ;
388
362
}
389
363
@@ -393,7 +367,7 @@ public override int GetHashCode()
393
367
/// <returns>String of capabilities being used</returns>
394
368
public override string ToString ( )
395
369
{
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 ) ;
397
371
}
398
372
399
373
/// <summary>
@@ -414,11 +388,6 @@ public override bool Equals(object obj)
414
388
return false ;
415
389
}
416
390
417
- if ( this . IsJavaScriptEnabled != other . IsJavaScriptEnabled )
418
- {
419
- return false ;
420
- }
421
-
422
391
if ( this . BrowserName != null ? this . BrowserName != other . BrowserName : other . BrowserName != null )
423
392
{
424
393
return false ;
0 commit comments