|
17 | 17 |
|
18 | 18 | package org.openqa.selenium.firefox; |
19 | 19 |
|
20 | | -import static java.util.Collections.unmodifiableList; |
21 | | -import static java.util.concurrent.TimeUnit.MILLISECONDS; |
22 | | -import static org.openqa.selenium.remote.Browser.FIREFOX; |
23 | | - |
24 | 20 | import com.google.auto.service.AutoService; |
25 | 21 | import com.google.common.io.ByteStreams; |
26 | 22 |
|
|
39 | 35 | import java.util.Map; |
40 | 36 | import java.util.Optional; |
41 | 37 |
|
| 38 | +import static java.util.Collections.unmodifiableList; |
| 39 | +import static java.util.concurrent.TimeUnit.MILLISECONDS; |
| 40 | +import static org.openqa.selenium.remote.Browser.FIREFOX; |
| 41 | + |
42 | 42 | /** |
43 | 43 | * Manages the life and death of an GeckoDriver aka 'wires'. |
44 | 44 | */ |
@@ -187,15 +187,18 @@ protected File findDefaultExecutable() { |
187 | 187 | @Override |
188 | 188 | protected List<String> createArgs() { |
189 | 189 | List<String> args = new ArrayList<>(); |
| 190 | + int wsPort = PortProber.findFreePort(); |
190 | 191 | args.add(String.format("--port=%d", getPort())); |
191 | | - args.add(String.format("--websocket-port=%d", PortProber.findFreePort())); |
| 192 | + args.add(String.format("--websocket-port=%d", wsPort)); |
| 193 | + args.add(String.format("--allow-origins=http://localhost:%d", wsPort)); |
192 | 194 | if (firefoxBinary != null) { |
193 | 195 | args.add("-b"); |
194 | 196 | args.add(firefoxBinary.getPath()); |
195 | 197 | } else { |
196 | 198 | // Read system property for Firefox binary and use those if they are set |
197 | | - Optional<Executable> executable = Optional.ofNullable(FirefoxBinary.locateFirefoxBinaryFromSystemProperty()); |
198 | | - executable.ifPresent( e -> { |
| 199 | + Optional<Executable> executable = |
| 200 | + Optional.ofNullable(FirefoxBinary.locateFirefoxBinaryFromSystemProperty()); |
| 201 | + executable.ifPresent(e -> { |
199 | 202 | args.add("-b"); |
200 | 203 | args.add(e.getPath()); |
201 | 204 | }); |
|
0 commit comments