return default if property is empty string
Former-commit-id: 74dfb76d31
Former-commit-id: 48bcb9243e6763b766e56df224e212f1eb814d88
This commit is contained in:
@ -53,30 +53,32 @@ 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)
|
||||
return chromiumPathsProp.split(",");
|
||||
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)
|
||||
return chromiumPathsProp.split(",");
|
||||
if (!chromiumPathsProp.equals(""))
|
||||
return chromiumPathsProp.split(",");
|
||||
if (isOSX()) {
|
||||
chromiumPathsProp = prop.getProperty("chromium.bins.osx");
|
||||
if (chromiumPathsProp != null)
|
||||
return chromiumPathsProp.split(",");
|
||||
if (!chromiumPathsProp.equals(""))
|
||||
return chromiumPathsProp.split(",");
|
||||
}
|
||||
return new String[] {"ungoogled-chromium", "chromium", "brave", "edge",
|
||||
"ungoogled-chromium", "chrome"};
|
||||
}
|
||||
|
||||
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,10 +91,11 @@ 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)
|
||||
return chromiumPathsProp.split(",");
|
||||
if (!chromiumPathsProp.equals(""))
|
||||
return chromiumPathsProp.split(",");
|
||||
return new String[] {"/Applications/Chromium.app/Contents/MacOS",
|
||||
"/Applications/Chrome.app/Contents/MacOS",
|
||||
"/Applications/Brave.app/Contents/MacOS"};
|
||||
@ -111,10 +114,11 @@ 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)
|
||||
return chromiumPathsProp.split(",");
|
||||
if (!chromiumPathsProp.equals(""))
|
||||
return chromiumPathsProp.split(",");
|
||||
String programFiles = System.getenv("ProgramFiles");
|
||||
String localAppData = System.getenv("LOCALAPPDATA");
|
||||
String programFiles86 = System.getenv("ProgramFiles(x86)");
|
||||
@ -138,7 +142,8 @@ public class I2PChromium extends I2PCommonBrowser {
|
||||
private static String[] chromiumBinsWindows() {
|
||||
String chromiumPathsProp = prop.getProperty("chromium.bins.windows");
|
||||
if (chromiumPathsProp != null)
|
||||
return chromiumPathsProp.split(",");
|
||||
if (!chromiumPathsProp.equals(""))
|
||||
return chromiumPathsProp.split(",");
|
||||
return new String[] {
|
||||
"ungoogled-chromium.exe", "chromium.exe", "brave.exe", "edge.exe",
|
||||
"ungoogled-chromium.exe", "chrome.exe"};
|
||||
|
@ -48,7 +48,8 @@ public class I2PFirefox extends I2PCommonBrowser {
|
||||
public static String[] firefoxPathsUnix() {
|
||||
String firefoxPathsProp = prop.getProperty("firefox.paths.unix");
|
||||
if (firefoxPathsProp != null)
|
||||
return firefoxPathsProp.split(",");
|
||||
if (!firefoxPathsProp.equals(""))
|
||||
return firefoxPathsProp.split(",");
|
||||
return new String[] {"/usr/bin", "/usr/local/bin", "/opt/firefox/bin",
|
||||
"/snap/bin"};
|
||||
}
|
||||
@ -56,11 +57,13 @@ public class I2PFirefox extends I2PCommonBrowser {
|
||||
public static String[] firefoxBinsUnix() {
|
||||
String firefoxPathsProp = prop.getProperty("firefox.bins.unix");
|
||||
if (firefoxPathsProp != null)
|
||||
return firefoxPathsProp.split(",");
|
||||
if (!firefoxPathsProp.equals(""))
|
||||
return firefoxPathsProp.split(",");
|
||||
if (isOSX()) {
|
||||
firefoxPathsProp = prop.getProperty("firefox.bins.osx");
|
||||
if (firefoxPathsProp != null)
|
||||
return firefoxPathsProp.split(",");
|
||||
if (!firefoxPathsProp.equals(""))
|
||||
return firefoxPathsProp.split(",");
|
||||
}
|
||||
return new String[] {"firefox", "firefox-bin", "firefox-esr",
|
||||
"waterfox", "waterfox-bin", "librewolf"};
|
||||
@ -82,7 +85,8 @@ public class I2PFirefox extends I2PCommonBrowser {
|
||||
public static String[] firefoxPathsOSX() {
|
||||
String firefoxPathsProp = prop.getProperty("firefox.paths.osx");
|
||||
if (firefoxPathsProp != null)
|
||||
return firefoxPathsProp.split(",");
|
||||
if (!firefoxPathsProp.equals(""))
|
||||
return firefoxPathsProp.split(",");
|
||||
return new String[] {"/Applications/Tor Browser.app/Contents/MacOS",
|
||||
"/Applications/Firefox.app/Contents/MacOS",
|
||||
"/Applications/Waterfox.app/Contents/MacOS",
|
||||
@ -104,7 +108,8 @@ public class I2PFirefox extends I2PCommonBrowser {
|
||||
public static String[] firefoxPathsWindows() {
|
||||
String firefoxPathsProp = prop.getProperty("firefox.paths.windows");
|
||||
if (firefoxPathsProp != null)
|
||||
return firefoxPathsProp.split(",");
|
||||
if (!firefoxPathsProp.equals(""))
|
||||
return firefoxPathsProp.split(",");
|
||||
String userHome = System.getProperty("user.home");
|
||||
String programFiles = System.getenv("ProgramFiles");
|
||||
// String localAppData = System.getenv("LOCALAPPDATA");
|
||||
@ -129,7 +134,8 @@ public class I2PFirefox extends I2PCommonBrowser {
|
||||
private static String[] firefoxBinsWindows() {
|
||||
String firefoxPathsProp = prop.getProperty("firefox.bins.windows");
|
||||
if (firefoxPathsProp != null)
|
||||
return firefoxPathsProp.split(",");
|
||||
if (!firefoxPathsProp.equals(""))
|
||||
return firefoxPathsProp.split(",");
|
||||
return new String[] {
|
||||
"firefox.exe", "firefox-bin.exe", "firefox-esr.exe",
|
||||
"waterfox.exe", "waterfox-bin.exe", "librewolf.exe",
|
||||
|
Reference in New Issue
Block a user