Skip to content

Commit ed04104

Browse files
committed
Use an InMemorySession for legacy FirefoxDriver
The profile to use has been extracted to the XpiDriverService, so if we use that and a ServicedSession, it becomes impossible to pass the profile to the driver. This is a sub-optimal way to make things work.
1 parent 30d481d commit ed04104

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

java/server/src/org/openqa/selenium/remote/server/ActiveSessionFactory.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,17 @@ public ActiveSessionFactory() {
7171
StreamSupport.stream(loadDriverProviders().spliterator(), false)
7272
.forEach(p -> builder.put(p::canCreateDriverInstanceFor, new InMemorySession.Factory(p)));
7373

74-
ImmutableMap.<Predicate<Capabilities>, String>builder()
75-
.put(caps -> {
74+
bind(
75+
builder,
76+
"org.openqa.selenium.firefox.FirefoxDriver",
77+
caps -> {
7678
Object marionette = caps.getCapability("marionette");
7779

7880
return marionette instanceof Boolean && !(Boolean) marionette;
79-
}, "org.openqa.selenium.firefox.XpiDriverService")
81+
},
82+
firefox());
83+
84+
ImmutableMap.<Predicate<Capabilities>, String>builder()
8085
.put(browserName(chrome()), "org.openqa.selenium.chrome.ChromeDriverService")
8186
.put(containsKey("chromeOptions"), "org.openqa.selenium.chrome.ChromeDriverService")
8287
.put(browserName(edge()), "org.openqa.selenium.edge.EdgeDriverService")

0 commit comments

Comments
 (0)