+11
-2
lines changedFilter options
+11
-2
lines changed Original file line number Diff line number Diff line change
@@ -17,6 +17,8 @@
17
17
package org.openqa.selenium.edge;
18
18
19
19
import com.google.auto.service.AutoService;
20
+
import com.google.common.collect.ImmutableList;
21
+
import com.google.common.collect.ImmutableMap;
20
22
21
23
import org.openqa.selenium.Capabilities;
22
24
import org.openqa.selenium.ImmutableCapabilities;
@@ -25,12 +27,12 @@
25
27
import org.openqa.selenium.WebDriverException;
26
28
import org.openqa.selenium.WebDriverInfo;
27
29
import org.openqa.selenium.chromium.ChromiumDriverInfo;
30
+
import org.openqa.selenium.remote.CapabilityType;
28
31
import org.openqa.selenium.remote.service.DriverFinder;
29
32
30
33
import java.util.Optional;
31
34
32
35
import static org.openqa.selenium.remote.Browser.EDGE;
33
-
import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
34
36
35
37
@AutoService(WebDriverInfo.class)
36
38
public class EdgeDriverInfo extends ChromiumDriverInfo {
@@ -42,7 +44,14 @@ public String getDisplayName() {
42
44
43
45
@Override
44
46
public Capabilities getCanonicalCapabilities() {
45
-
return new ImmutableCapabilities(BROWSER_NAME, EDGE.browserName());
47
+
// Allowing any origin "*" through remote-allow-origins might sound risky but an attacker
48
+
// would need to know the port used to start DevTools to establish a connection. Given
49
+
// these sessions are relatively short-lived, the risk is reduced. Also, this will be
50
+
// removed when we only support Java 11 and above.
51
+
return new ImmutableCapabilities(
52
+
CapabilityType.BROWSER_NAME, EDGE.browserName(),
53
+
EdgeOptions.CAPABILITY,
54
+
ImmutableMap.of("args", ImmutableList.of("--remote-allow-origins=*")));
46
55
}
47
56
48
57
@Override
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4