BrowserLauncher: remove toLowerCase()

This commit is contained in:
Sergey Ponomarev 2024-09-14 23:22:51 +03:00
parent fb6333a50f
commit 8669fc3b8e

View File

@ -32,7 +32,8 @@ public class BrowserLauncher {
try { try {
Desktop.getDesktop().browse(new URI(url)); Desktop.getDesktop().browse(new URI(url));
} catch (Exception ex) { } catch (Exception ex) {
Runtime.getRuntime().exec("xdg-open " + url); // fallback on Linux
Runtime.getRuntime().exec("xdg-open " + url);
} }
} else { } else {
File f = new File(url); File f = new File(url);
@ -40,7 +41,7 @@ public class BrowserLauncher {
try { try {
Desktop.getDesktop().open(f); Desktop.getDesktop().open(f);
} catch (Exception ex) { } catch (Exception ex) {
if (!url.toLowerCase().startsWith("//")) { if (!url.startsWith("//")) {
url = "//" + url; url = "//" + url;
} }
Desktop.getDesktop().browse(new URI("http:" + url)); Desktop.getDesktop().browse(new URI("http:" + url));