]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/function/browser/BrowserLauncher.java
Version 18, July 2015
[GpsPrune.git] / tim / prune / function / browser / BrowserLauncher.java
index d23a2f72cee7920c3173ddebcab15401fceaae35..7c6fa58056a19279ab7306599c711268412ab45c 100644 (file)
@@ -26,12 +26,15 @@ public abstract class BrowserLauncher
                {
                        // which exists, so try browsers in turn
                        String[] browsersToTry = {"firefox", "iceweasel", "konqueror", "opera", "epiphany",
-                               "mozilla", "safari", "google-chrome", "lynx"};
+                               "mozilla", "chromium", "midori", "safari", "lynx"};
                        String browserFound = null;
-                       for (int i=0; i<browsersToTry.length && browserFound == null; i++)
+                       for (String browser : browsersToTry)
                        {
-                               if (commandExists(browsersToTry[i]))
-                                       browserFound = browsersToTry[i];
+                               if (commandExists(browser))
+                               {
+                                       browserFound = browser;
+                                       break;
+                               }
                        }
                        if (browserFound != null) {
                                _browserCommand = new String[] {browserFound, null};
@@ -83,6 +86,7 @@ public abstract class BrowserLauncher
         */
        public static void launchBrowser(String inUrl)
        {
+               if (inUrl == null) {return;}
                // First choice is to try the Desktop library from java 6, if available
                try {
                        Class<?> d = Class.forName("java.awt.Desktop");