Skip to content

Commit

Permalink
[java] Deprecating FirefoxBinary
Browse files Browse the repository at this point in the history
It is not needed anymore, as users can
provide the browser binary path with
a `Path` or a `String`.
  • Loading branch information
diemol committed Dec 22, 2023
1 parent 56d149e commit ab18234
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions java/src/org/openqa/selenium/firefox/FirefoxBinary.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.os.ExecutableFinder;

/**
* A wrapper around Firefox's binary. This allows us to locate the binary in a portable way.
*
* @deprecated Use {@link FirefoxOptions#setBinary(Path)} or {@link
* FirefoxOptions#setBinary(String)} instead.
*/
public class FirefoxBinary {

/** Enumerates Firefox channels, according to https://wiki.mozilla.org/RapidRelease */
Expand Down Expand Up @@ -178,7 +184,7 @@ static Executable locateFirefoxBinaryFromSystemProperty() {
if (!binaryName.endsWith(".app")) {
binaryName += ".app";
}
binaryName += "/Contents/MacOS/firefox-bin";
binaryName += "/Contents/MacOS/firefox";
}

binary = new File(binaryName);
Expand Down Expand Up @@ -210,7 +216,7 @@ private static Stream<Executable> locateFirefoxBinariesFromPlatform() {

} else if (current.is(MAC)) {
// system
File binary = new File("/Applications/Firefox.app/Contents/MacOS/firefox-bin");
File binary = new File("/Applications/Firefox.app/Contents/MacOS/firefox");
if (binary.exists()) {
executables.add(new Executable(binary));
}
Expand All @@ -222,7 +228,7 @@ private static Stream<Executable> locateFirefoxBinariesFromPlatform() {
}

} else if (current.is(UNIX)) {
String systemFirefoxBin = new ExecutableFinder().find("firefox-bin");
String systemFirefoxBin = new ExecutableFinder().find("firefox");
if (systemFirefoxBin != null) {
executables.add(new Executable(new File(systemFirefoxBin)));
}
Expand Down

0 comments on commit ab18234

Please sign in to comment.