We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0163f28 commit acb91c6Copy full SHA for acb91c6
src/main/kotlin/com/lambda/client/util/WebUtils.kt
@@ -57,7 +57,14 @@ object WebUtils {
57
58
fun openWebLink(url: String) {
59
try {
60
- Desktop.getDesktop().browse(URI(url))
+ if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
61
+ Desktop.getDesktop().browse(URI(url))
62
+ } else {
63
+ val exitCode = Runtime.getRuntime().exec(arrayOf("xdg-open", url)).waitFor()
64
+ if (exitCode != 0) {
65
+ LambdaMod.LOG.error("Couldn't open link, xdg-open returned: $exitCode")
66
+ }
67
68
} catch (e: IOException) {
69
LambdaMod.LOG.error("Couldn't open link: $url")
70
}
0 commit comments