Revision: 4049 http://vexi.svn.sourceforge.net/vexi/?rev=4049&view=rev Author: clrg Date: 2011-03-15 18:11:43 +0000 (Tue, 15 Mar 2011)
Log Message: ----------- Attempt to respect user's browser preference in *nix Modified Paths: -------------- trunk/org.vexi-core.main/src/main/java/org/vexi/plat/JVM.java Modified: trunk/org.vexi-core.main/src/main/java/org/vexi/plat/JVM.java =================================================================== --- trunk/org.vexi-core.main/src/main/java/org/vexi/plat/JVM.java 2011-03-15 12:53:21 UTC (rev 4048) +++ trunk/org.vexi-core.main/src/main/java/org/vexi/plat/JVM.java 2011-03-15 18:11:43 UTC (rev 4049) @@ -12,7 +12,7 @@ public abstract class JVM extends Platform { /** default implementation is from http://www.centerkey.com/java/browser/ */ - protected void _newBrowserWindow(String url) throws JSExn{ + protected void _newBrowserWindow(String url) throws JSExn { String osName = System.getProperty("os.name"); try { if (osName.startsWith("Mac OS")) { @@ -22,8 +22,9 @@ } else if (osName.startsWith("Windows")) { Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); } else { - //assume Unix or Linux - String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" }; + // assume Unix or Linux + // REMARK xdg-open is a freedesktop.org helper utility + String[] browsers = { "xdg-open", "firefox", "google-chrome", "konqueror", "opera", "epiphany", "mozilla", "netscape" }; String browser = null; for (int count = 0; count < browsers.length && browser == null; count++) { if (Runtime.getRuntime().exec( new String[] {"which", browsers[count]}).waitFor() == 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn