File tree Expand file tree Collapse file tree
java/src/org/openqa/selenium/chrome Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818package org .openqa .selenium .chrome ;
1919
2020import com .google .auto .service .AutoService ;
21+ import com .google .common .collect .ImmutableList ;
22+ import com .google .common .collect .ImmutableMap ;
2123
2224import org .openqa .selenium .Capabilities ;
2325import org .openqa .selenium .ImmutableCapabilities ;
@@ -43,7 +45,14 @@ public String getDisplayName() {
4345
4446 @ Override
4547 public Capabilities getCanonicalCapabilities () {
46- return new ImmutableCapabilities (CapabilityType .BROWSER_NAME , CHROME .browserName ());
48+ // Allowing any origin "*" through remote-allow-origins might sound risky but an attacker
49+ // would need to know the port used to start DevTools to establish a connection. Given
50+ // these sessions are relatively short-lived, the risk is reduced. Also, this will be
51+ // removed when we only support Java 11 and above.
52+ return new ImmutableCapabilities (
53+ CapabilityType .BROWSER_NAME , CHROME .browserName (),
54+ ChromeOptions .CAPABILITY ,
55+ ImmutableMap .of ("args" , ImmutableList .of ("--remote-allow-origins=*" )));
4756 }
4857
4958 @ Override
You can’t perform that action at this time.
0 commit comments