return default if property is empty string
Former-commit-id: 74dfb76d31
Former-commit-id: 48bcb9243e6763b766e56df224e212f1eb814d88
This commit is contained in:
@ -53,21 +53,24 @@ public class I2PChromium extends I2PCommonBrowser {
|
||||
I2PChromiumProfileBuilder.usability = true;
|
||||
}
|
||||
|
||||
public static String[] chromiumPathsUnix() {
|
||||
private static String[] chromiumPathsUnix() {
|
||||
String chromiumPathsProp = prop.getProperty("chromium.paths.unix");
|
||||
if (chromiumPathsProp != null)
|
||||
if (!chromiumPathsProp.equals(""))
|
||||
return chromiumPathsProp.split(",");
|
||||
return new String[] {"/usr/bin", "/usr/local/bin", "/opt/chromium/bin",
|
||||
"/snap/bin"};
|
||||
}
|
||||
|
||||
public static String[] chromiumBinsUnix() {
|
||||
private static String[] chromiumBinsUnix() {
|
||||
String chromiumPathsProp = prop.getProperty("chromium.bins.unix");
|
||||
if (chromiumPathsProp != null)
|
||||
if (!chromiumPathsProp.equals(""))
|
||||
return chromiumPathsProp.split(",");
|
||||
if (isOSX()) {
|
||||
chromiumPathsProp = prop.getProperty("chromium.bins.osx");
|
||||
if (chromiumPathsProp != null)
|
||||
if (!chromiumPathsProp.equals(""))
|
||||
return chromiumPathsProp.split(",");
|
||||
}
|
||||
return new String[] {"ungoogled-chromium", "chromium", "brave", "edge",
|
||||
@ -75,8 +78,7 @@ public class I2PChromium extends I2PCommonBrowser {
|
||||
}
|
||||
|
||||
private static String[] FIND_CHROMIUM_SEARCH_PATHS_UNIX() {
|
||||
String[] path = new String[] {"/usr/bin", "/usr/local/bin",
|
||||
"/opt/chrome/bin", "/snap/bin"};
|
||||
String[] path = chromiumPathsUnix();
|
||||
String[] exes = chromiumBinsUnix();
|
||||
|
||||
String[] exePath = new String[path.length * exes.length];
|
||||
@ -89,9 +91,10 @@ public class I2PChromium extends I2PCommonBrowser {
|
||||
}
|
||||
return exePath;
|
||||
}
|
||||
public static String[] chromiumPathsOSX() {
|
||||
private static String[] chromiumPathsOSX() {
|
||||
String chromiumPathsProp = prop.getProperty("chromium.paths.osx");
|
||||
if (chromiumPathsProp != null)
|
||||
if (!chromiumPathsProp.equals(""))
|
||||
return chromiumPathsProp.split(",");
|
||||
return new String[] {"/Applications/Chromium.app/Contents/MacOS",
|
||||
"/Applications/Chrome.app/Contents/MacOS",
|
||||
@ -111,9 +114,10 @@ public class I2PChromium extends I2PCommonBrowser {
|
||||
return exePath;
|
||||
}
|
||||
|
||||
public static String[] chromiumPathsWindows() {
|
||||
private static String[] chromiumPathsWindows() {
|
||||
String chromiumPathsProp = prop.getProperty("chromium.paths.windows");
|
||||
if (chromiumPathsProp != null)
|
||||
if (!chromiumPathsProp.equals(""))
|
||||
return chromiumPathsProp.split(",");
|
||||
String programFiles = System.getenv("ProgramFiles");
|
||||
String localAppData = System.getenv("LOCALAPPDATA");
|
||||
@ -138,6 +142,7 @@ public class I2PChromium extends I2PCommonBrowser {
|
||||
private static String[] chromiumBinsWindows() {
|
||||
String chromiumPathsProp = prop.getProperty("chromium.bins.windows");
|
||||
if (chromiumPathsProp != null)
|
||||
if (!chromiumPathsProp.equals(""))
|
||||
return chromiumPathsProp.split(",");
|
||||
return new String[] {
|
||||
"ungoogled-chromium.exe", "chromium.exe", "brave.exe", "edge.exe",
|
||||
|
@ -48,6 +48,7 @@ public class I2PFirefox extends I2PCommonBrowser {
|
||||
public static String[] firefoxPathsUnix() {
|
||||
String firefoxPathsProp = prop.getProperty("firefox.paths.unix");
|
||||
if (firefoxPathsProp != null)
|
||||
if (!firefoxPathsProp.equals(""))
|
||||
return firefoxPathsProp.split(",");
|
||||
return new String[] {"/usr/bin", "/usr/local/bin", "/opt/firefox/bin",
|
||||
"/snap/bin"};
|
||||
@ -56,10 +57,12 @@ public class I2PFirefox extends I2PCommonBrowser {
|
||||
public static String[] firefoxBinsUnix() {
|
||||
String firefoxPathsProp = prop.getProperty("firefox.bins.unix");
|
||||
if (firefoxPathsProp != null)
|
||||
if (!firefoxPathsProp.equals(""))
|
||||
return firefoxPathsProp.split(",");
|
||||
if (isOSX()) {
|
||||
firefoxPathsProp = prop.getProperty("firefox.bins.osx");
|
||||
if (firefoxPathsProp != null)
|
||||
if (!firefoxPathsProp.equals(""))
|
||||
return firefoxPathsProp.split(",");
|
||||
}
|
||||
return new String[] {"firefox", "firefox-bin", "firefox-esr",
|
||||
@ -82,6 +85,7 @@ public class I2PFirefox extends I2PCommonBrowser {
|
||||
public static String[] firefoxPathsOSX() {
|
||||
String firefoxPathsProp = prop.getProperty("firefox.paths.osx");
|
||||
if (firefoxPathsProp != null)
|
||||
if (!firefoxPathsProp.equals(""))
|
||||
return firefoxPathsProp.split(",");
|
||||
return new String[] {"/Applications/Tor Browser.app/Contents/MacOS",
|
||||
"/Applications/Firefox.app/Contents/MacOS",
|
||||
@ -104,6 +108,7 @@ public class I2PFirefox extends I2PCommonBrowser {
|
||||
public static String[] firefoxPathsWindows() {
|
||||
String firefoxPathsProp = prop.getProperty("firefox.paths.windows");
|
||||
if (firefoxPathsProp != null)
|
||||
if (!firefoxPathsProp.equals(""))
|
||||
return firefoxPathsProp.split(",");
|
||||
String userHome = System.getProperty("user.home");
|
||||
String programFiles = System.getenv("ProgramFiles");
|
||||
@ -129,6 +134,7 @@ public class I2PFirefox extends I2PCommonBrowser {
|
||||
private static String[] firefoxBinsWindows() {
|
||||
String firefoxPathsProp = prop.getProperty("firefox.bins.windows");
|
||||
if (firefoxPathsProp != null)
|
||||
if (!firefoxPathsProp.equals(""))
|
||||
return firefoxPathsProp.split(",");
|
||||
return new String[] {
|
||||
"firefox.exe", "firefox-bin.exe", "firefox-esr.exe",
|
||||
|
Reference in New Issue
Block a user