Merge branch 'develop' into feature/JAL-3551Pymol
[jalview.git] / src / jalview / util / BrowserLauncher.java
index 0bc09cc..8119daa 100755 (executable)
@@ -233,8 +233,17 @@ public class BrowserLauncher
    */
   static
   {
+
     loadedWithoutErrors = true;
 
+    if (!Platform.isJS())
+    /**
+     * Java only
+     * 
+     * @j2sIgnore
+     * 
+     */
+    {
     String osName = System.getProperty("os.name");
 
     if (osName.startsWith("Mac OS"))
@@ -307,6 +316,7 @@ public class BrowserLauncher
     { // if we haven't hit any errors yet
       loadedWithoutErrors = loadClasses();
     }
+    }
   }
 
   /**
@@ -325,6 +335,15 @@ public class BrowserLauncher
    */
   private static boolean loadClasses()
   {
+
+    if (!Platform.isJS())
+    /**
+     * Java only
+     * 
+     * @j2sIgnore
+     * 
+     */
+    {
     switch (jvm)
     {
     case MRJ_2_0:
@@ -507,6 +526,7 @@ public class BrowserLauncher
       break;
     }
 
+    }
     return true;
   }
 
@@ -523,6 +543,14 @@ public class BrowserLauncher
    */
   private static Object locateBrowser()
   {
+    if (!Platform.isJS())
+    /**
+     * Java only
+     * 
+     * @j2sIgnore
+     * 
+     */
+    {
     if (browser != null)
     {
       return browser;
@@ -689,7 +717,10 @@ public class BrowserLauncher
       break;
     }
 
+    }
+
     return browser;
+
   }
 
   /**
@@ -711,6 +742,20 @@ public class BrowserLauncher
    */
   public static void openURL(String url) throws IOException
   {
+
+    if (Platform.isJS())
+    {
+      Platform.openURL(url);
+      return;
+    }
+    else
+    /**
+     * Java only
+     * 
+     * @j2sIgnore
+     */
+    {
+
     if (!loadedWithoutErrors)
     {
       throw new IOException(MessageManager
@@ -896,8 +941,10 @@ public class BrowserLauncher
 
       break;
     }
+    }
   }
 
+
   /**
    * Methods required for Mac OS X. The presence of native methods does not
    * cause any problems on other platforms.