summaryrefslogtreecommitdiff
path: root/Utility/WebApp.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Utility/WebApp.hs')
-rw-r--r--Utility/WebApp.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs
index 97a6879ec..bafc9ac22 100644
--- a/Utility/WebApp.hs
+++ b/Utility/WebApp.hs
@@ -40,12 +40,17 @@ import Control.Concurrent
localhost :: HostName
localhost = "localhost"
-{- Command to use to run a web browser. -}
-browserCommand :: FilePath
+{- Builds a command to use to start or open a web browser showing an url. -}
+browserProc :: String -> CreateProcess
#ifdef darwin_HOST_OS
-browserCommand = "open"
+browserProc url = proc "open" [url]
#else
-browserCommand = "xdg-open"
+#ifdef __ANDROID__
+browserProc url = proc "am"
+ ["start", "-a", "android.intent.action.VIEW", "-d", url]
+#else
+browserProc url = proc "xdg-open" [url]
+#endif
#endif
{- Binds to a socket on localhost, or possibly a different specified