diff options
author | Joey Hess <joey@kitenet.net> | 2013-04-18 12:52:55 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-04-18 12:52:55 -0400 |
commit | 7fa1a12a2435e69d7f4838cd373aee4bfb2a66df (patch) | |
tree | 05b23b7bf1d6d82d55fcbb299c75c943f7c3f743 /Utility | |
parent | 3fa062bb3e71fb7cabc0b6814d22bcbe7602f275 (diff) |
untested browser opening on Android
I've found multiple references to using the `am` command from the adb shell
to open a browser. So I assume it also works in a terminal emulator.
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/WebApp.hs | 13 |
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 |