Skip to content

Commit a4e5719

Browse files
DrMarcIIlukeis
authored andcommitted
Fixes to FirefoxOptions.java (#3327)
* Fixes to FirefoxOptions.java - Remove unneeded check for both prefs and profile being present: According to mozilla/geckodriver#421 having both is valid. - Add getProfile method: Allows for use in intermediate nodes that need to modify the profile e.g. to add additional certs or extensions. * Fix type error.
1 parent 45cf95f commit a4e5719

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

java/client/src/org/openqa/selenium/firefox/FirefoxOptions.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ public FirefoxOptions setProfile(FirefoxProfile profile) {
136136
return this;
137137
}
138138

139+
public FirefoxProfile getProfile() {
140+
return this.profile;
141+
}
142+
139143
// Confusing API. Keeping package visible only
140144
FirefoxOptions setProfileSafely(FirefoxProfile profile) {
141145
if (profile == null) {
@@ -183,11 +187,6 @@ public DesiredCapabilities addTo(DesiredCapabilities capabilities) {
183187

184188
Object priorProfile = capabilities.getCapability(PROFILE);
185189
if (priorProfile != null) {
186-
if (!booleanPrefs.isEmpty() || !intPrefs.isEmpty() || !stringPrefs.isEmpty()) {
187-
throw new IllegalStateException(
188-
"Unable to determine if preferences set on this option " +
189-
"are the same as the profile in the capabilities");
190-
}
191190
if (!priorProfile.equals(profile)) {
192191
throw new IllegalStateException(
193192
"Profile has been set on both the capabilities and these options, but they're " +

0 commit comments

Comments
 (0)