Skip to content

Commit 1b600b1

Browse files
committed
[java] Removing deprecated SUPPORTS_JAVASCRIPT cap
1 parent 683b19d commit 1b600b1

File tree

3 files changed

+0
-31
lines changed

3 files changed

+0
-31
lines changed

java/src/org/openqa/selenium/remote/CapabilityType.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020
/** Commonly seen remote webdriver capabilities. */
2121
public interface CapabilityType {
2222

23-
/**
24-
* @deprecated Non W3C compliant
25-
*/
26-
@Deprecated String SUPPORTS_JAVASCRIPT = "javascriptEnabled";
27-
2823
String BROWSER_NAME = "browserName";
2924
String PLATFORM_NAME = "platformName";
3025
String BROWSER_VERSION = "browserVersion";

java/src/org/openqa/selenium/remote/DesiredCapabilities.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
2222
import static org.openqa.selenium.remote.CapabilityType.BROWSER_VERSION;
2323
import static org.openqa.selenium.remote.CapabilityType.PLATFORM_NAME;
24-
import static org.openqa.selenium.remote.CapabilityType.SUPPORTS_JAVASCRIPT;
2524

2625
import java.util.Map;
2726
import org.openqa.selenium.Capabilities;
@@ -70,14 +69,6 @@ public void setPlatform(Platform platform) {
7069
setCapability(PLATFORM_NAME, platform);
7170
}
7271

73-
/**
74-
* @deprecated This setting has no effect in W3C sessions, and JWP support is going away soon.
75-
*/
76-
@Deprecated
77-
public void setJavascriptEnabled(boolean javascriptEnabled) {
78-
setCapability(SUPPORTS_JAVASCRIPT, javascriptEnabled);
79-
}
80-
8172
public boolean acceptInsecureCerts() {
8273
if (getCapability(ACCEPT_INSECURE_CERTS) != null) {
8374
Object raw = getCapability(ACCEPT_INSECURE_CERTS);

java/src/org/openqa/selenium/remote/RemoteWebDriver.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import static java.util.concurrent.TimeUnit.SECONDS;
2222
import static java.util.logging.Level.SEVERE;
2323
import static org.openqa.selenium.remote.CapabilityType.PLATFORM_NAME;
24-
import static org.openqa.selenium.remote.CapabilityType.SUPPORTS_JAVASCRIPT;
2524

2625
import com.google.common.collect.ImmutableMap;
2726
import com.google.common.collect.ImmutableSet;
@@ -471,12 +470,6 @@ public String getWindowHandle() {
471470

472471
@Override
473472
public Object executeScript(String script, Object... args) {
474-
if (!isJavascriptEnabled()) {
475-
throw new UnsupportedOperationException(
476-
"You must be using an underlying instance of WebDriver that supports executing"
477-
+ " javascript");
478-
}
479-
480473
List<Object> convertedArgs =
481474
Stream.of(args).map(new WebElementToJsonConverter()).collect(Collectors.toList());
482475

@@ -485,22 +478,12 @@ public Object executeScript(String script, Object... args) {
485478

486479
@Override
487480
public Object executeAsyncScript(String script, Object... args) {
488-
if (!isJavascriptEnabled()) {
489-
throw new UnsupportedOperationException(
490-
"You must be using an underlying instance of "
491-
+ "WebDriver that supports executing javascript");
492-
}
493-
494481
List<Object> convertedArgs =
495482
Stream.of(args).map(new WebElementToJsonConverter()).collect(Collectors.toList());
496483

497484
return execute(DriverCommand.EXECUTE_ASYNC_SCRIPT(script, convertedArgs)).getValue();
498485
}
499486

500-
private boolean isJavascriptEnabled() {
501-
return getCapabilities().is(SUPPORTS_JAVASCRIPT);
502-
}
503-
504487
@Override
505488
public TargetLocator switchTo() {
506489
return new RemoteTargetLocator();

0 commit comments

Comments
 (0)